{#- Reason overflow (ADR-0024): a node's reasons clamped to a *line budget*. The block shows at most ``cap`` lines (settings.yaml ``reason_cap``: short reasons ⇒ that many reasons, a wrapped reason uses more of the budget); the overflow stays in the DOM, clipped by CSS (never cut mid-HTML, ADR-0018) and faded. A header chevron (reasons.js) reveals it in place and survives the ~10s fragment swap — ▼ when clipped, ▲ when open. The leaf detail page (check.html) stays full; the JSON envelope is untouched. -#} {#- Each line also carries the ``reason.actions`` slot (ADR-0034) — the place a dependent package hangs a local interaction off *this* reason, e.g. "raise a ticket for it". The slot is offered on every reason of every node and the filler decides where it applies; core passes the **unshortened** reason, since the 400-character clamp is a display budget and an action wants the whole text. Rendered server-side like the rest, so it survives the ~10s fragment swap. -#} {#- Reasons are keyed entries (ADR-0036), so a line can be pinned on its own. A quiet line is **shown**, in the maintenance tint (ADR-0032 rule 5) — hiding it would be the suppression covering its own tracks — and the node states how many are quiet, because the clamp above can put the pinned line below the fold and the count is then the only thing that always shows. -#} {#- What is being silenced (ADR-0032 rule 5: a transformed contribution is visible and attributable). A card that says only "maintenance" hides the transform — *we are silencing an error* is the thing worth knowing, and before the keystone it was not merely hidden but destroyed. Shown wherever a node's own status has been derived away from a countable reading, by a node pin or by every member being pinned; a check that reported ``MAINTENANCE`` itself has nothing to add. And only where the node **shows** *maintenance*: one whose lines are all silenced shows what the nodes beneath it roll up to, and has no *maintenance* for the reading to stand under (ADR-0124) — its silenced lines and their count say it there. ``word`` includes the status word for surfaces that do not already print it. **A damping counter is the same kind of fact and takes the same slot**: the node shows what it read and its parent is still counting the quieter value, so the card says how many readings are in and how many the deployment asked for. A red leaf under a green parent is what a broken roll-up looks like, and this is the sentence that tells the two apart. Same ink as the maintenance suffix — the transform is one idea and it should not look like two. -#} {% macro reported_suffix(node, word=False) -%} {%- if node.code.name == 'MAINTENANCE' and node.own_code.name == 'MAINTENANCE' and node.reported_code.name not in ('MAINTENANCE', 'UNDEFINED') %} {% if word %}maintenance {% endif %}· {{ node.reported_code.name.lower() }}{% endif -%} {%- if node.damping %} · {{ node.damping.seen }} of {{ node.damping.needed }} to escalate{% endif -%} {%- endmacro %} {#- Why the node is blue: the pin's block (ADR-0104 decisions 1 and 2), as the node's own page states it — who silenced it, until when and what is left, its note in full, and for an admin *Edit* and *Clear*. It stands **above** the reason block and outside the ``reason_cap`` clamp, so the reason for the color can never be the thing that gets clipped — the placement rule the quiet count already follows — and it paints its own maintenance tint, like every other maintenance surface, so it does not depend on the card fill under it. A card's head names the node, so the sentence opens with what was done to it (`bare`). ``pinning`` is what every pin on the page shares: whether the reader may write one, the address a write comes back to, and the count that gives each editor ids of its own — a wall carries an editor for each card, and a label finds its field by id. -#} {% macro pin_stated(node, pinning) -%} {%- if node.maintenance_entry -%} {%- set pinning.count = pinning.count + 1 -%} {{ pin_block(node.maintenance_entry, 'node', node.path, '', 'pin-' ~ pinning.count, pinning.may, next=pinning.back, of=node.path, bare=true) }} {%- endif -%} {%- endmacro %} {#- The **viewed** node's own state, above its children. A subtree page is a dashboard *of the children*, which left the one node you actually navigated to as the only one on the page that never said anything about itself. `depth=0` already drew the viewed node as a card; this is the same thing at every other depth, which also ends the page disagreeing with itself as the depth control moves. **The node's pin stands here** (ADR-0104 decisions 2 and 3): its block, above the children it covers, and for an admin the one control that sets it — *Set maintenance*, which opens its editor where the block will stand. The form posts the page's own `branch`, as a leaf's page does. The card at the foot of the page said the pin a second time, in different words and to an admin only; it went when the head took this over. **So does a pin above it** (ADR-0104 decision 2): a pin on a node above this one silences it with everything else beneath that node, and the head states each such pin as its block, outermost first, without buttons — it is edited where it stands — and the node's own pin, under one, is *also silenced on its own*. Silent when the node has nothing of its own to add, no pin above it **and the reader cannot pin**: a container with no reading, no reasons and no pin is exactly the page that should open with its children. An admin gets the head on every branch's page, because the control needs its place. The caller decides (`head_drawn`, where the page is drawn), since what the head shows is also what the cards beneath it suppress. Rendered as a `status-node` so it takes the same fill and ink as any box, and kept **inside `#status-grid`** so it refreshes on the ~10s poll — which waits while an editor in it is open (decision 7). **It says what the node rolls up to** (ADR-0123 decision 1): the status its card says on the page above and its one card says at depth 0, so a node is one status wherever it is read. Saying the node's **own** status here, on the ground that the children right below say theirs, headed a page green over a child in error while the page above drew the same node red. **Whose the status is, the fill says**, as a card's does (decision 2): pale where it comes from beneath the node — `derived`, the snapshot's one answer to that — because the node that makes it so is right below, and vivid where the node counts it for itself: a failure of its own, or its own reading gone stale. A node that declares nothing is the plain case of the first. Its `UNDEFINED` is a container's, which the roll-up skips (ADR-0039), so whatever it shows comes from beneath it, and that is also the code a kept reading records for it (ADR-0087 decision 8); a roll-up of nothing is `UNDEFINED`, the node's own again, and vivid. What the node says of itself is its lines, and the period of its own status, on the Time card beneath the children. **Its lines are listed as a leaf's page lists them** (`own_lines`, ADR-0036 decision 12): in full rather than clamped to `reason_cap` — this is the node's own page, where a reader comes when its card is not enough — each with its record, and for an admin with the pin control at its end, so a line of a node above others is silenced where it is read, without the node's pin that silences everything beneath it. -#} {% macro viewed_head(node, reason_cap, pinning, branch) -%}
{{ status_cue(node.code) }}{{ node.name }} {%- if node.stale %} stale{% if not node.children %} · {{ node.age_seconds | elapsed }} ago{% endif %}{% endif %} {#- The head is the topmost visible node of this view, so the observation time shows here and the cards below suppress an identical one (ADR-0044): seven aspect cards repeating one check's run time invite a reader to think the seven were checked separately. -#} {{ card_time(node) }}{{ node.code.name.lower() }}{{ reported_suffix(node) }} {%- set above = pins_above | length %} {{ pins_above_stated(pins_above, 'head-above-maintenance-') }} {%- if node.maintenance_entry %} {{ pin_block(node.maintenance_entry, 'node', branch, '', 'head-maintenance', pinning.may, next=pinning.back, also=above > 0) }} {%- elif pinning.may %} {#- What the pin would cover, as its editor's first sentence says it: the node whose page this is, and with it every node beneath — which a pin above it silences already, until that one ends. -#} {%- set covers %} {%- if above -%} It keeps everything beneath it silenced when the {{ 'pin' if above == 1 else 'pins' }} above it {{ 'ends' if above == 1 else 'end' }}: nothing under here will alarm before this pin expires. Its checks keep running, their colors stay visible here, and they count again when every pin on them has cleared. {%- else -%} It silences everything beneath it: nothing under here will alarm before the pin expires. Its checks keep running, their colors stay visible here, and they count again when the pin clears. {%- endif -%} {%- endset %}
{{ rule_mark('maintenance') }}Set maintenance {{ pin_new('node', covers, branch, '', 'head-maintenance', next=pinning.back) }}
{%- endif %} {{ own_lines(node, branch, pinning.may, focus, focus_orphan, beneath=node.path in containers, back=pinning.back, surface='grid', prefix='head-line-maintenance-', muted=false, covered=above) }}
{%- endmacro %} {#- A coded line (ADR-0042) carries the entry's **own** claim: its state class, a small labeled cue (a line has no status word, so the cue is its accessible name), and its state's own tint — every coded line paints one, because a mixed list sits on a *vivid* card fill, where a surfaceless passed line would read as more of the problem (the is-quiet lesson: ink-on-whatever fails the bar). A quiet (pinned) line keeps the maintenance tint whatever its code says: suppression is the louder fact. `is-running` marks work in flight — italic, display only; the line's words still say it, so no meaning rides on the italic alone. -#} {% macro reason_block(node, cap) -%} {%- if node.reasons -%} {%- set total = node.reasons | length -%}
{%- for line in node.reasons %}
{{ slot('reason.actions', node=node, reason=line.text, line=line, index=loop.index0, surface='grid') }}{% if line.code %}{{ status_cue(line.code, labeled=true) }}{% endif %}{{ line.text | shorten(400) | markdown }}
{%- endfor %}
{#- Under a **node** pin everything here is silenced already, so this count is not the reason the card is blue — the pin's block is. It says what will still be quiet once the node pin is cleared. -#} {%- if node.quiet_reasons %}
{{ node.quiet_reasons }} of {{ total }} {% if node.maintenance %}also pinned individually{% else %}in maintenance{% endif %}
{% endif -%} {%- endif -%} {%- endmacro %} {#- The shape cue lives in its own partial (_status_cue.html) so the leaf detail page can import it without executing this template's body; the rationale and the labeling rule are documented there. -#} {% from '_status_cue.html' import status_cue %} {% from '_next_update.html' import next_update %} {#- A pin's block and its editor are the rule's own (ADR-0104), imported with the context for the deployment's default window and its timezone that an editor's fields print — so the refresh's fragment is handed both, as the page is. -#} {% from '_rule_block.html' import pin_block, pin_new, pins_above_stated, rule_mark with context %} {#- A node's own lines as its own page lists them — a leaf's and, here, a branch's head and its depth-0 card: in full, each with its record and for an admin the pin control at its end (ADR-0036 decision 12). -#} {% from '_own_lines.html' import own_lines with context %} {#- Maintenance pip: a click-to-open marker on a card whose subtree holds a pinned node but which is not itself pinned — a glance at any depth shows where to drill, and a click opens a popover (maintenance.js) listing that card's pins as links. A real