Repository navigation
Releases
HERD v0.7.0
HERD v0.7.0
Release gate: a clean make everything at the tagged commit.
[0.7.0] - 2026-11-08
- A hardening release. The 177 entries under Delivery detail are 115 fixes, 31 test
changes, 18 documentation changes, 4 behavior changes, 4 additions, 1 security change, 3
list-page features, and the upgrade note for the Traefik change. - Token settings are checked when a service starts. Every service that checks access
tokens validatesAUTH_SECRET_KEYandAUTH_ALGORITHMas its settings load, so a blank
or placeholder key, or one that cannot serve as an HMAC secret, stops the service with a
message naming the variable instead of signing tokens with it. Tokens are signed and
verified with PyJWT instead of python-jose, through one helper,
herd_common.jwt_codec.decode_access_token, which passes exactly one algorithm and a 10
second leeway (#1186). Non-admin template reads now mask password-field defaults the way
device reads mask password values. The settings check and the template masking are the
fixes for the two security advisories addressed by this release. - Untrusted input is bounded earlier. A driver package's files no longer run in the
sandbox child before its resource limits apply: the child starts in Python's isolated
mode and puts the package on its path only after the limits are set (#1180). An uploaded
tar whose pax extended header or GNU long name is over 1 MiB is refused at the header
block, before any of the record is read; the earlier per-read bound did not hold on
Python 3.13.18, which reads such a record in 1 MiB chunks (#1279). The e2e Selenium
container publishes its WebDriver and noVNC ports on 127.0.0.1 only (#964). The buffered
reservation assistant route answers 502 without the exception's text when a turn fails
with an exception class it does not name, where it used to answer a plain 500 (#1280). - A stack shares its host more safely.
HERD_GATEWAY_BINDpublishes the gateway on one
host address (#1256). Each stack's Traefik now discovers only its own compose project's
containers, andmake up,make dev, andmake prodrefuse to start while another
compose project publishes port 80 or 443; recreate Traefik after pulling, as the upgrade
note below says.make certswrites a self-signed gateway certificate valid for ten
years, so a fresh clone is no longer served Traefik's built-in certificate, and the TLS
store names that pair as its default (#1239). Auth boots on a stack upgraded in place
beforemake migratewhen the new release adds a column tousers(#1261).make everythingruns the ci.yml checks it used to skip, among themuv lock --check, the
frontend suite underTZ=America/Los_Angeles, and thepackage-lock.jsonsync check. - Accounts have profiles, and the list pages have a filter panel. Every account has a
required display name and an optional contact email and phone number, which the account
edits on Settings and an admin edits from Admin > Users (#1252). List pages share a left
filter panel (#957). The Topologies page gains search, an Owner filter, sortable
columns, and multi-select delete (#958), and the Reservations page can be searched and
filtered by Status, Category, and Period, with the choices saved per user (#959). - Webhook subscriptions can be paused, and several interface defects are fixed. An admin
can pause and resume a webhook subscription withPATCH /api/v1/webhooks/{id}, keeping
its delivery ledger; a paused subscription receives no event and nothing is replayed on
resume (#1078). Modal dialogs open centred again; Tailwind 4's base styles had pinned
them to the top-left corner in every release through 0.6.0 (#979). Toasts appear at the
bottom centre, where they no longer cover the topology editor's Save button (#942), and
the Settings page scrolls again (#1260). - Reservation edits follow the rules create follows (#994 to #1000). A device edit commits
under a status guard, so a PATCH that races a cancel, release, auto-complete, or
activation keeps nothing and answers 409, and inventory is written only for anACTIVE
reservation (#994). An edit can no longer stretch a reservation past
RESERVATION_MAX_DURATION_SECONDS(#995), and a device added to aPENDINGreservation
is judged by the window conflict check (#999). Both provisioning backstops time from a
newprovision_started_atstamp, so a purpose edit no longer restarts the timeout
(#997). The calendar answers 503 to a non-admin when device visibility cannot be
verified, instead of showing every user's reservations (#1000). - Wiring and dynamic instances recover from failures that used to strand them. VLAN
numbers are unique across everything reachable through the current cabling, transit
switches included, so a cable change no longer lets two reservations share a number in
one fabric (#1003). The background wiring retry no longer stalls on a ledger whose
oldestFAILEDrows it will never drive (#1190), and one reservation's failed upstream
read no longer stops the retry for every other reservation in that layer (#1204).
Execution no longer reads a 401 or 403 from inventory as a missing device or template,
so during anINTERNAL_API_TOKENrotation a live switch's wiring rows are retried
instead of pinnedFAILED(#1203), and a reservation lifecycle event refused the same
way is retried instead of dropped (#1215). Ending a reservation runs a keyed destroy for
a dynamic instance whose create never reported a handle, and the #896 compensation path
uses it too; existing Hypervisor recipes must acceptinstance_ref=None(#937). A
ledger write that loses the FAILED-to-ACTIVE compare-and-swap returns the winner's row
instead of raisingMissingGreenlet(#1152). - Tests prove what they claim. A test-effectiveness sweep read every test file in the
repository, verified 75 high-severity findings by mutation, and landed the fixes (#1134
to #1148, #1158); it also found the ledger defect above (#1152). Three Playwright tests
order their read-backs by the HTTP response of the action they wait on instead of a
toast an earlier action left on screen (#1169). The assistant integration tests that
judge the local model's own tool choices carry anai_modelmarker and run in a
separate invocation after every deterministic integration test, so one model miss no
longer leaves the rest of the suite unrun (#1270). The NOS lab's SR Linux healthcheck
waits for an SSH banner (#1263), and the FRR image builds again with its openssh pin
moved to the version Alpine 3.16 still carries (#1268).
Delivery detail
- Fixed: an uploaded tar with an oversized pax extended header or GNU long name is refused again on Python 3.13.18 (#1279). The bound from #1179, #1180, and #1192 was a per-read limit,
herd_common.bounded_tar.BoundedTarStreamrefusing any single read overMAX_TAR_READ_BYTES(1 MiB), which worked because tarfile on 3.12 reads such a header's whole record in one call. Python 3.13.18 reads it in 1 MiB chunks (tarfile's_safe_read, gh-151497), every chunk passed the bound, and a driver package or AI generate tgz declaring an 8 MiB record was read into memory in full instead of being refused, and in the GNU long-name case extraction started. The bound is now a header check:BoundedTarInforefuses an extended header (paxxandg, SolarisX, GNULandK) whose record, rounded up to its 512-byte block, is overMAX_TAR_READ_BYTES, at the header block and before any of the record is read, whatever size of reads tarfile makes. Every uploaded tar is opened through one helper,open_bounded_tar, which passes that class (ai-orchestrator's_BoundedTarInfonow extends it) and keeps the per-read bound as the second line; the refusals are unchanged: execution'sPackageLimitError, inventory's 422, and ai-orchestrator's 400, each with the same detail. HERD's images and CI run 3.12, which was not affected; the five tests per service that failed on 3.13.18 pass on both. - Added:
make certsgenerates the gateway's TLS certificate, so a fresh clone is no longer served Traefik's built-inTRAEFIK DEFAULT CERT(#1239). The repository never trackedinfra/traefik/certs/server.key, so the tracked chain could not load anywhere but a host that had supplied its own key, anddynamic.ymlset no default certificate, so a client connecting by IP address (no SNI) got Traefik's own even there.make certs(scripts/make_certs.sh) writesserver.keyand a self-signedserver-chain.crtvalid for ten years, naminglocalhost,127.0.0.1, theHERD_GATEWAY_BINDaddress, and anyCERT_SANSentries, only when the key is absent: with both files present it changes nothing, with the key present and the certificate missing it issues a certificate for that key, andCERT_FORCE=1regenerates both.make up,dev,prod, and the gate's stack start run it first, and CI's integration job and nightly, which start their stacks with a baredocker compose up, run it as a step before that;dynamic.ymlnames the pair as the default certificate too, so a pair that does not load now means no TLS handshake at all rather than the built-in certificate. The tracked root, intermediate, and leaf certificates are removed (no consumer; their key was never public), andinfra/traefik/certs/README.mdkeeps the directory. Trusting the certificate stays a manual step (FRESH_SETUP.md step 3).tests/unit/test_make_certs_wiring.pypins it through realmakein scratch checkouts; spec rule OPS-GUARD-5. - Fixed: the buffered reservation assistant route (
POST /reservations/{id}/assistant) no longer answers FastAPI's plain 500 when the turn fails with an exception class it does not name (#1280). It now does what the streaming route already did: before any write tool landed, the turn is rolled back, its spent tokens are metered, and the route answers 502Assistant call failed; after a ...
HERD v0.6.0
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, sofield_datais 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 abackofflist that silently shortenedack_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), andack_waitis 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 onedoneorerrorframe
(#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 everyextra=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 versionprints 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 deadHEALTH_POLL_MINIMUM_INTERVAL_SECONDSsetting (#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_URLinfrontend/src/lib/links.ts; the link still opens in a new tab
withrel="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 throughcanCancelAsandcanReleaseAsinlib/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, andtopology_typeparameters, 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 insavedFilters.inventoryas
{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 everyConnectionrow 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) andconnection_ids
(sorted sample, capped at 10), andassert_device_deletablerefuses with
409 {"error": "device_cabled", "connection_count", "connection_ids"}after
thedevice_in_usedecision, 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 whosetry: await heartbeat / except CancelledError: passcould 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 andstop_nats_consumerwaiting forever. Execution now runs its
batches through the sharedprocess_batch_with_heartbeat, with a regression
test through the real loop.NATS_ACK_WAIT_SECONDSis now a setting (default
30, minimum 2) in execution, notifications, and integration, with the
heartbeat derived as half of it byherd_common.jetstream.heartbeat_interval.
The dev/test stack pins integration to 4 s, and the test webhook sink gains a
boundeddelay_msand 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 callsPOST /admin/purpose-review/{id}/classifyand renders
the outcome: a toast naming the suggested category onok, 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, besidecanCancelandcanRelease. 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 insideasyncio.timeout, so the
cancellation landed in the consumer, the timeout handler never ran, and the
stream ended with neitherdonenorerrorand no incomplete-turn save. The
route now k...
HERD v0.5.0
HERD v0.5.0
Release gate: a clean make everything at the tagged commit.
[0.5.0] - 2026-09-15
- Shipped first-class Layer 3 routing intent end to end (ADR 0014, issue #34, phases 1
to 4): routes declared on a Layer 3 switch node in the topology editor, validated at
save against the switch's config with fourteen refusal reasons, resolved into
fork_l3_routeson activation and save, and driven by the execution service in
precedence over config-version routes. The three follow-ups closed too: virtual
routers reach the driver contract behind asupports_vrfcapability (#755), attachment
is checked at the interface, not just the switch (#756), and a non-admin's canvas is
redacted to their visible devices before validation and pathfinding (#763). - Shipped the emulated-gear test tier (ADR 0010, phases 0 to 3b): a checked-in NOS lab
(FRRouting and Nokia SR Linux, images pinned by digest), the first two real driver
packages,frr_l3(Layer 3 Switch) andsrl_l2(Layer 2 Switch), a binding driver
contract that a device rejection is a failure, and two CI tiers (issue #785): the
dialect suites on every PR and insidemake everything, the via-stack feature suites
nightly. - The reservation assistant can consult documentation (ADR 0015, issue #31):
search_docs
andread_docover the built-in manual, operator corpora, and allowlisted https
sources, advertised only when a source is enabled and refused at the dispatch boundary
otherwise. - Wiring retry hardening: retry failure writes are by row identity (#814), the two retry
channels claim a row before driving it so a driver is never called twice for one row
(#817, a seventh retry outcomein_progress), and the nightly uploads per-test e2e
artifacts on failure (#813). - Seeding moved into the
seedtoolspackage with a subcommand CLI (full,acl,frr,
nos; issue #791), replacing the root script and both shell wrappers. - Purpose classification gains an admin per-reservation trigger,
POST /admin/purpose-review/{id}/classify(#808), the operator's retry for one row
without a global backfill. - Consolidations and fixes from the 2026-09-12 review of the driver batch (#778 to #784),
GET /connectionson the shared visibility helper (#809), and the frontend test runner
on vitest 5 with a temporary jest-dom type shim (#806).
Delivery detail
Layer 3 routing intent
- Layer 3 routing intent is now checked at the INTERFACE, not just the switch
(issue #756, ADR 0014 addenda X-J and X-K). ALayer 3 Switchconfig's
interfacesentries take two optional fields,kind(physical, the
default, orlogical) andport(the HERD inventory port name a physical
interface maps to, defaulting to the interface's own name). A route out of a
physical interface whose port carries no resolved hop is refused with a new
reason,l3_interface_unwired, at the fork save gate, at topology and
reservation-create validation, and again at execution's drive-time
re-validation, all through the one sharedherd_common.l3_validation. A
logicalinterface (a loopback, an SVI, a dummy interface enslaved to a
virtual router) is exempt and the switch-levell3_switch_unattachedcheck
is unchanged. Existing configs are read the strict way, every interface
physical with its port equal to its name, so a switch whose OS interface
names differ from its HERD port names needsportdeclared. - Virtual routers now reach the Layer 3 driver contract (issue #755, ADR 0014
addenda X-G, X-H, X-I).configure_routeandremove_routetake a
virtual_routerkeyword, and a driver opts in by declaringsupports_vrfin
itsdriver_metadata.json; execution passes the keyword only to a declaring
driver, because every Layer 3 signature ends in**_and a non-declaring one
would swallow it in silence and install the route in the default table.
A switch whose driver does not declare it still has its VRF routes refused
withl3_vrf_unsupportedand no driver call. A route's virtual router is now
validated against the switch's config (l3_unknown_virtual_router,
l3_interface_outside_virtual_router,l3_interface_bound_to_virtual_router),
by one sharedherd_common.l3_validationthe cabling save gate and execution's
drive-time re-validation both import instead of the two hand-synced copies they
carried.drivers/frr_l3renders the VRF form and now reports a route FRR
accepted but never installed as a failure;drivers/mock_l3records the VRF;
and the checked-in FRR lab node boots with a real VRF fixture so the live
suites can prove the success case, not just the refusal. - Shipped phase 1 of first-class Layer 3 routing intent (ADR 0014, issue #34):
cabling migration 0011 addsfork_l3_routes, a canvas parser reads
data.l3.routeson Layer 3 Switch device nodes, both fork write paths (fork
save and fork-on-activation) reconcile the resolved route set under the
existing fork row lock, and/topologies/{id}/validateand/validate/internal
gain aninvalid_routespass with ten refusal reasons (malformed shape, not a
router, unconfigured, unattached, duplicate route, and five per-route IP/interface
checks), fail-closed with a 503l3_config_unavailableon an inventory outage.
Reservations' create-time gate folds route problems into its existing
unreachable-topology error, and the fork's resolved routes ride the internal
and user-facing fork GET. Inventory gained an internal batch device-type
lookup (POST /internal/devices/batch) to serve the validation pass.
Editor and execution-side consumption are phases 2 and 3, shipped below. - Shipped phase 2 of first-class Layer 3 routing intent (ADR 0014, issue #34):
the topology editor's canvas contract gainsdata.l3on a device node
(L3RouteIntent[], persisted through fork commit, autosave, and restore
preview like any other node data), a new Routing panel that appears when a
single Layer 3 Switch device node is selected (add/edit/remove routes,
import the switch's latest device-config routes with a confirm-to-replace
when rows already exist), a route-count badge on the canvas node that turns
red on a validation problem, and the editor's first call to
POST /topologies/{id}/validate, fired after a plain topology save when the
canvas carries any routing intent. Fork-save (409l3_intent_invalid/422
l3_intent_malformed/503l3_config_unavailable) and reservation-create
(422topology_routing_intent_invalid) refusals render the same per-node
badge and per-row reasons. The fork version diff reports a route-set change
on an otherwise-unchanged device node ("Routing changed on : +A
routes, -B routes"), comparing destinations in the server's canonical form
so a canonicalization-only difference is never reported as a change nobody
made. Execution-side consumption (phase 3) shipped below. - Shipped phase 3 of first-class Layer 3 routing intent (ADR 0014, issue #34):
execution now consumes a fork's resolved routing intent instead of always
reading a switch's latest config version. Precedence is per switch: intent,
when the fork carries it, IS the route list; otherwise the pre-phase-3
config-version fallback is unchanged. A switch that stays adjacent across a
fork save now reconciles its route-set DELTA against changed intent (removes
before adds, one login/logout, the pin advancing only on full success), the
one deliberate exception to the "pinned, never re-derived" rule; an
inter-switch trunk hop that the adjacency derivation would otherwise skip
still counts when either end carries intent. Before any intent-driven route
drives, it is re-validated against the switch's CURRENT config when its
validation stamp is missing or stale, and any route naming avirtual_router
refuses the whole switch until the driver contract gains VRF support (issue
#755): either way the switch lands a FAILED pin with the refusal reason and
no driver call, never a partial drive. The retry channel drives a
still-adjacent switch's CURRENT intent, not a stale FAILED row's own routes,
when intent is present. The four-field route identity packing moved to
herd_common.l3_route_identity.route_identity_key(issue #757, closed),
shared byte-identical between cabling'sfork_l3_routes.route_keyand
execution's fork-route-to-pin comparisons.tests/load/locustfile.pygained
aRoutedTopologyValidatoruser class exercising the L3 validate pass under
load. No schema change on the execution side. - Fixed issue #758:
fork_l3_routes.route_keywasString(400), which legal
routing intent could overflow (a 64-character non-ASCIIvirtual_routerand
the defaultjson.dumpsescaping inflated past 400 characters), 500ing a
fork save and, on activation, stranding the reservation with no fork at any
layer.route_keynow packs withensure_ascii=Falseand the column widens
toText(cabling migration 0012). - Fixed issue #759: the reservations-to-cabling fork SAVE forward used the
default 10s timeout while cabling's L3 save gate may run up to its own 12s
deadline, so a save could time out on the reservations side and 503 the user
while cabling went on to commit it. The save forward now uses a 20s budget,
matching the headroom already given to the validate forward. - Docs and manual for phase 4 of first-class Layer 3 routing (ADR 0014, issue
#34): with all three delivery phases merged,PLANNED_FEATURES.md's entry
flips fromPartialtoShippedwith a phase-by-phase summary and PR
numbers, andFEATURES.mdgains a Topology-section bullet describing the
Routing panel (route table, Import from device config, the route-count
badge) plus a corrected one-sentence precedence statement (fork routing
intent, else the switch's latest config version) on the existing Layer 3
provisioning bullet.docs/ARCHITECTURE.mdhad one stale "not yet...
HERD v0.4.0
Release gate: a clean make everything at the tagged commit.
[0.4.0] - 2026-09-05
- Shipped lab purpose classification end to end (ADR 0013, issue #646, phases 1
to 3): a closed taxonomy per reservation, an AI-suggested category the owner
or an admin confirms on the new Administration > Purpose Review page, a
background reconciler that classifies reservations as they end, and device-
and user-level purpose reporting that counts transit gear on a reservation's
paths, with CSV downloads for every purpose section. - Ran a full multi-pass code review of the codebase (the 2026-09-04 review
sweep) and closed all 21 resulting issues (#701 to #721). The headline fixes:
fork saves and activation snapshots now refuse a canvas endpoint device
outside the reservation's membership (cross-tenant provisioning was reachable
before), port claims across forks are serialized with transaction-scoped
advisory locks at both fork write paths, scheduled config-apply jobs re-check
the creator's authority at fire time, and three read surfaces are gated (group
member emails are admin-only, device config-version reads follow device
visibility, the connections list is filtered to the caller's visible devices). - Made the transactional outbox wake on write (issue #682) through Postgres
NOTIFY/LISTEN, so a staged event publishes within milliseconds instead of
waiting for the relay tick; hardened the listener for reconnects, TLS and
pooler DSNs, and saturated batches (#707). NATS pull consumers now fetch one
message per pull, which fixed the first-run notification flake at its source
(#648). - Moved the purpose-classification reconciler onto its own background task with
a transient outcome class, so a slow orchestrator no longer delays the
expiration sweep and a rate limit no longer burns a row's attempts (#702,
#706). - Added AI-proposed network elements (#632): the topology generator can place
the four element types and the commit path keeps them. - Closed the fork restore-versus-save race with a row lock (#626), indexed the
ACTIVE fork listing and preloaded the wiring ledger (#710), and stopped device
lists from truncating at 500 rows (#703). - Hardening batch from the sweep: Traefik's dashboard bound to loopback,
superadmin deactivation refused, user-profile preference validation, bounded
upload buffering that rejects an over-cap request before it is fully read,
provider error text kept out of responses, and a fail-closed AI commit path
for network elements.
Delivery detail
Purpose classification and reporting
- Reliability fix: the purpose-classification reconciler now runs on its own
background task instead of riding the reservations expiration sweep (issue
#702, 2026-09-04 review sweep finding). The reconciler awaits one
orchestrator LLM call per eligible row, serially, up to
purpose_classify_batch_sizerows (default 20) each bounded by
purpose_classify_timeout_seconds(default 30s); a single tick could
therefore run for minutes, delaying every other reconciler that shared the
loop (scheduled activation, auto-completion, both provisioning-timeout
backstops, fork archiving, wiring heal, and pending prune) behind a slow or
hung orchestrator.services/reservations/app/main.pynow starts a second
task,purpose_classify_loop, at its own interval
(PURPOSE_CLASSIFY_INTERVAL_SECONDS, default 60s), cancelled alongside the
expiration task at shutdown; the reconciler's body stays sequential (no
concurrent LLM calls).expiration_loopno longer calls the reconciler. - Bug fix: the purpose-classification reconciler gains a
transientoutcome
class and stops misreading an internal-token failure as the feature being
off (issue #706, 2026-09-04 review sweep finding). Previously every
non-403/404 failure, a 429 rate limit, a 502/503/504, a timeout, or a
transport error, incremented a row'spurpose_classify_attemptsexactly
like a genuine per-row rejection; a quota 429 lasts until UTC midnight
(hundreds of sweep ticks), so a rate-limited owner's rows deterministically
capped out, invisible in aggregate metrics. A newtransientoutcome for
those cases ends the tick without touching any row's attempts, the same
treatmentfeature_offalready had. Separately,POST /internal/classify-purposecan 403 for two unrelated reasons
(AI_PURPOSE_CLASSIFICATION_ENABLEDoff, or an internal-token mismatch),
and the reconciler read either as "the feature is off", silently stalling
the backlog after a token rotation while logging the wrong cause. The
orchestrator's flag-off refusal now carries a structured detail,
{"error": "purpose_classification_disabled", "message": "Purpose classification is disabled"}; the reconciler treats a 403 as feature-off
only when that marker is present (falling back to the exact legacy
plain-string detail for a pre-fix orchestrator image during a rolling
upgrade), and logs any other 403 at WARNING as a likely internal-token
problem instead. See the ADR 0013 amendment for the full outcome taxonomy. - Added Download CSV buttons for the four purpose reporting sections (issue
#696):purpose,user_purpose,device_purpose, andpurpose_suggested
joinUtilizationCsvSectionon the frontend, andReportingPagegets a
button on the purpose bar chart (confirmed data), a second button next to
it for the AI-suggested bucket (shown only onceby_purpose_suggestedis
in the report payload), and one on each purpose mix table (By User, By
Device), all calling the existingdownloadUtilizationCsvwith the
page's current window. The server has served these sections since #646
phases 1-2; only the frontend wiring was missing. - Added lab purpose classification, phase 3 (issue #646): device-level
utilization reporting now inherits transit gear from cabling's fork
wiring. Cabling gainsPOST /internal/forks/devices/batch
(X-Internal-Token, 1 to 500 reservation ids) returning, per reservation
with a fork (ACTIVE or ARCHIVED), the sorted distinct device ids across
itsfork_connectionsrows. Reservations' utilization report calls it in
chunks of 500 and folds each reservation's fork-connected devices minus
its own reserveddevice_idsintoby_deviceandby_device_purpose: a
transit device inherits the reservation's confirmed category (or
unclassified) exactly as a reserved device does, and a device both
reserved and on a path counts once, as reserved.reservation_count/
hoursandreservations/device_hoursare now INCLUSIVE of transit
gear; both buckets gaintransit_reservationsand a transit-hours field
(transit_hoursonDeviceBucket,transit_device_hourson
DevicePurposeBucket) reporting the transit share alone. A new
include_transitquery parameter (default true) on both
GET /reports/utilizationand its CSV twin skips the cabling call
entirely when false, reproducing phase-1 semantics;UtilizationReport
gainstransit_includedechoing the effective value. Cabling being
unreachable, or returning a non-200, fails CLOSED with 503
{"error": "transit_gear_unavailable"}on both routes rather than
silently reporting zero transit devices. Thedevice/device_purpose
CSV sections gain trailingtransit_reservations/transit-hours columns.
The reporting page's by-device Purpose Mix table gains a Transit column
(hours plus a percentage for a mixed row, a small tag for a transit-only
row) and a helper line naming which semantics are in effect. - Added lab purpose classification, phase 2 (issue #646): the AI orchestrator
gainsPOST /api/ai/classify-purpose/preview(user JWT, creation pass) and
POST /api/ai/internal/classify-purpose(X-Internal-Token, end-of-
reservation pass), both behindAI_PURPOSE_CLASSIFICATION_ENABLED
(default off, enforced at the route boundary like recipe authoring). Each
makes one forcedclassify_purposetool call against a caller-supplied
category list, assembling a prompt from purpose text, topology device/
template/wiring signals, dynamic template names, config-apply job names
and counts, fork version count, duration/status, and, when
AI_PURPOSE_INCLUDE_TRANSCRIPTSis set (default on), the reservation
assistant's own transcripts; a signal-fetch failure is logged and dropped
rather than failing the request, reflected in the response's
signals_used.GET /api/ai/statusgainspurpose_classification.
Inventory gains one small additive internal endpoint,
GET /devices/{device_id}/apply-jobs/internal, to feed the config-apply
signal without a user JWT. Seedocs/AI_PURPOSE_CLASSIFICATION.md. - Added lab purpose classification, phase 1 (issue #646): reservations gain an
optionalpurpose_categoryvalidated against a configured taxonomy
(PURPOSE_CATEGORIES), settable by the owner or an admin in any status
including terminal viaPATCH /{id}/purpose-category, listed via
GET /purpose-categories, and carried additively on every
reservation.*lifecycle event and the/api/v1facade. The utilization
report and its CSV export gainby_purpose,by_user_purpose, and
by_device_purposebreakdowns, with an explicitunclassifiedbucket for
reservations with no category. Device-level classification counts reserved
devices only; transit-gear inheritance is deferred to phase 3. - Added lab purpose classification, phase 2 reservations-side pieces (issue
#646, ADR 0013 points 8-11): a reservation transitioning into COMPLETED,
CANCELLED, or FAILED now stampspurpose_classify_requested_at, the sole
trigger for a new expiration-sweep reconciler that calls the AI
orchestrator's internal classify-purpose endpoint in bounded batches
(PURPOSE_CLASSIFY_BATCH_SIZE, capped atPURPOSE_CLASSIFY_MAX_ATTEMPTS
retries per row) and stores the result verbatim aspurpose_suggestion. New
admin endpoints: `GET /ad...
HERD v0.3.0
Release gate: a clean make everything at the tagged commit (unit, coverage, format check, live LDAP, contract, integration, e2e including the seeded no-skip pass, Postgres-live, and load, all green).
- Shipped LDAP directory group sync end to end (ADR 0011): a directory group
client and mapping store, a fail-closed reconciler with an asymmetric skip
taxonomy, a deactivation/reactivation sweep, an interval sync loop, and an
admin UI at/admin/ldap-sync, plus a checked-in LDAP test gate and live
Postgres/LDAP coverage wired intomake masterandmake everything. - Added fork version preview, diff, and restore to the reservation topology
editor: a read-only ghosted preview of any saved version, a client-side diff
against another version or the current draft, and restore-to-draft that
stages a version's canvas for the next Commit rather than reconciling
directly. - Introduced network element objects (ADR 0012, issue #22): a persistent,
non-device canvas node that many device ports can attach to for a shared
VLAN segment, subnet, external cloud, or patch-panel trunk, with backend
validation and fork-save handling, a frontend palette and attach dialog, and
a live Playwright suite; provisioning is deferred to a later anchored-VLAN
phase. - Added a seeded end-to-end test pass (issue #629) so a device-gated Playwright
test can no longer silently skip behind a green gate:make test-e2e-seeded
runs after the gate stack is seeded, in bothmake everythingand nightly,
and fails the run on any unexpected skip. - Hardened JetStream for production:
make prodnow persists stream data
across container recreates via a mounted volume, with a shared add-or-update
stream helper and a configurable retention cap; dev and gate stacks keep
starting every stream empty by design. - Migrated the AI orchestrator to the anthropic 1.x SDK and made service
images lock-faithful: every backend Dockerfile now installs from the
workspaceuv.lockexport instead of resolving dependencies fresh, with a
new CI check that diffs an image's installed packages against the lock. - Consolidated recurring backend patterns into
herd_common: pagination,
database setup, CORS, internal-service calls with TTL caching, and more,
removing duplicated code across most of the 12 services with no behavior
change. - Shipped a multi-port wiring dialog and a matching admin multi-connect
dialog, both backed by a new bulk connection-create endpoint, and fixed
same-device ("loopback") 1:1 pairing in the admin dialog. - Closed two reconcile edge cases left from the ADR 0009 epic: record-time L2
supersession settles a stale cross-reservation row on frozen wiring instead
of leaking its VLAN allocation, and stale-intent revalidation widens
release-direction reconcile against failed-but-still-intended rows without
weakening build-direction rebuild.
Full delivery detail for every item above is in CHANGELOG.md under 0.3.0.
HERD v0.2.0
Release gate: a clean make everything at the tagged commit (unit, contract, integration, e2e, coverage, format-check, and load, all green).
- Completed the connection-driven reconcile epic (ADR 0009): initial provisioning, fork saves, and terminal teardown all flow through one full-reconcile pipeline over the three wiring ledgers, retiring the legacy device-set resolvers; device-set changes wire and release only through fork saves.
- Layered wiring-status surface: every wiring row is tagged l1/l2/l3 (L2 rows carry the resolved fabric VLAN, L3 rows a route count), the reservation Wiring tab renders all three layers with six-outcome retry counting, and the external
/api/v1facade gains a read-only wiring-status passthrough. - HERD-owned VLAN definition lifecycle:
create_vlanon a fabric allocation's first built membership over a transit-inclusive switch scope,delete_vlanon last-free with a reuse-race supersession guard; drivercreate_vlanis required to be idempotent. - Reliability hardening: unreadable fork intent defers convergence instead of tearing down live wiring; terminal teardown freezes wiring first, with commit-time frozen re-checks in all three ledgers; device removal releases wiring from the saved intended set, never the draft canvas, with a durable retry marker; NATS consumers wait for schema readiness during upgrades; startup never runs create_all on a migration-managed schema.
- Security: bulk topology import updates enforce the creator-or-admin gate per row, and visible-device lookups are self-or-admin.
- Frontend: ACL grants management UI, and dynamic-template authoring with hypervisor registration.
- Developer platform: Playwright effect-assertion e2e suite, the validation-gate stack isolated in its own compose project, and a shared HerdBaseSettings config base class.
HERD 0.1.0
HERD v0.1.0
HERD (Hardware Environment Replication and Deployment) is a lab reservation and topology-management platform built lab-first, for any organization that runs a hardware lab and cannot answer two questions: "do we have a lab, and how do I use it?" and "what was done in the lab, by whom, on what, for how long?" Any engineer can browse live inventory, build a topology, and reserve equipment without tribal knowledge, while leadership gets utilization reporting with CSV export to defend lab budget. The differentiator is the AI topology pipeline: a user describes a need in plain language, an LLM proposes a valid wiring plan against live inventory, a human reviews it as ghost nodes on the canvas, and committing transactionally creates the topology, books the reservation, and can push per-device configuration. This is the first tagged release; it consolidates 296 merged pull requests into a coherent platform.
Highlights
- AI topology generation with human-in-the-loop review: natural-language prompts plus optional PDFs, tech-support tarballs, or text files produce role-based device proposals rendered as ghost nodes; Accept transactionally creates the topology and books the reservation, with an optional per-device config push. Feature-gated by a configured LLM provider, with an Anthropic backend and an OpenAI-compatible backend covering vLLM, Ollama, LM Studio, OpenAI, and Azure OpenAI.
- Reservation lifecycle with editable per-reservation topology forks: PENDING to PENDING_PROVISION to ACTIVE to COMPLETED, with CANCELLED and FAILED branches, automatic activation and expiration, and conflict detection for exclusive devices. On activation each reservation gets an editable fork of its parent topology; the owner or an admin re-wires it in live-edit mode, edits autosave as drafts, and a commit reconciles with a release-before-build set arithmetic. Port claims that collide with another active reservation are refused with a conflict that names the blocker, and when the reservation ends the fork freezes to an immutable, read-only as-built record.
- Automatic infrastructure provisioning driven by reservation lifecycle events: Layer 1 port cross-connects, Layer 2 VLAN creation and membership with fabric-aware conflict-free VLAN ids, and Layer 3 static routes pinned from the switch's latest config version so teardown removes exactly what was applied. After any fork save, wiring is reconciled connection-driven at all three layers against per-connection ledgers: Layer 1 cross-connects, Layer 2 VLAN port membership derived from the recorded wiring, and Layer 3 route adjacency; failures land as retryable per-item ledger rows with background auto-retry and manual retry, direction-aware so a stuck disconnect can finish even after a reservation ends. The reservation detail's Wiring tab surfaces the Layer 1 rows with per-cross-connect status (ACTIVE, RELEASED, FAILED, attempts, last error).
- Driver sandbox with admin-uploaded packages: driver packages (.zip or .tar.gz, SHA256-cached) run as a subprocess under POSIX rlimit caps and are validated for required methods before execution. Drivers may publish their own JSON Schema config vocabulary, extracted in the sandbox at load time and preferred over inventory's connection-type registry at the configure boundary. Per-command execution transcripts and a full audit trail of runs back the config-apply and AI-confirmation surfaces.
- Encrypted-at-rest credential store: a dedicated secrets service holds named secrets under AES-GCM envelope encryption, with a key-encryption key supplied by environment (the service refuses to boot without a valid one, so there is no source-visible default), online key rotation with a two-key rotation window, ACL-gated reveal, and an internal-token retrieval surface for automated provisioning.
- Dynamic hypervisor-backed resources: a
dynamictemplate type materializes an instance from a registered hypervisor at reservation time through a Hypervisor-connection-type recipe driver, records it in an instance ledger keyed for idempotent NATS redelivery, and surfaces it as a real inventory device. A reservation carrying any dynamic request activates only once every instance is materialized, and a configurable provisioning timeout prevents a lost callback from stranding a booking. - Local and LDAP/Active Directory authentication with three-role RBAC (user, admin, superadmin): LDAP users JIT-provision on first bind while superadmin rows stay local, device-group membership gates non-admin device visibility, and resource-level ACL grants layer narrower per-resource carve-outs on top.
- External
/api/v1integration facade with outbound webhooks: a stable, versioned surface for CI/CD and test automation to reserve and release devices, authenticated with admin-minted API tokens (a token's role can never exceed its principal's) and forwarding the caller's identity so RBAC, device-group visibility, and ACL grants apply as for an interactive user. Reservation lifecycle webhooks are HMAC-SHA256 signed, at-least-once with retry and backoff, idempotent onevent_id, and dead-lettered on exhaustion. - Supporting capabilities that round out the platform: a zero-database first-startup config UI whose saved values outrank env vars; utilization reporting by user, device, topology type, day, and group with CSV export and a fleet-utilization view; multi-channel notifications (in-app bell, email, Slack-style chat, HMAC-signed webhook) driven by durable consumers; bulk CSV/JSON import and export of devices, templates, and topologies; topology versioning with diff and restore; BFS shortest-path cable routing; and fleet-scale device health polling with idle/in-use poll tiers.
Architecture
HERD is a uv workspace of twelve FastAPI microservices behind a Traefik v3 gateway that terminates TLS and routes each /api/<service> path prefix. Every service owns its own PostgreSQL 16 schema, its own Alembic migration chain, and its own test suite; there are no cross-schema foreign keys or JOINs, so services reference each other only by UUID validated over HTTP at the boundary. Asynchronous work flows over NATS JetStream, and every state-change event is written to a per-service transactional outbox in the same database transaction as the state change, then drained to NATS by a background relay with broker-side and consumer-side dedup. Consumers are durable pull consumers with service-scoped dead-letter subjects retained on a dedicated DLQ stream, so a messaging outage delays delivery rather than dropping a provisioning or notification event. The frontend is React 19 with TypeScript and Vite, using Zustand and TanStack Query for state and a React Flow canvas for topology editing.
Quality
HERD ships behind a five-level QA bar: over 3,300 backend unit tests across the thirteen suites (SQLite in-memory), OpenAPI contract snapshot tests that fail on any public-API shape change, 173 cross-service integration tests against a live stack, 130 end-to-end browser tests (123 Selenium and 7 Playwright), and Locust load tests. Around 480 frontend tests run via vitest. Coverage targets 85% or higher per backend service. CI gates main with a branch-protection ruleset: the backend and frontend jobs (lockfile-drift check, lint, format check, tests, coverage, and the frontend build) must pass before merge, an advisory integration job boots the full ephemeral stack for the contract and integration suites, and a scheduled nightly workflow runs the heavier suites PR CI skips (contract, integration, e2e, and a seeded headless load run). CodeQL runs on pull requests, pushes to main, and a weekly cron across actions, JavaScript/TypeScript, and Python.
Known boundaries
- Initial reservation provisioning and teardown are still device-set-driven, not connection-driven. The connection-driven reconcile at all three layers ships for the fork-save path; unifying initial provisioning and teardown through it is in progress under ADR 0009 (phases 6 and 7).
- The per-connection wiring-status surface is Layer 1 only today; the Layer 2 and Layer 3 wiring-status view lands with ADR 0009 phase 8.
- Dynamic hypervisor-backed resources and AI-assisted recipe authoring are feature-gated (recipe authoring is dark by default behind
AI_RECIPE_AUTHORING_ENABLED), and dynamic template authoring is API, seed, or bulk-import only; the template editor UI has no dynamic option yet. - Resource-level ACL grants have no management UI; admins drive the ACL API directly.
- Driver packages are trusted code. The execution sandbox applies POSIX
setrlimitcaps (address space, CPU) and runs each package as a subprocess, but this is resource bounding, not OS-level isolation.
Documentation
The full user manual is published at https://vendrabuck.github.io/HERD/manual/.