docs · pre-release
Menu
Day to day / Dogs

Dogs

A dog is a process the shepherd runs for its own sake, not for yours. It watches the flock instead of being part of it. Two ship inside the shep binary: metrics, a Prometheus endpoint, and bark, webhook alerts. shep install downloads or builds one from the community index; shep adopt takes any other binary.

note
A dog is not the same thing as a sheep with a shepherd channel: see the shepherd channel for that. A sheep opens fd 3 and talks newline JSON to the daemon that already owns it. A dog is a separate client: it connects to shep.sock and speaks the same wire protocol shep flock or shep describe would.

What a dog actually is

Underneath, a dog is not a second kind of supervised process. It's an ordinary sheep with a marker on its entry saying where it came from (built-in, or adopted). The kill ladder, the backoff curve, the restart budget, what Errored means: none of it branches on whether an entry is a dog. A dog that restarts is still a dog when it comes back, and a dog whose binary won't spawn shows up in shep dogs as Errored, the same way a broken sheep would.

shep flock prints the flock as two tables (sheep, then dogs) and shep dogs prints the second one alone. Both built-ins always appear, disabled until enabled. A wildcard selector (stop all, reload all, /regex/) never touches a dog; naming one exactly always does, so shep disable bark reaches a dog that a sweep leaves running.

Turning one on

shep enable
shep enable <name>

enable and disable also take a sheep's name, which is a different verb. What follows is the dog half.

Writes shep.toml, then starts the dog if a shepherd is listening. Otherwise exits 0; the next shepherd starts it. To boot a shepherd, use shep start or shep muster.

Takes a built-in name or one shep adopt has recorded. Any other name exits 3 and lists the dogs, or 5 with no shepherd.

An errored dog retries from its current entry. A failed spawn exits 7 and says why. shep describe <name> shows that reason without secret values, also in JSON's spawn_failure. An online dog keeps running.

shep disable
shep disable <name>

The mirror: stops the dog if one is running and removes it from the boot list either way. shep flock keeps listing it, disabled. It carries no name check of its own, deliberately, so it is what takes a hand-written enabled_dogs entry back out.

shep delete
shep delete <name>

The one way to remove a dog: it is stopped, deregistered, and struck from enabled_dogs, adopted_dogs and channel_dogs in shep.toml, so the next boot does not bring it back. Its <name> section in dogs.toml stays, webhook URLs and all, and the verb says so: those settings are yours rather than the adoption's. A dog shep install put on disk also loses $SHEP_HOME/dogs/<name>/, its binary and its receipt. An adopted dog's file is never touched: it is yours, at a path you gave. A built-in dog is refused by the shepherd, and the refusal names shep disable as the verb that exists for one.

$ shep enable metrics
NAME     SOURCE    SHEPHERD  STATUS
metrics  built-in  true      online

$ shep dogs
ID  NAME     STATUS    PID    RESTARTS  EXIT  CPU  MEM    UPTIME  SOURCE    VERSION  ACCESS
0   metrics  online    49313  0         -     -    10.9M  2s      built-in  0.23.0   -
1   bark     disabled  -      0         -     -    -      0s      built-in  0.23.0   -

$ shep flock
ID  NAME  STATUS  PID    RESTARTS  EXIT  CFG  CPU  MEM   UPTIME  FOLD  SMIT
2   web   online  49290  0         -     -    -    3.0M  2s      -     -

Dogs
ID  NAME     STATUS    PID    RESTARTS  EXIT  CPU  MEM    UPTIME  SOURCE    VERSION  ACCESS
0   metrics  online    49313  0         -     -    10.9M  2s      built-in  0.23.0   -
1   bark     disabled  -      0         -     -    -      0s      built-in  0.23.0   -

$ shep disable metrics

The guard is on the verb, not on the file. Write a name into [daemon] enabled_dogs by hand and the shepherd still reads it at boot, still treats anything outside [daemon] adopted_dogs as built-in, and spawns shep dog <name> for it once per restart until the budget is spent. From shep dogs that reads as a climbing restart count against a SOURCE of built-in, for a name that is not one; shep bleats <name> is where the refusal itself shows up.

A dog's name is not a sheep's to take, built-in or adopted. Starting a new sheep named metrics is refused, whether the dog runs or sits disabled. A sheep that already holds the name keeps it: the shepherd skips the dog, warns at boot to rename one of the two, and shep enable metrics says a sheep is already registered under it.

The dogs table shares its column order with the sheep table above it, so a dog and a sheep read the same way. SOURCE and VERSION are the two columns only dogs have, and CFG, FOLD and SMIT the three only sheep have. See terminal output.

SOURCE is built-in, installed (a shep install receipt for a github.com/shep-pm repository), installed, community (a receipt for any other) or adopted (a path, no receipt). A fact, never a gate. VERSION is the manifest's, then → <new> when the cached community index lists a newer one. It never fetches. --format json and shep lookout carry both.

A dog whose STATUS reads silent is running but has never spoken to the shepherd, usually because a cargo install replaced its binary and the old process is still up. shep bleats <dog> has the refusal; shep restart <dog> is the fix. See terminal output.

Running enable and adopt at once from a provisioning script is safe: each takes an exclusive lock on shep.toml for its whole read-edit-write, so the second waits its turn. dogs.toml has its own lock on the same terms, held by both things that write it: the migration a boot runs once, and the config pane's own edits. A boot holding both takes shep.toml's first.

Dependencies

shep install installs the dogs a manifest's depends names and you haven't adopted first, each through its own grant question. One already adopted is left alone, whatever its version.

It refuses, naming the dependency and adopting nothing, when the index lacks it, approves a version outside the range, or the dogs depend on each other in a circle. A no at a dependency's question stops the install: that dependency stays installed and disabled, and the dog is not installed.

Upgrading a dog

shep upgrade <dog> follows the dog's receipt.json. A dog installed from the index moves to the index's current version, a prebuilt binary or cargo as shep install chooses. A dog installed with --ref rebuilds that ref at its newest commit. One already current is left alone, and the reply says so. A dog adopted from a path has no receipt and is refused: shep adopt is how it got there, and it is how you move it.

shep install <dog> on such a dog swaps it for the index build instead. It asks first, naming the adopted path, and --yes skips the question; with no terminal and no --yes it refuses before changing anything. The build keeps the name, the [dog.<name>] table and the enabled state, and the old file stays on disk.

$ shep upgrade otel
$ shep upgrade otel --ref fix-flush
$ shep upgrade otel --release
$ shep upgrade otel --rollback
$ shep upgrade --dogs

--ref switches to another ref, --release returns a ref install to the version the index approves, and --dogs upgrades every installed dog in turn, skipping a dog with no receipt. With --format json it answers one document whose data lists each dog's row.

Bare shep upgrade does shep, then the dogs. It lists shep with the command of the channel it came from and each installed dog the index has a newer version of, and asks once. Enter or ygoes on; anything else changes nothing. The channel's manager runs in the foreground, so its prompts and sudo work, and a failure stops the run before the dogs. A .deb or an archive prints its steps instead. On Windows no manager runs, because the shepherd holds shep.exe: it prints the command and shep daemon reload, and the flock restarts.

When a shepherd answers it then asks to reload onto the new shep. --reload skips the question, and with no terminal and no --reload the reload is skipped and its command printed. Bare shep upgrade refuses --format json; use shep upgrade --dogs --format json.

An upgrade installs into a new directory, points the adopted path there, writes a new receipt and restarts the dog. A dog that was disabled stays disabled. The cargo path prints a diff.rs link between the two versions. A permission the new build declares waits for review while the dog keeps the grants it has: shep dogs shows it.

The directory the upgrade replaced is kept, with its receipt, and the new receipt names it. --rollback puts both back and keeps the build it leaves, so a second rollback undoes the first. Only one replaced directory is kept: a second upgrade removes the older one.

When a dog starts

After the flock, by default. A metrics dog that came up first would spend the boot answering for a flock that is not running yet.

A log-rotation dog is the other way round, since it has to be running before a sheep starts writing. Put its name in [daemon] boot_first_dogs and it runs ahead of every sheep:

$SHEP_HOME/shep.toml
[daemon]
enabled_dogs    = ["metrics", "log-rotate"]
boot_first_dogs = ["log-rotate"]

A name here that is not in enabled_dogs is inert: promoting a dog does not enable it. This is shep.toml rather than dogs.toml for the same reason adopted_dogs is: the [<name>] table in dogs.toml is passed through to the dog itself, and a shep-owned key inside it would collide with a third-party dog's own schema. See boot order for the stages this positions a dog in.

[daemon] channel_dogs lives there too, written by shep adopt for a dog that asks for the shepherd channel. Such a dog takes shep trigger.

shep daemon reload carries every dog holding a process, marked or not, and leaves a parked one behind: a dog that is disabled and stopped is registered at rest by the successor the way a cold boot registers it, under a new id. A dog enabled_dogs dropped is stopped and marked, running or already stopped, so it reads disabled and shep enable <name> is the way back.

Two files, two kinds of setting

A dog's settings are split across two files, and the split is the security model rather than tidiness. dogs.toml holds how the dog behaves: its own [<name>] table, in the schema the dog publishes. shep.toml holds what you trust it with: enabled_dogs, adopted_dogs with itsenv, dog_grants, boot_first_dogsand channel_dogs.

A dog's own settings never carry the trust it holds. Nothing that editsdogs.toml can grant a dog a permission, hand it a secret, or swap the binary the shepherd spawns, because none of those live there. Writing env into a [dog.<name>] section in shep.toml is the mistake this split is most likely to produce. A boot moves that section to dogs.toml, where the dog can read it back over the socket and its environment never carries it. Where the dog already has a dogs.toml section the shepherd refuses the boot rather than pick between the two, and names [daemon.adopted_dogs] as where that env goes.

Lookout edits both halves from one place, so you rarely open either file: e on a dog's row writes its field edits to dogs.toml and its env to shep.toml. See the dog config pane.

Configuration lives on the socket, not the environment

A dog's settings live under [<name>] in $SHEP_HOME/dogs.toml, hand-editable and separate from shep.toml, and they never travel through the dog's environment. Instead the dog connects to the socket and asks for its own section over the wire. The daemon reads the file fresh for every such request rather than serving a cached copy.

shep adopt fills that section in when the dog's manifest carries defaults and the section is not there yet; it never rewrites one that is.

An environment variable is readable from the process table, inherited by every child the dog spawns, and captured into a crash dump. [bark.sinks] routinely holds a webhook URL, and a webhook URL is a bearer credential. Keeping the whole section off the environment means nobody has to remember which dog's config is sensitive.

The one setting shep does send through the environment is the env an operator sets beside an adopted dog's path in [daemon.adopted_dogs]: the same key a sheep has.

$SHEP_HOME/shep.toml
[daemon.adopted_dogs.kelpie]
path = "/usr/local/bin/shep-kelpie"
env  = { PADDOCK_KEY = "{{secret:paddock/key}}" }

A changed path or env reaches a running dog only through shep disable kelpie then shep enable kelpie. A reload restarts no dog and a restart respawns from the old entry, so each prints a notice naming the dog.

A value may be a {{secret:...}}, resolved at spawn and never written back to the file, and SHEP_HOME and SHEP_DOG_NAME are set over anything env claims for them. A built-in dog has no entry to set env in. Lookout edits it from the dog's row, every value shown as <set>, and reaches the dog the same way its section does.

careful
Editing [<name>] in dogs.toml does not reach a dog that's already running. It asked for its section once, at startup, and nothing pushes it a new one. shep disable <name> && shep enable <name> is what re-reads it: a fresh process asking a fresh question.

Three places a dog's config can live

[<name>] in dogs.toml, above, is the dog's own settings. A sheep's Flockfile entry can also carry [app.dogs.<name>], one table per dog for that sheep alone: shep stores it and hands it to the dog it names, reading nothing inside. See reading a sheep's own table for how a dog gets it.

shep copy web.dogs.kelpie api.dogs.kelpie moves one sheep's table for a dog onto another sheep, merging into what that sheep already holds unless --replace says otherwise. shep get kelpie prints the dog's own section, and shep set kelpie.worker.timeout 60 changes one key inside it, and shep unset removes one.

A dog declaring validate is asked before any write to its settings lands, and its refusal stops the write in its own words. A copy of a table is one of those writes:

$ shep set api.dogs.kelpie.git.checkout /srv/other --yes
KEY       CHANGE   OLD       NEW
checkout  changed  /srv/api  /srv/other
error[invalid_config]: nothing was written: `kelpie` refused `api`'s table for `kelpie`: this checkout belongs to another project

A dog that declared nothing is never asked, and one that isn't running has nothing to ask. Writing a dog has what it is asked.

A third place, [dog.<name>] at the top level of a Flockfile, is read and discarded: shep parses it so the file still loads, but keeps nothing from it. It exists for a dog that reads its own Flockfile directly.

Live updates without a restart

A dog can subscribe instead of waiting to be bounced. Shep publishes on config.dog.<name> when it changes a dog's section itself, and a dog holding a subscription re-asks for its section and decides what the change means: swap the values, rebind a listener, or ask for its own restart. The frame says the section changed, not what is in it. Bark subscribes and swaps in place: sinks and rules are pure data. Four things publish today: the boot that moves a section out of shep.toml, a write from the dog config pane, which is why an edit made there reaches a running bark without bouncing it, a provider dog's push that changes a value the section names with {{secret:namespace/KEY}}, and a change to secrets.json that moves a key the section names with {{secret:KEY}}. Writing the same value again publishes nothing. A hand edit of dogs.toml still needs the stop and start above.

careful
A dog that restarts itself on a config change has to say so in its own log. Nothing else can tell that apart from a crash loop, and the restart count is the column an operator reads as instability.
careful
A section that used to live in shep.toml migrates to dogs.toml once, on the first boot of a shep carrying this move, and it prints which dogs moved. Any boot does it, including shep runtime and shep dev, and adopt of a dog whose manifest carries defaults migrates first. If a name carries values in both files, the daemon refuses to boot until one section is deleted, shep daemon reload refuses before it signals the shepherd it was going to replace, and so does such an adopt. An empty [dog.<name>] is not a value and refuses nothing. A dog present in only one file migrates or starts normally.
What a provider dog pushes

A dog can also push, not only be configured. A provider dog sends Request::PutSecrets with its own registered name as the namespace, replacing whatever that namespace held for one environment rather than merging into it. Pushed values are cached to $SHEP_HOME/secrets-cache.json by default, so a reboot does not leave every sheep that reads them waiting on the dog and a network round trip; persist = false in the dog's own section of dogs.toml turns that off. See Secrets for the token that reads a pushed value, and for what a namespace does and does not defend against.

careful
A namespace can legally contain a dot, and an unquoted section header does not mean what it looks like. [vercel.prod] in dogs.toml parses as a nested TOML table, key prod inside table vercel, not as one literal section named vercel.prod. A namespace with a dot in it needs a quoted header, ["vercel.prod"], or the section never matches and persist silently falls back to its default of true. This is ordinary TOML, and the same trap catches any dog name with a dot in it, not only a provider's namespace.

The metrics dog

shep enable metrics serves Prometheus exposition text over plain HTTP, bound to 127.0.0.1:9615 by default:

dogs.toml
[metrics]
bind = "127.0.0.1:9615"

The flock and host series are rebuilt per scrape, from a fresh flock listing and a fresh host sample. The channel samples are not: the dog keeps the last sample per sender, name and label set until that sender stops or restarts. Verified by scraping it directly:

$ curl 127.0.0.1:9615/metrics
shep_sheep_memory_bytes{sheep="web",id="0",fold=""} 3178496
shep_sheep_restart_total{sheep="web",id="0",fold=""} 0
shep_sheep_status{sheep="web",id="0",fold="",status="online"} 1
shep_dog_up{dog="metrics",source="built-in"} 1
shep_daemon_up{version="0.1.0"} 1
shep_daemon_pid 39898
shep_host_memory_total_bytes 51539607552
Full metric reference
MetricMeaning
shep_sheep_cpu_percent Tree CPU as a percentage of one core, over the last sampling window.
shep_sheep_memory_bytes Tree resident set size in bytes.
shep_sheep_restart_total Restart count since registration or the last shep reset.
shep_sheep_uptime_seconds Seconds since this sheep's last successful start.
shep_sheep_status 1 for the status this sheep is currently in, 0 for every other status.
shep_dog_up 1 when this dog is online, 0 otherwise. A disabled dog has no series.
shep_daemon_up Always 1: the scrape reached the shepherd.
shep_daemon_pid The shepherd's own pid, so a restart is visible as a step change.
shep_host_memory_total_bytes Total physical memory on the host.
shep_host_memory_used_bytes Memory in use on the host, as the platform reports it.
shep_host_processes Number of processes running on the host, the flock included.
shep_host_uptime_seconds Seconds since the host booted.
shep_channel_samples_refused_total Channel samples this dog refused, by reason. Absent until the first refusal.

A reference Grafana dashboard built against this exact metric set ships in assets/grafana/. The default bind is loopback on purpose. Every series above carries a sheep's name as a label, and on plenty of hosts that's the name of an internal service. Widening bind to 0.0.0.0 is one config line away, but metrics won't make that call for you by shipping wide and asking you to lock it down.

Channel samples

A sheep or a dog can send its own numbers on its shepherd channel. The dog keeps them and appends them to every scrape, after the groups above and beside every export, under the labels shep already uses for that process: sheep, id and fold for a sheep, dog and source for a dog. The shepherd channel says what to write on fd 3.

RuleRefused as
A name matches [a-zA-Z_:][a-zA-Z0-9_:]*, at most 128 bytes invalid_name
No name starts with shep_ reserved_name
A label name matches [a-zA-Z_][a-zA-Z0-9_]*, at most 64 bytes, no __ prefix invalid_label
No label named sheep, id, fold, dog or source reserved_label
At most 16 labels, 256-byte label values, 512-byte help text too_long
At most 1024 series per sender, oldest kept series_cap
A name keeps the kind its first sample set type_conflict

A refusal is counted in shep_channel_samples_refused_totalwith a reason label, and the dog prints one line per sender and reason in its own log, read with shep bleats metrics. A metric that never shows up is otherwise silent.

A sender's samples go when it stops, exits, restarts, is deleted or errors. A reload frees the drained instance's through its own deregistration, never the numbers of the instance now serving.

OTLP export

The same series can be pushed to an OTLP/HTTP collector instead of waited for. otlp_endpoint is the only key that turns it on:

dogs.toml
[metrics]
otlp_endpoint = "http://127.0.0.1:4318"
otlp_interval = "60s"
otlp_timeout = "10s"

[metrics.otlp_headers]
Authorization = "Bearer token-from-a-secret-manager"
KeyMeaning
otlp_endpoint Base URL of the collector, http:// or https://. Absent means no export, and /v1/metrics is appended to it.
otlp_interval Between exports, 60s by default. The first lands one interval after the dog starts.
otlp_timeout One export's budget, connect through response, 10s by default.
otlp_headers Extra headers, for a collector that needs auth. Empty by default, and never printed.

Export is a cargo feature: on in every prebuilt release binary and the .deb, off in cargo install shep and the Homebrew formula:

$ cargo install shep --features otel

A build without it refuses otlp_endpoint at startup, exiting invalid_config and naming the feature, rather than running a dog that exports nothing while shep listreports it online.

The body is OTLP/JSON, your samples included: they land after the built-in groups, named as /metrics names them. Every series above is a gauge exceptshep_sheep_restart_total and the samples you sent as counters, monotonic cumulative sums whosestartTimeUnixNano is when their sender started, so a restart moves it and a collector reads the reset; the dog's own counters keep its start, so a shep reset does not move the start time of shep_sheep_restart_total and a collector reads the drop as a restart of the series. A sample's help text is itsdescription, and one with none has none. shep_channel_samples_refused_total goes out as an integer sum. Integers are decimal strings, rates and sample values are numbers, and every Prometheus label is a string attribute, so both paths report the same series with the same labels. NaN and+Inf reach /metrics but not the export.

One failed export is one line in the dog's log, on the first failure after a success and again on recovery, never once per tick. A 2xx whose body names a partialSuccess counts as one: the line carries its rejectedDataPoints anderrorMessage, and an empty partialSuccess is a clean export. Its body is read for that alone, up to 8 KiB. It never touches the scrape server or the dog's exit code, and there is no final flush on stop: the next tick sends current values anyway.

The feature adds no dependency, and its cost is code only. Measured on one machine (macOS, Apple Silicon, raw file size, not #292's corrected install-size method):

Buildtarget/release/shep
default 19,069,728 bytes
--features otel 19,166,944 bytes
delta 97,216 bytes

The bark dog

shep enable bark subscribes to the shepherd's event bus and delivers to named webhook sinks:

dogs.toml
[bark.sinks]
oncall = { kind = "discord", url = "https://discord.com/api/webhooks/..." }
audit = { kind = "json", url = "https://example.internal/hook" }

[[bark.rules]]
on = "gave_up"
sinks = ["oncall", "audit"]

[[bark.rules]]
on = "restart_rate"
restarts = 5
within = "2m"
sinks = ["oncall"]

A sink URL can't carry credentials. https://user:[email protected]/ is refused when dogs.toml is read, not when a rule first fires: nothing here sends an Authorization header, so the pair could only be discarded or sent as part of a hostname. Discord and Slack put the secret in the path instead, which is why the whole URL is a credential.

An https:// sink needs a publicly trusted certificate. shep trusts the public certificate authorities compiled into it and nothing else, so a private-CA or self-signed endpoint is refused. http:// is the route to a private endpoint.

Leave [[bark.rules]] out and bark doesn't go quiet: one rule is built in by default, firing on every configured sink whenever a sheep reaches Errored. That's the alert that must not be missed, so it needs no opt-in. restart_rate is the opposite: an early warning for a sheep flapping but not yet Errored, and it's opt-in because that's exactly the kind of thing that pages someone at 3am for a blip if an operator didn't choose the threshold themselves.

careful
Verified directly: enable bark with [bark.sinks] absent entirely and it does not run quietly with nowhere to send alerts: the default rule still exists with zero sinks to route to, bark logs rule 0 routes to no sink at all on every restart attempt, and lands on Errored. A dog needs at least one configured sink before shep enable bark is worth running.

Every rule debounces per subject, five minutes by default, never globally. A global debounce would mean the second sheep to go down during an incident goes silent, which is usually the incident's most interesting fact. The bus itself (tokio::sync::broadcast) drops what a lagging subscriber can't keep up with, so bark also polls the flock's state on a timer (30s by default) and evaluates the same rules against that snapshot. A dropped frame triggers an immediate poll instead of waiting. The two routes share one debounce record per subject, so an Errored seen by both fires once, not twice.

To alert on a line a sheep prints, add a log_match rule:

dogs.toml
[[bark.rules]]
on = "log_match"
pattern = "FATAL|panicked at"
stream = "err"
sinks = ["oncall"]

pattern is a regex, unanchored, and can't be empty. stream is out, err or both (the default). The first matching line per sheep per debounce window is the one sent; later ones in the window are dropped. The shepherd forwards log lines to bark only while a log_match rule exists, and bark can miss lines when a sheep outruns it: the poll can't recover a line. The line goes to the sink as written, so it can carry a secret.

Every fired alert is appended to $SHEP_HOME/barks.jsonl, a byte-capped ring (1MiB by default) that evicts the oldest record first: the file shep barks reads. It's written through an advisory file lock, never truncated in place, because two different processes append to it: the bark dog when a rule fires, and the shepherd itself when an enabled dog exhausts its own restart budget.

Reading the alert history

shep barks
shep barks [--tail N]

Prints that file, newest last, with --tail to see only the last few. It reads barks.jsonl straight off disk and never connects to the shepherd, which is the whole point: the history is on disk precisely so it outlives the shepherd, and the moment this verb exists for is an operator reading it after a crash.

$ shep barks
WHEN                 RULE    SUBJECT  MESSAGE                                                                     SINKS
2026-08-29 21:06:35  daemon  flaky    dog flaky exhausted its restart budget: 15 restarts against a budget of 16  -

SINKS names each sink the alert was delivered to, with (failed) appended to any that refused it, so a delivery failure is visible in the table you are already reading rather than only in --format json. It never carries the sink's own error text, which can quote a webhook's HTTP response and would widen an already-tight column for something the JSON already has in full. A - means the shepherd wrote the record itself, with no sinks and no webhook code behind it, which is the case above.

A line that won't parse costs you that one record, not the history. A writer that died mid-append, or a record from a newer shep, is skipped and the rest still prints. This file is read during an incident, and refusing the whole ring over one bad line would be the wrong failure mode.

Writing your own

A dog is an ordinary binary that answers a few questions on stdout and speaks the dog protocol on a socket the shepherd hands it. The whole contract, including what --version and --schema have to answer and why the binary is the only thing that can answer them, is its own chapter: Writing a dog.

What shep writes into a dog's own log

A dog's log is the first place anyone looks when a dog misbehaves, and it used to hold only what the dog itself said. Everything shep had to say about it went to shepd.err.log, which is not the file shep's own error messages tell you to open. Shep now writes its own account into the dog's log too, marked [shep] so it can't be mistaken for the dog's output.

2026-09-02T14:22:31.412+02:00 [shep] shep started this dog; its process is pid 5512
2026-09-02T14:22:31.480+02:00 [shep] shep accepted this dog's handshake; it is registered with this shepherd as `log-rotate`, on protocol 8
2026-09-02T14:22:31.492+02:00 rotating web-0-out.log (12.4 MiB)

Six things get written: the spawn and the resolved binary path, an accepted handshake (once, the first time this shepherd hears from the dog, not on every reconnect), a refused handshake with both protocol numbers, the warning when a dog goes quiet, the verdict when shep gives up on it, and the exit code or signal when its process stops. shep bleats <name> --follow sees the same lines live, marked the same way, interleaved with the dog's own output in arrival order.

When a dog stops answering

A dog that is running but never handshakes gets one restart from disk and then a verdict. That verdict says what the shepherd actually watched happen, because the three cases it reports have opposite fixes.

  • Nothing has ever connected from the dog's process. The dog isn't reaching the socket. Rebuild or reinstall it.
  • Its process has connected, and never named a dog in its handshake. The dog is talking to shep and may be serving every request it's asked; what it doesn't do is say who it is. Reinstalling the same build won't change that: it's built against shep-client older than 0.1.23, or it calls Client::connect where it should call ReconnectingClient::connect_as_dog. Rebuild it against a current shep-client.
  • Shep couldn't tell which process opened the connections. Windows has no peer identity by design, and some unix platforms decline to report a pid. Neither of the two above is ruled out, so shep names both and tells you to read the dog's own log: a dog that can't reach the socket says so there, and one that's merely anonymous doesn't.

Every one of them ends with a command to run. The one before them said the binary on disk cannot talk to this shep either in all three cases, which sent one operator through two days of reinstalling a dog that was connected and serving requests the whole time.

When a dog dies

If an enabled dog exhausts its own restart budget and lands on Errored, the shepherd writes a record straight into barks.jsonl itself, independent of whether the bark dog is even running. That matters for one reason: bark has no webhook code of its own for reporting its own death, so if bark is the one that died, nothing pages anyone about it over Discord or Slack. What you get instead is a local record (shep barks after the fact) and the metrics dog's shep_dog_up gauge dropping to 0 for that dog's name.

Nothing watches across dogs, and that's not an oversight: the supervisor that restarts a crashed dog has no idea what a "dog" is beyond the marker on its entry, so no dog is positioned to watch another dog the way the shepherd watches all of them. shep barks and the metrics endpoint are the two places that say a dog went down.