Skip to content

HERD v0.6.0

Choose a tag to compare

@vendrabuck vendrabuck released this 01 Oct 23:06
· 1264 commits to main since this release
3216868

HERD v0.6.0
Release gate: a clean make everything at the tagged commit.

[0.6.0] - 2026-10-01

  • Reservation status writes are race-safe. Every status transition is a compare-and-swap
    through one helper, so only the writer that wins the row stages the event, flips
    inventory, or calls cabling (#899). A PENDING reservation holds no device and writes no
    inventory status (#897), back-to-back bookings no longer leave a shared exclusive device
    AVAILABLE under a live booking (#898), and the dynamic-instance ledger is forward-only,
    so a row retired by teardown is never brought back by a late create (#896).
  • Security hardening. The auth service authorizes on the lower of the JWT role claim and
    the account's current database role; the compose file binds the NATS and Postgres host
    ports to loopback (#708); a device node on a canvas is reduced to a fixed allowlist at
    every write and read, so field_data is never stored or returned; execution
    corroborates each reservation lifecycle event with the reservations service before
    acting on it; every device-scoped inventory read and the topology import go through the
    device-group visibility check (#909, and the #763 follow-up); and every CSV writer
    neutralizes spreadsheet formulas (#910).
  • NATS consumers behave as configured. Retry timing comes from an explicit NAK delay
    schedule instead of a backoff list that silently shortened ack_wait (#895), all
    three consumers heartbeat a message while its handler runs so a slow webhook receiver
    is not handed the same event twice (#911, #944), and ack_wait is the setting
    NATS_ACK_WAIT_SECONDS.
  • Deleting a device is refused while wiring depends on it: as a transit hop on a live
    reservation's fork (#900, device_in_use) or while any cable still names it (#940,
    device_cabled). There is no force flag, and an unreachable upstream refuses too.
  • AI topology generation picks devices that can be wired. Resolution asks cabling which
    candidate pairs are reachable and searches for an assignment that satisfies every
    proposed edge (#828), commit checks wireability before the reservation is created
    (#827), and an opt-in evaluation harness scores how often a proposal resolves (#826).
  • The reservation assistant keeps the record of what it did. A turn whose tools already
    ran is persisted when the model returns no text, times out, or the provider fails
    (#848, #871, #903), and a streamed turn always ends in one done or error frame
    (#946).
  • Config apply is gated on the driver contract in inventory and again in execution
    (#839, #870), raw driver exception text no longer reaches a row or a response (#840),
    and the JSON log formatter emits every extra= key with key-name redaction (#872).
  • Version and build visibility (#846): every service answers GET /version, images are
    stamped with the git build identifier, make version prints it, and the admin About
    page lists all twelve services and flags version skew (#874).
  • Reservations and inventory pages: the reservations list sorts (#844, #902), a booking
    can be cancelled before it is active (#841), rows can be selected for a bulk Cancel or
    Release (#843), the inventory page filters by status, template, and topology (#842)
    and keeps an expanded row open across a refetch (#938), an admin can classify one
    reservation's purpose from its detail modal (#822), and the header help icon opens the
    published manual (#960).
  • Outbound webhooks can subscribe to device.health_transition (#831).
  • Added docs/SIMULATED_LAB_GUIDE.md, pinned the npm floor the frontend lockfile needs
    (#885), and removed the dead HEALTH_POLL_MINIMUM_INTERVAL_SECONDS setting (#880).

Delivery detail

  • Fixed the header help icon (the ? beside the notification bell) to open the
    published user manual at https://vendrabuck.github.io/HERD/manual/ (issue
    #960). It used to open a repository document. The address lives once as
    MANUAL_URL in frontend/src/lib/links.ts; the link still opens in a new tab
    with rel="noopener noreferrer".

  • Added multi-select Cancel and Release to the Reservations page (issue #843).
    Each row has a checkbox and the header has a select-all for the current page;
    a selection bar offers Cancel selected and Release selected. There is no bulk
    endpoint: the page fans out over the existing per-id cancel and release calls,
    and the backend's status compare-and-swap decides each row. Eligibility is per
    row through canCancelAs and canReleaseAs in lib/reservationStatus.ts,
    the one rule now behind the detail modal, the per-row buttons, and the bulk
    actions, matching the backend: the owner or an admin may cancel (issue #340),
    only the owner may release. An admin now sees Cancel on another user's
    reservation, and Release no longer shows on a row the caller does not own.
    One confirmation per action states how many reservations will be acted on
    and how many will be skipped and why. Succeeded rows leave the selection,
    failed rows stay selected and the toast reports "Cancelled N, failed M" with
    the server's reason when every failure shares one. The selection is dropped
    when the page, sort, or all-reservations view changes. Pure logic lives in
    lib/reservationBulk.ts; tests/e2e/test_reservations_bulk_playwright.py
    proves the effect through API read-back.

  • Added column filters to the Inventory page (issue #842). Status, Template, and
    Topology selects sit beside the name search and use the device list's existing
    status, template_id, and topology_type parameters, so there is no backend
    change. Each has an All option that sends no parameter. The Template options show
    the template name with its vendor and model, which is how vendor and model are
    filterable. Filters compose with the search and pagination (any change returns to
    page one, and the total is the filtered total), a Clear filters control resets all
    of them, and a filtered-empty result says so instead of showing the no-devices
    state. The choices persist in savedFilters.inventory as
    {search, status, template_id, topology_type} with a filter at All omitted, so an
    old {search} object still works; an unknown saved status or topology, or a
    template id that no longer exists, falls back to All and is never sent.

  • Fixed the admin device DELETE leaving stale cabling connections behind (issue
    #940, the plain-cable half split out of #900). A cabled device with no live
    reservation deleted with 204 and every Connection row that named it kept a
    dead device UUID that pathfinding still routed through. Cabling's internal
    GET /internal/forks/by-device/{device_id} now also returns
    connection_count (true total, a loopback counts once) and connection_ids
    (sorted sample, capped at 10), and assert_device_deletable refuses with
    409 {"error": "device_cabled", "connection_count", "connection_ids"} after
    the device_in_use decision, which wins when both apply. A cabling build
    without the new keys reads as the existing 503, fail closed; there is no
    force flag. The device page keeps the refusal on screen with the count and a
    link to Connections, and a bulk delete on the inventory page says remove the
    cables first. Integration fixtures now route device teardown through a strict
    helper that removes leftover cables and fails with the refusal body instead of
    leaking the device.

  • Fixed execution's consumer loop swallowing a shutdown cancel, and added a live
    exactly-once test for a slow webhook receiver (issue #944). Execution kept an
    inline copy of the heartbeat whose try: await heartbeat / except CancelledError: pass could not tell a cancel aimed at the consumer from the
    heartbeat's own, so a shutdown landing just after a batch settled left the loop
    running and stop_nats_consumer waiting forever. Execution now runs its
    batches through the shared process_batch_with_heartbeat, with a regression
    test through the real loop. NATS_ACK_WAIT_SECONDS is now a setting (default
    30, minimum 2) in execution, notifications, and integration, with the
    heartbeat derived as half of it by herd_common.jetstream.heartbeat_interval.
    The dev/test stack pins integration to 4 s, and the test webhook sink gains a
    bounded delay_ms and a per-event hit counter, so a live test holds a fan-out
    open past ack_wait and asserts that the receiver got one POST and that a second
    consumer waiting on the durable was handed no redelivery. The second consumer
    is what makes the test able to fail: JetStream hands a timed-out message only
    to a pull request that is waiting, so a lone consumer never receives its own
    redelivery and the duplicate the heartbeat prevents needs a peer replica.

  • Added a Classify now action to the reservation detail modal (issue #822),
    the UI for the on-demand purpose classification trigger from issue #808. An
    admin sees it on a COMPLETED, CANCELLED, or FAILED reservation with no
    suggestion; it calls POST /admin/purpose-review/{id}/classify and renders
    the outcome: a toast naming the suggested category on ok, a plain sentence
    for each other outcome, the disabled message on 503, and a refetch that
    removes the stale button on either 409. The gate is one predicate,
    canClassifyPurpose, beside canCancel and canRelease. The Purpose Review
    page, which lists only rows that already have a suggestion, gained a sentence
    pointing at the new button. Covered by vitest and a Playwright test that
    asserts the UI against the real backend answer and an API read-back.

  • Fixed the assistant stream losing its terminal frame when the overall
    deadline fired while a frame was being handed to a slow client (issue #946).
    The route yielded SSE frames from inside asyncio.timeout, so the
    cancellation landed in the consumer, the timeout handler never ran, and the
    stream ended with neither done nor error and no incomplete-turn save. The
    route now keeps one absolute deadline and bounds only the wait for the next
    event, yielding each frame after that scope closes, and closes the inner
    generator on every exit. A structural unit test fails on any yield inside
    asyncio.timeout, asyncio.timeout_at, or asyncio.TaskGroup under
    services/*/app.

  • Fixed integration and notifications redelivering a message whose handler was
    still running (issue #911). Only execution sent in_progress, so a webhook
    fan-out outlasting the 30 s ack_wait (several slow POSTs plus backoff) was
    redelivered and the receiver got the same event twice. The heartbeat is now
    one shared implementation, herd_common.jetstream.keep_messages_alive, with
    process_batch_with_heartbeat wrapping each fetched batch; both integration
    durables and notifications' two durables use it, and each service pins its
    NATS_HEARTBEAT_SECONDS below its ack_wait. Execution's behavior is
    unchanged. Delivery stays at-least-once: a crash during a POST can still
    redeliver (docs/EXTERNAL_API.md says so).

  • Fixed an expanded inventory row collapsing when the list changes under it
    (issue #938). Typing a search and expanding a row before the debounced
    filtered list arrived used to close the row, because every list change
    cleared the expanded set. The page now drops only the rows that left the
    list; rows still listed stay open. The bulk selection is still cleared on a
    list change. The seeded e2e pass gains a deterministic regression test, and
    the topology editor's L3 routing e2e test now moves the pointer off the toast
    stack before each Save (react-hot-toast pauses a toast while hovered).

  • Fixed the admin device DELETE guard ignoring cabling (issue #900, live-wiring
    half). A switch that was only a transit hop on a saved fork sat in no
    reservation_devices row, so it deleted with 204 and its cross-connects were
    stranded with no driver left to release them. Cabling gains the internal
    GET /internal/forks/by-device/{device_id} (reservation ids of non-archived
    forks whose hops touch the device), and inventory's single helper
    assert_device_deletable asks it beside reservations. The 409 device_in_use
    detail keeps reservation_ids (now the sorted union) and adds
    transit_reservation_ids; either upstream failing returns 503, fail closed.
    The device page names transit holders in its toast. A delete right after a
    cancel can still precede execution's asynchronous teardown. Refusing a delete
    while plain cabling connections reference the device (device_cabled) is
    deferred to its own issue.

  • Made the dynamic-instance ledger forward-only (issue #896). set_instance_ref
    and mark_active are now compare-and-swap updates that never touch a
    DESTROYED row, and provision_requested refuses a DESTROYED row
    (dynamic_instance_resurrection_refused). If teardown retires the row while
    create_instance is in flight, the instance just created is destroyed again
    and its device deleted, so nothing is orphaned.

  • The execution "Starting driver execution" log now emits context_keys (the
    sorted key names) instead of the whole redacted device context (issue #905),
    so a text-typed secret under a neutral key no longer reaches the JSON log.

  • Corrected stale comments in execution that claimed JSONFormatter drops
    unlisted extras (issue #906).

  • Made the L1 manual-retry integration tests read the row back again (issue #906):
    a reported reconnected or released outcome no longer substitutes for
    wiring-status showing the row ACTIVE or RELEASED.

  • Fixed the reservation assistant losing the record of a write (issues #903,
    #904, #906). propose_config_change now records a config_version_created
    side effect, so a later timeout or provider failure persists the turn
    instead of rolling back a config version that exists (it does not set
    pending_apply). Both transports now persist a completed turn outside the
    overall deadline, so the deadline can no longer interrupt the commit or
    append the same segments twice. The closing text of an incomplete turn now
    ignores errored tool calls when deciding which landed actions were
    recorded, and ai_assistant_incomplete_after_tools carries reason as its
    own log field.

  • Fixed sort_by=status on the reservations list ordering by the Postgres enum's
    storage order instead of alphabetically (issue #902). The ORDER BY now casts
    the status column to a string, so every dialect sorts by status name, matching
    the SQLite unit test and the UI. A new live Postgres suite,
    test_reservation_sort_live_pg.py, pins both directions and is part of
    _gate-pg-live-tests.

  • Made every reservation status transition a compare-and-swap (issue #899).
    The immediate create path wrote ACTIVE (or FAILED) with an UPDATE keyed by
    id alone after seconds of inventory calls, so a cancel committed in that
    window was overwritten, leaving a zombie ACTIVE reservation that never
    wires and has both a cancelled and a created event. Create, scheduled
    activation, cancel, release, and the sweep's auto-complete now go through
    one _claim_status_transition (a conditional UPDATE ... WHERE status IN (...); _claim_provision_transition is a thin wrapper) and stage events,
    flip inventory, and call cabling only when the rowcount is 1. A create or
    scheduled activation that loses reverts exactly the devices it flipped
    (skipping any a newer booking holds) and returns the row as the winner left
    it. No HTTP status code or error message changed. A new live Postgres suite,
    test_reservation_status_cas_live_pg.py, races create against cancel and
    auto-complete against release, and is part of _gate-pg-live-tests.

  • Fixed back-to-back bookings leaving a shared exclusive device AVAILABLE under
    an ACTIVE reservation (issue #898). In one expiration tick the successor's
    activation ran before the predecessor's release, and both are absolute
    inventory writes. The sweep now releases completed rows' devices before
    activating claimed rows, and every release (cancel, release, provision
    failure, timeout, auto-complete) skips a device another PENDING_PROVISION or
    ACTIVE reservation still holds, logging release_skipped_device_held. The
    activation claim also requires end_time > now: a PENDING row whose window
    already elapsed is moved to FAILED (reservation_window_elapsed), stages
    reservation.failed, and makes no inventory or fork call.
    A scheduled activation whose inventory flip fails reverts to PENDING and
    also releases the row's exclusive devices (holder-aware), since a same-tick
    predecessor's release had skipped them while the row held them.

  • Stopped PENDING reservations from writing inventory status (issue #897).
    Since #132 a future booking touches no inventory status until activation,
    but cancelling a PENDING booking, or PATCH-removing a device from one,
    still released every exclusive device to AVAILABLE (flipping a device that
    another ACTIVE reservation held), and PATCH-adding a free device marked it
    RESERVED for a booking that starts later. An exclusive device is now
    RESERVED in inventory if and only if a reservation in PENDING_PROVISION or
    ACTIVE holds it, so cancel_reservation and update_reservation write
    inventory status only when the row's status before the transition holds
    devices. Conflict checks and the "device must be AVAILABLE to add" refusal
    are unchanged.

  • Hardened three inventory reads that skipped the issue #718 device-group
    visibility gate (issue #909): GET /device-groups/device/{id},
    GET /devices/{id}/apply-jobs, and GET /apply-jobs/{id}. Any
    authenticated user could confirm a hidden device exists, read its
    device-group and user-group membership, and read its config-apply
    history, including driver-returned error text. All three now apply the
    same non-admin group-visibility gate as GET /devices/{id} and
    device_configs.py's config-version reads: a device outside the caller's
    groups 404s with the identical detail its own unknown-id 404 already
    used (device-groups/device/{id}'s existing id-bearing detail is reused
    rather than replaced with a second phrasing), and GET /apply-jobs/{id}
    gates on the job's own device_id, answering a hidden device's job with
    the same 404 a missing job gets. Admins stay unfiltered. The gate itself
    moved out of device_configs.py into a shared check_device_read_visibility
    helper in app/services/device_visibility.py so all three call sites,
    plus device_configs.py's own three reads, share one implementation.

  • Hardened POST /api/cabling/topologies/import against reopening the #763
    visibility oracle through a batched side door. Topology import is open to
    any authenticated user, and it used to resolve every device name through
    the unfiltered internal inventory lookup and run the full topology
    validator against the unredacted canvas regardless of caller, so a
    non-admin could confirm a hidden device's name, learn whether two hidden
    devices are physically connected, and probe a hidden Layer 3 switch's
    interface and VRF configuration through the per-row reject reason, with
    dry_run=true making it free of side effects. The import route now
    resolves the caller's device visibility once per request the same way
    POST /topologies/{id}/validate does (issue #763's shared
    resolve_caller_visibility): admins are unfiltered and never trigger the
    lookup, and an unanswerable inventory lookup fails closed with a 503 and
    writes nothing. For a non-admin, a canvas device name that resolves to a
    device outside their visibility is folded into the row's existing
    unresolved device names reason, so a hidden device and a nonexistent one
    produce an identical rejection; a device reference that carries a raw id
    with no name at all (bypassing name resolution) is redacted from the canvas
    before validation runs, so it can only ever surface as the existing
    missing_device reason and never reaches the Layer 3 pass. A non-dry-run
    row that references a hidden device is rejected and stores nothing. CSV
    import parses into the same canvas shape before this gate runs, so it is
    covered identically.

  • Hardened every CSV writer against spreadsheet formula injection (issue #910).
    A CSV cell whose text began with =, +, -, @, a tab, or a carriage
    return was written as given and evaluated as a formula, not literal text,
    when the file was opened in a spreadsheet: the most exposed writer was
    cabling's topology export, whose topology, device, and port names are
    free text any authenticated user controls (they come from the stored
    canvas, not inventory), so a regular user could plant a formula that ran
    when an admin opened the export. A new shared helper,
    herd_common.csv_safety.csv_safe_cell, prefixes a single quote onto a
    text cell whose first character (ignoring leading spaces) is one of those
    triggers, the OWASP-recommended neutralization; it is applied to every
    free-text column of the topology CSV export, the inventory device and
    template CSV exports, and the reservations utilization CSV export
    (owner_name and fleet device name), while a fixed enumeration, a
    formatted number or boolean, and a JSON-encoded blob column are left
    untouched. The topology, device, and template CSV importers apply the
    inverse, csv_safe_cell's exact opposite csv_unsafe_cell, which strips
    exactly one leading quote and only when a trigger character still follows
    it, so an exported value round-trips through import byte-for-byte and a
    name that legitimately begins with an apostrophe is never mangled. The
    Reporting page's browser-built "by template" CSV export gained the same
    neutralization via its own csvSafeCell, applied before its existing
    RFC 4180 quoting.

  • Hardened the topology editor and cabling service against persisting device
    credentials on a canvas. The editor used to store the whole inventory Device
    record on each device node, including field_data, which can carry a
    clear-text device password; cabling stored and returned whatever canvas a
    caller sent, with no narrowing on what a device node could hold. Every
    cabling write boundary (topology create/update/clone/import, every fork
    write, template create/update/instantiate, and version restore) now reduces
    a device node's data.device to a fixed allowlist (id, name, topology_type,
    connection_type, status, template_name, template_icon, plus the
    topology-template placeholder key role) before a row is written, and the
    export route strips again on read as a second layer. The frontend narrows
    the same way before a save is ever sent, though the server-side strip is
    what actually enforces it. A one-time data migration scrubbed every
    already-stored canvas.

  • Hardened execution's NATS consumer against a forged reservation lifecycle event.
    It used to treat any event on herd.reservations.* as authoritative: a message
    claiming reservation.cancelled, .completed, or .failed froze a reservation's
    wiring and tore down its ledgers and dynamic instances, a reservation.updated
    destroyed dynamic instances for whatever removed_device_ids it named, and a
    reservation.created or .wiring_changed acted on whatever it claimed, all
    without asking reservations whether any of it was true. process_reservation_message
    now corroborates each of these six events against reservations' own record of the
    row (GET /internal/{id}) before running any handler: a terminal event needs any
    terminal status, reservation.created needs PENDING_PROVISION or ACTIVE,
    reservation.updated needs any non-terminal status (it is staged outside the
    ACTIVE-only branch of the device-set PATCH), and reservation.wiring_changed
    needs ACTIVE specifically. A mismatch, or a reservation
    that does not exist, acks the message without running the handler; an unanswerable
    check (a reservations outage) NAKs for retry rather than proceeding on missing
    information. reservation.provision_requested is unaffected: it already enforces
    its own preconditions server-side.

  • Hardened docker-compose.yml: the NATS (4222, 8222) and Postgres (POSTGRES_PORT,
    default 5433) host port bindings now listen on loopback only, matching the
    Traefik dashboard's existing loopback bind (issue #708). NATS runs with no broker
    authentication, so both were reachable from the LAN or the open internet on a host
    with no firewall in front of it. Traefik's plain HTTP/HTTPS listeners are unchanged.

  • Fixed the auth service authorizing against a caller's database role instead of
    their JWT's role claim. The API-token exchange (POST /tokens/exchange) already
    clamped an issued JWT's role claim to the lesser of the token's role and the
    owning principal's current database role, but every authorization check inside
    the auth service itself (require_role, the token-minting rank checks in
    POST /tokens) read current_user.role, the database row, and ignored that
    clamp entirely. A user-role API token minted for a superadmin account therefore
    passed every admin and superadmin gate in the auth service, including minting a
    full superadmin token from it, undoing the exchange's demotion. Every service
    other than auth already authorized against the claim (herd_common.auth), so
    only the auth service itself was affected. Authorization inside the auth service
    now uses the effective role, the lower of the claim and the database role
    (app.dependencies.auth.effective_role); a missing, empty, or unrecognized role
    claim is treated as user. A login or refresh JWT still carries the account's
    role at issue time and behaves exactly as before; the only change in outcome is
    that a token whose claim is lower than the account's current database role, or an
    account demoted after a token was issued, is now held to the lower role until
    that token expires, as intended. See docs/ROLES.md for the updated rule.

  • Fixed the three NATS consumers' (execution, notifications, integration) retry timing
    (issue #895). Measured against nats-server 2.10.29, a ConsumerConfig.backoff list
    silently made the server replace the configured ack_wait with backoff[0] (1
    second instead of the intended 30), and backoff itself only ever timed
    ack-timeout redeliveries, never a NAK, so a bare msg.nak() on a transient error
    redelivered immediately: five NAKs landed within about a second and the #317
    in-progress heartbeat protected nothing. ConsumerConfig no longer carries
    backoff; a transient-error NAK now passes an explicit delay= from a new
    NATS_NAK_BACKOFF_SECONDS setting (comma-separated seconds, default
    1,5,15,60,120, shared across all three services; a short schedule is pinned in
    the dev/test compose override), via the shared herd_common.jetstream.nak_delay
    helper. Every durable is now also created OR UPDATED to match its ConsumerConfig
    at boot (herd_common.jetstream.ensure_consumer), since pull_subscribe alone
    only creates a durable that does not yet exist and otherwise binds to whatever
    config the server already has, which would have silently kept a make prod
    durable's stale backoff forever across this fix's rollout.

  • Added docs/SIMULATED_LAB_GUIDE.md, a task-oriented guide to HERD's three
    simulated-hardware tiers (the hardware-free mock drivers, the checked-in NOS lab,
    and the unbuilt external network-simulator): a table of what each can and cannot
    do and when to reach for it, a numbered NOS lab quick start covering both the
    Makefile commands and the UI steps to build a topology, add a Layer 3 route on
    the real FRR node, reserve it, watch it go ACTIVE, verify on the box, cancel, and
    detach, a mock-driver field_data knob reference, a test-tier comparison, and
    troubleshooting for the known lab traps (the [FACTORY] prompt issue, the VRF
    kernel-module dependency, the credential-export gotcha). docs/NOS_LAB.md now
    points readers who want the how-to at the new guide instead of its own build log.

  • Pinned the npm version the frontend expects (issue #885). A plain npm install in
    frontend/ on an npm older than 11.11.0 silently strips the libc array that a newer
    npm (including Dependabot's) writes into optional-platform lockfile entries, rewriting
    package-lock.json by 18 lines with no package.json change: a diff every contributor
    or agent had to notice and hand-discard before committing real work. frontend/package.json
    now declares engines.node/engines.npm, and frontend/.npmrc sets engine-strict=true
    so an incompatible npm refuses instead of silently drifting the lockfile. CI's frontend
    job installs npm 11.17.0 (matching Dependabot's npm_and_yarn updater) before npm ci,
    and a new gate step reruns npm install and fails on any package-lock.json diff,
    mirroring the backend job's uv lock --check. The frontend Docker image is unaffected:
    its build stage copies only package.json/package-lock.json before installing, so
    .npmrc is not present yet and engine-strict never applies there.

  • The reservations list can now be sorted (issue #844). GET /api/reservations/ gains
    sort_by (an explicit allowlist: start_time, end_time, status,
    purpose_category, user_id, created_at; an unlisted value 422s) and sort_dir
    query params; the default (created_at desc) reproduces the previous ordering
    exactly, and every ORDER BY now tiebreaks on id for stable pagination across
    ties. Visibility narrows the row set before the sort ever runs, so sorting by a
    field like user_id cannot surface a row outside what the caller could already see.
    The Owner, Status, Period, and Purpose column headings on the reservations table are
    now sort controls (aria-sort plus a direction chevron; a third click clears back to
    the default order), and the chosen sort persists per page alongside the existing
    page-size preference.

  • Outbound webhooks can now subscribe to device.health_transition (issue #831). The
    integration service's NATS consumer previously bound only herd.reservations.*, so a
    device health transition published by execution's health scheduler on HERD_HEALTH
    (subject herd.health.status_changed) could never reach a registered webhook, even
    though WebhookSubscription.event_types accepted any string. A second durable pull
    consumer now binds herd.health.* (its own durable name and DLQ subject
    herd.health.dlq.integration, batch size 1 per the #648 rule), started through the
    same schema-readiness gate as the reservations consumer and dispatching to the same
    handler, since both streams' payloads carry the event name under the same event
    key. device.health_transition is now accepted by the registration validator and
    documented in docs/EXTERNAL_API.md.

  • JSONFormatter now emits every extra= key on a log record instead of a fixed
    eleven-key allowlist that silently dropped the rest (issue #872). The stdlib's
    reserved LogRecord attributes are computed once at import time so anything else
    passed through extra= reaches the container log; an extra whose name collides
    with one of the formatter's own envelope keys (timestamp, level, service,
    logger, message, exception) is renamed extra_<name> instead of overwriting
    it. A key that looks credential-shaped (password, secret, token, api key,
    authorization, cookie, kek, credential, jwt, bearer, private key, ssh key, SNMP
    community) is redacted to "[redacted]", recursively through nested dicts and
    lists (depth-capped at 8), with narrow carve-outs for token-counting fields
    (input_tokens, output_tokens, token_id, token_count) so those are not swept
    up as false positives; a value that defeats json.dumps(default=str) is replaced
    with a placeholder for that key alone rather than losing the whole log line. Two
    follow-up fixes closed fail-open gaps found on review: execution's "Starting driver
    execution" log line now passes only the method-kwargs' key names, never the values
    (for a configure action the kwargs are the device config itself, which can carry
    passwords in free text no key-name pattern can catch), and redaction now recurses
    into nested structures rather than only the top level of an extra.

  • Removed the dead HEALTH_POLL_MINIMUM_INTERVAL_SECONDS setting from the execution
    service (issue #880). The variable was declared with a default and documented in
    docs/ENV_VARS.md, but it was never passed through by docker-compose.yml and
    nothing in the health scheduler read it: it never had any effect, in a container or
    otherwise. The real floor on poll_interval_seconds remains inventory's hardcoded
    MIN_POLL_INTERVAL_SECONDS. An operator who had set this variable loses nothing by
    its removal, since it never changed any behavior.

  • The admin About page now tells an unreachable service apart from one that answered
    with a malformed body (issue #874): a 200 whose body fails the ServiceVersion
    shape check (a proxy's HTML error page, a truncated JSON body) used to render as
    "reachable" and compute a version-skew "differs" badge against garbage data. It now
    gets its own "invalid response" state, with dashed version/build/build-date cells
    and no skew badge. Version comparison also now recognizes release-candidate versions
    in both the backend's PEP 440 spelling (0.6.0rc1) and the frontend's semver
    spelling (0.6.0-rc.1), comparing rc numbers for equality while still treating rc,
    dev, and final as distinct pre-release kinds. The dead ReservationPanel component
    (nothing imported it) was also removed.

  • The reservation assistant no longer discards a turn's tool writes when the turn
    fails after they already landed (issue #871): a timeout, an unreachable provider, or
    any other AIError used to roll the whole turn back once a write tool had already
    run, hiding the only record of what happened. The route now checks whether any tool
    produced a side effect before rolling back; if one did, it persists what completed
    and returns 200 with the real tool_calls, pending_apply when applicable, a fixed
    fallback answer, and a new incomplete field naming the reason (timeout,
    provider_unavailable, or ai_error). A turn with no tool run and no text still
    returns 502 and rolls back as before.

  • Execution now refuses a driver action its driver's own contract does not support,
    instead of only failing deep inside the sandbox (issue #870). POST /execute and
    POST /execute/internal reject a configure action against a connection type
    outside CONFIGURE_CONNECTION_TYPES with the same structured 409
    driver_cannot_configure shape inventory's apply endpoints already used, and reject
    ANY action against a device with no resolvable driver with a 409
    device_has_no_driver, both before any run row is created. This closes the gap left
    by inventory's own #839 gate, which the AI commit path (committer.py) bypasses by
    posting configure straight to /execute. Driver LOAD failures (a bad archive, a
    missing Driver class, an import error) are now sanitized the same way method-raise
    failures already were: the stored and returned error is the fixed string driver load failed: <ExceptionClassName>, with the full text going only to the execution
    service log.

  • Reservations can be cancelled from the UI before they are active (issue #841): the
    reservations table and the reservation detail modal gated BOTH Release and Cancel on
    status === "ACTIVE", so a PENDING or PENDING_PROVISION reservation had no Cancel
    button even though the API allows it. The gates now live once as canCancel and
    canRelease in frontend/src/lib/reservationStatus.ts and match the backend's rule
    exactly: cancel on every non-terminal status, release on ACTIVE only.

  • The reservation assistant no longer reports failure for a turn whose tools already ran
    (issue #848): when the model ends a turn with no text AFTER at least one tool was
    dispatched, the assistant returns 200 with a fixed fallback answer, the real
    tool_calls, and pending_apply when a schedule call succeeded, and persists the
    turn. It used to return 502 and roll the conversation back while the tools' writes
    stayed in inventory. A no-text turn with no tool run still returns 502 and rolls back.

  • AI_GENERATE_MAX_REPAIRS, AI_RESOLVER_CANDIDATES_PER_TEMPLATE, and
    AI_RESOLVER_MAX_SEARCH_STEPS now reach the ai-orchestrator container (issue #849).
    They were listed in .env.example and documented, but docker-compose.yml never
    passed them through, so setting them in .env did nothing. A repo-root unit test
    fails when an active AI_* key in .env.example is missing from the compose block.

  • Version and build visibility (issue #846). Every service now reports its real
    version: FastAPI(version=...) reads the package version from its own
    pyproject.toml through herd_common.version.service_version, replacing the
    hardcoded 0.1.0 that eleven services had carried since the first release, so each
    /docs page and /openapi.json is correct and a release bump needs no second edit.
    Every service answers an unauthenticated GET /version with service, version,
    build, and build_date. The integration service keeps its 1.0.0 facade
    contract version, and its /version is excluded from the published /api/v1
    OpenAPI document. The build string is git describe --tags --always --dirty
    (v0.5.0 at a release commit, otherwise vX.Y.Z-N-g<hash>, where N is the number
    of commits since the tag), computed on the host by the Makefile and passed to every
    image as a late build arg so the dependency layers stay cached; the build date is
    the HEAD commit date, not the wall clock, so an unchanged commit produces unchanged
    images. A bare docker compose build outside the Makefile reports dev. make version prints both values. The frontend shows its version on the login page and
    beside the HERD wordmark, and a new admin-only About page (/admin/about, last item
    in the Administration menu) lists the version, build, and build date of the frontend
    and of all 12 services, marks a service that does not answer as unreachable in its
    own row, and flags a row whose version or build differs from the frontend's; it
    treats the PEP 440 and semver spellings of one pre-release (0.6.0.dev0 and
    0.6.0-dev) as the same, and never flags a dev build. See docs/ENV_VARS.md for
    HERD_BUILD and HERD_BUILD_DATE.

  • Gated device-config apply on driver capability and stopped leaking raw driver
    exception text (issues #839 and #840): inventory's two apply entry points
    (POST /devices/{id}/config-versions/{vid}/apply and .../schedule) now refuse with
    a structured 409 driver_cannot_configure when the device's driver connection type
    has no configure in its contract (today, every type except Management), checked
    right after authorization and before any call to execution or job row creation; the
    apply_scheduler background loop carries the same check at fire time for jobs queued
    before this change or a driver swapped after scheduling. Config-version
    create/list/read/restore are unaffected on every connection type. New
    herd_common.device_config.CONFIGURE_CONNECTION_TYPES /
    connection_type_supports_configure, kept in parity with execution's
    REQUIRED_METHODS by a dedicated test. The AI assistant's schedule_config_apply
    tool surfaces the 409's plain-English message instead of a dict repr. Separately, a
    driver method (or its instantiation, or driver loading) that RAISES now stores and
    returns only the exception class name (e.g. "driver raised AttributeError"), never
    the message, on an execution run and an apply job's error field; the full text
    still goes to the execution service log, tagged with run_id. A driver that RETURNS
    a failure verdict ({"success": false, ...}) is unaffected and keeps its own
    message. The sandbox reads only the LAST stderr line for the runner's structured
    exception record, so a warning or a library log record ahead of it (the normal case
    when a network driver cannot reach its device) no longer defeats the sanitizing, and
    a child that fails with no structured line stores the pinned driver process exited with status N rather than its raw stderr, which is logged instead. See
    docs/DRIVERS.md for the full rule and the frr_l3/frr_mgmt pairing example.

  • AI topology generation gained cabling-aware device resolution (issue #828, PR #836):
    the resolver (services/ai-orchestrator/app/services/resolver.py) assigns concrete
    devices to proposed roles with a deterministic backtracking search over candidates
    the cabling graph can actually connect, checked through cabling's POST /pathfind/batch, replacing the previous first-N-available assignment. An infeasible
    proposal gets a corrective re-prompt naming the unconnectable template pairs before
    failing with a structured 422 topology_unconnectable. A stricter per-port capacity
    bound was tried and removed before merge: it refused topologies HERD's own validator
    accepts. New settings AI_RESOLVER_CANDIDATES_PER_TEMPLATE (default 8) and
    AI_RESOLVER_MAX_SEARCH_STEPS (default 5000).

  • Commit-time wireability fail-fast for AI-generated topologies (issue #827, PR #835):
    the committer calls cabling's POST /topologies/{id}/validate against the just-saved
    canvas, before the reservation is created, raising a structured 422
    topology_unwireable (or a 503 when cabling cannot answer) instead of only
    surfacing the problem later through reservations' generic connectivity check.
    Generation also now rejects a self-loop edge and a duplicate device-to-device edge
    as repairable mistakes. The repair cap is now the setting AI_GENERATE_MAX_REPAIRS
    (default 2), replacing a hardcoded single retry.

  • Added an opt-in evaluation harness for AI topology generation (issue #826, PR #833):
    tests/ai_eval/ scores the generator's end-to-end wireability pass rate against a
    running, seeded stack with an AI provider configured. Skips unless
    HERD_AI_EVAL=1; never runs in a gate or CI. Run with make ai-eval.