Expand description
The one configuration file a running supervisor reads, and its validation.
§Every field this program takes is declared once, here
ConfigField is that declaration: one variant per configured value, each
carrying the dotted key it is spelled under. Two things read it rather than
restating it — the refusal a bad value produces names its field through it,
and this crate’s own tier walks it, driving a server against a configuration
in which each field in turn is unacceptable. A field added to the shapes
below and not to ConfigField::ALL fails that tier’s own coverage check,
so the walk cannot fall behind the type.
§Validation happens at startup, and names the field
A value that cannot work is refused where it is configured rather than at
the first request that needs it, and the refusal carries the field’s own key
so an operator editing the file knows which line to change. That includes
the two values only the machine can rule on: an OctoPrint address nothing
answers at and a key that instance refuses are both configuration mistakes,
and crate::Server::start refuses them naming
ConfigField::OctoprintUrl and ConfigField::OctoprintApiKey.
§The ingress answer bound
Obico’s webhook notification plugin posts best-effort with a short timeout
and does not retry, so this server answers its ingress before the handling
completes and inside a bound it declares here. The shipped default is
DEFAULT_INGRESS_ANSWER_BOUND_MS and the timeout it must stay below is
OBICO_POSTING_TIMEOUT_MS; AGENTS.md’s “The Obico ingress answer bound”
records that number, where it was read and why the default is where it is,
and just check-repo refuses a tree in which the two disagree.
§The operator’s credential, by its verifier
Every request beneath the versioned prefix carries one credential. The
operator’s is checked against a CredentialVerifier — the SHA-256 of the
credential, written sha256:<64 lowercase hex> — which api.credential_verifier
names, so the server holds nothing a supervision turn reading its files
could authenticate with. The plaintext lives with the operator, in the
client configuration printobserver credential issue writes.
api.credential, a plaintext credential, is still read for an installation
that wrote one, and admitted until it is replaced; the composition root warns
on every start that it is there. Either way a credential is held in a type
neither rendering of which shows it, and is compared in constant time.
§The periodic observation
supervisor.observation_interval_s is how often every active print is given
a periodic observation and its agent a turn on it, whether or not the
detector has alerted. Left out it is
DEFAULT_OBSERVATION_INTERVAL_S — two minutes — and zero is refused,
because an interval of nothing is a turn started the moment the last one
returns.
§The printer watch
supervisor.printer_poll_s is how often the printer watch reads the machine
— from 5 to 300 seconds, fifteen when left out — whether or not a print is
active, and supervisor.unattended_window_s how long after a print ends
interrupted or failed the printer heating or moving on its own is
recorded — from 60 to 86400 seconds, an hour when left out. A value outside
either range is refused naming its key.
§Compaction
supervisor.idle_compact_tokens is the conversation size, in tokens, at or
above which a print’s session is compacted while no turn of it runs, and
supervisor.auto_compact_tokens the size at which the harness compacts a
session on its own during a turn, set through OneHarness’s
harness-agnostic setting of that name. Each is a whole number from 1, and
each left out does nothing.
§The harness check
supervisor.check_turn_timeout_s is how long the one turn a harness check
runs may take before the check answers that it timed out — from 1 to 900
seconds, DEFAULT_CHECK_TURN_TIMEOUT_S when left out. A value outside
that range is refused naming its key.
§The camera and Obico’s own API
Both are optional. camera.snapshot_url is where a look fetches a fresh
frame; without it a look carries the printer’s state and no frame.
obico.url and obico.access_token are given together or not at all: they
are how a print the detector paused and the agent adjusted is acknowledged
to Obico, which re-arms its detection. Each address must be an http or
https URL, and the token is held in a type whose debug form never shows
it, so no refusal or log line this program writes can carry it.
obico.ml_api_url is the failure detector’s own service, whose
unauthenticated health check is asked during every print; without it the
detector’s health check is never asked. With obico.url and
obico.access_token, Obico’s own record of the printer’s live prediction
is read once per observation interval, from the printer obico.printer_id
names — a whole number from 1 — or, left out, the one the last body Obico
posted named; that is what says the detector is scoring a print.
vision.blank_frame_max_stddev is the
grey-level spread at or below which a frame is blank — from 1 to 128, 36.5
when left out.
§Recovery
[recovery] states the printer’s own facts a recovery action is checked
against — away_from_bed (z_plus or z_minus), max_z_mm,
max_lift_mm (50 when left out), clearance_margin_mm (5 when left out),
park_xy, z_home_xy and z_home_sweeps_bed. Left out, every recovery
action is refused as not configured; written, every key without a default
is required. [policy.recovery] says who may ask for which: operator,
agent and asserting, by default every action, none, and the operator
alone. Granting recover_home_z to the agent, or letting the agent’s word
count as clearance, is refused naming the key, and so is every value
outside the range its key admits.
§The spool check
[spools] is optional, and so is every key in it: preflight is what a
start does when the loaded spool is short, unverified or the file has no
analysis — refuse, warn or off — buffer_percent and buffer_min_g
the margin asked beyond what a print needs, and analysis_wait_seconds how
long a start waits for OctoPrint’s analysis of a file that has none yet.
Each left out takes the supervision core’s own default, and a negative
figure or a mode outside the three is refused naming its key. The same mode
governs the material and sheet checks a start is held to beside it.
§The sheet table
[sheets.allowed] is optional: one key per material, each listing the
build sheets a print of that material may go down on, as the ids a start’s
manifest declares in sheet. Written, it replaces the defaults
(DEFAULT_SHEETS) whole; left out,
those defaults apply. A blank material or sheet, a material listing no
sheet, or two materials differing only in case is refused naming
sheets.allowed.
Structs§
- ApiCredential
- One credential in plaintext: a legacy
api.credential, the legacy file a server generated into its state directory, or oneprintobserver credential issuedraws for the operator’s own configuration. - ApiSection
- What a caller of the versioned API authenticates with, as written down.
- Camera
Section - Where a fresh frame of the print is fetched from, as written down.
- Config
File - The whole configuration file, exactly as it is written down.
- Credential
Verifier - What one operator credential is checked against: the SHA-256 of its UTF-8 bytes.
- Ingress
Section - What the
Obicoingress requires and how fast it answers, as written down. - Obico
Section - Where
Obico’s own API answers, as written down. - Octoprint
Section - Where the
OctoPrintinstance is and what it is like, as written down. - Policy
Section - The policies this program is configured with beside the safety envelope.
- Recovery
Policy Section - Who may ask for which recovery action, as written down under
[policy.recovery]. Each list left out takes its default: the operator every action, the agent none, and only the operator’s assertions counting. - Recovery
Section - The printer’s own facts a recovery is checked against, as written down.
- Server
Config - One running server’s validated configuration.
- Shared
Secret - The shared secret the ingress requires of every post.
- Sheets
Section - Which build sheets each material may be printed on, as written down.
- Sign
InConfig - The two values signing a harness in reads, and nothing else.
- Spools
Section - How spools are checked before a print, as written down.
- Supervisor
Section - How the supervising agent is reached, as written down.
- Vision
Section - How a camera frame is judged, as written down.
Enums§
- Config
Error - Why this server will not start under the configuration it was given.
- Config
Field - Every value this program is configured with, and the key it is spelled under.
Constants§
- ASSETS_
DIRECTORY - The directory under the state directory this server materializes the
supervising agent’s prompt template and assessment schema into. The skill
is not among them: it is installed with
SKILL_INSTALLand configured bysupervisor.skill_path. - CHECK_
TURN_ TIMEOUT_ RANGE_ S - The least and the most seconds
supervisor.check_turn_timeout_sadmits: up to a supervision turn’s own bound, which no check needs to outlast. - DEFAULT_
CHECK_ TURN_ TIMEOUT_ S - How long a harness check’s one turn may take, in seconds, when the configuration names no bound: long enough for a signed-in harness to answer one line over a slow link from a small board, and short enough that a client’s preflight waiting on it is told within two minutes.
- DEFAULT_
INGRESS_ ANSWER_ BOUND_ MS - The answer bound this repository ships, in milliseconds.
- DEFAULT_
OBSERVATION_ INTERVAL_ S - How often every active print is observed, in seconds, when the configuration names no interval: the core’s own default.
- DEFAULT_
PRINTER_ POLL_ S - How often the printer watch reads the machine, in seconds, when the configuration names no poll: the core’s own default.
- DEFAULT_
UNATTENDED_ WINDOW_ S - How long after an unfinished ending activity is recorded, in seconds, when the configuration names no window: the core’s own default.
- FAN_
VOCABULARY - The vocabulary
OctoprintSection::fantakes, spelled as the operator writes it. - GENERATED_
CREDENTIAL_ BYTES - How many random bytes a credential this server generates is drawn from.
- OBICO_
POSTING_ TIMEOUT_ MS - The timeout
Obico’s own webhook notification plugin posts under. - PRINTER_
POLL_ RANGE_ S - The least and the most seconds
supervisor.printer_poll_sadmits. - REDACTED
- What a secret renders as, wherever a value carrying one is rendered.
- SKILL_
INSTALL - How the supervising agent’s skill is installed, and what names it after.
- UNATTENDED_
WINDOW_ RANGE_ S - The least and the most seconds
supervisor.unattended_window_sadmits. - VERIFIER_
PREFIX - What a credential verifier is written with before its digest.
Functions§
- plainly_
written - A resolved path, written the way its own platform’s tools write it.