<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Zsh on Nick Liu - Software Engineer</title><link>https://nick-liu.com/tags/zsh/</link><description>Recent content in Zsh on Nick Liu - Software Engineer</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>nickboy@users.noreply.github.com (Nick Liu)</managingEditor><webMaster>nickboy@users.noreply.github.com (Nick Liu)</webMaster><copyright>2026 Nick Liu</copyright><lastBuildDate>Tue, 27 Oct 2026 23:26:23 -0700</lastBuildDate><atom:link href="https://nick-liu.com/tags/zsh/index.xml" rel="self" type="application/rss+xml"/><item><title>My agent's shell said 0 errors. The log had 48,299.</title><link>https://nick-liu.com/posts/agent-shell-zero-errors/</link><pubDate>Tue, 27 Oct 2026 00:00:00 +0000</pubDate><author>nickboy@users.noreply.github.com (Nick Liu)</author><guid>https://nick-liu.com/posts/agent-shell-zero-errors/</guid><description>&lt;div class="lead text-neutral-500 dark:text-neutral-400 !mb-9 text-xl"&gt;&#10; &#10;A machine-health audit run by my coding agent reported a clean system log: zero error or fault lines in the last 30 minutes. The real number was 48,299. Nothing failed loudly. The pipeline exited 0, the count came back as a tidy `0`, and the command that was supposed to read the log never ran at all.&#10;&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;The command was ordinary:&lt;/p&gt;</description><content:encoded>&lt;div class="lead text-neutral-500 dark:text-neutral-400 !mb-9 text-xl"&gt;&#10; &#10;A machine-health audit run by my coding agent reported a clean system log: zero error or fault lines in the last 30 minutes. The real number was 48,299. Nothing failed loudly. The pipeline exited 0, the count came back as a tidy `0`, and the command that was supposed to read the log never ran at all.&#10;&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;The command was ordinary:&lt;/p&gt;&#10;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;log show --last 30m --predicate &lt;span class="s1"&gt;&amp;#39;messageType == error OR messageType == fault&amp;#39;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; wc -l&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;p&gt;In my terminal it works. In the agent&amp;rsquo;s shell, &lt;code&gt;log&lt;/code&gt; is not the macOS log&#10;tool. It is a zsh builtin that has nothing to do with logs.&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;What &lt;code&gt;log&lt;/code&gt; meant in that shell&#10; &lt;div id="what-log-meant-in-that-shell" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#what-log-meant-in-that-shell" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;zsh ships a module called &lt;code&gt;zsh/watch&lt;/code&gt;, and that module adds exactly one&#10;builtin command named &lt;code&gt;log&lt;/code&gt;. Its job is to list the users currently logged&#10;in. It takes no arguments, so when it receives &lt;code&gt;show --last 30m ...&lt;/code&gt; it&#10;complains and exits with status 1:&lt;/p&gt;&#10;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="gp"&gt;$&lt;/span&gt; zsh -c &lt;span class="s1"&gt;&amp;#39;whence -w log&amp;#39;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;log: builtin&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="gp"&gt;$&lt;/span&gt; zsh -c &lt;span class="s1"&gt;&amp;#39;log show --last 1m&amp;#39;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;zsh:log:1: too many arguments&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;p&gt;That error went to stderr, and the audit never looked at stderr. What it&#10;looked at was the pipeline, and a pipeline in zsh reports the status of its&#10;last command. The last command was &lt;code&gt;wc -l&lt;/code&gt;, which happily counted zero lines&#10;of input and exited 0:&lt;/p&gt;&#10;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="gp"&gt;$&lt;/span&gt; zsh -c &lt;span class="s1"&gt;&amp;#39;log show --last 1m 2&amp;gt;/dev/null | wc -l; echo &amp;#34;status=$?&amp;#34;&amp;#39;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt; 0&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;status=0&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="gp"&gt;$&lt;/span&gt; zsh -c &lt;span class="s1"&gt;&amp;#39;setopt pipefail; log show --last 1m 2&amp;gt;/dev/null | wc -l; echo &amp;#34;status=$?&amp;#34;&amp;#39;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt; 0&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;status=1&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;p&gt;The zsh manual describes this default plainly: without &lt;code&gt;PIPE_FAIL&lt;/code&gt;, the&#10;exit status of a pipeline is the status of its rightmost element. With&#10;&lt;code&gt;pipefail&lt;/code&gt; set, the same command returns 1. The &lt;code&gt;0&lt;/code&gt; on stdout stays the&#10;same either way, which is worth noticing: even with the option on, a script&#10;that reads only the printed number still sees a clean log.&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;&amp;ldquo;It works when I type it&amp;rdquo;&#10; &lt;div id="it-works-when-i-type-it" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#it-works-when-i-type-it" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;This is the part that cost the most, because I could not reproduce it.&lt;/p&gt;&#10;&lt;p&gt;macOS knows about the collision. The system &lt;code&gt;/etc/zshrc&lt;/code&gt; contains this line:&lt;/p&gt;&#10;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="gp"&gt;$&lt;/span&gt; grep -n &lt;span class="s1"&gt;&amp;#39;disable log&amp;#39;&lt;/span&gt; /etc/zshrc&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;13:disable log&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;p&gt;That disables the builtin so &lt;code&gt;log&lt;/code&gt; falls through to &lt;code&gt;/usr/bin/log&lt;/code&gt;. The&#10;catch is in the file name. zsh reads &lt;code&gt;/etc/zshrc&lt;/code&gt; for interactive shells&#10;only. My terminal is interactive, so I never see the builtin. The shell my&#10;coding agent runs commands in is not interactive, so &lt;code&gt;/etc/zshrc&lt;/code&gt; never&#10;runs, and the builtin wins.&lt;/p&gt;&#10;&lt;div class="not-prose diagram diagram-light"&gt;&lt;svg id="d1b97b1f9641ee4bflight" width="100%" xmlns="http://www.w3.org/2000/svg" class="flowchart" style="max-width: 360px;" viewBox="4 4 360 728" role="graphics-document document" aria-roledescription="flowchart-v2"&gt;&lt;style&gt;#d1b97b1f9641ee4bflight{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,segoe ui,Roboto,helvetica neue,Arial,noto sans,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#d1b97b1f9641ee4bflight .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#d1b97b1f9641ee4bflight .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#d1b97b1f9641ee4bflight .error-icon{fill:rgb(255, 255, 255);}#d1b97b1f9641ee4bflight .error-text{fill:#000000;stroke:#000000;}#d1b97b1f9641ee4bflight .edge-thickness-normal{stroke-width:1px;}#d1b97b1f9641ee4bflight .edge-thickness-thick{stroke-width:3.5px;}#d1b97b1f9641ee4bflight .edge-pattern-solid{stroke-dasharray:0;}#d1b97b1f9641ee4bflight .edge-thickness-invisible{stroke-width:0;fill:none;}#d1b97b1f9641ee4bflight .edge-pattern-dashed{stroke-dasharray:3;}#d1b97b1f9641ee4bflight .edge-pattern-dotted{stroke-dasharray:2;}#d1b97b1f9641ee4bflight .marker{fill:rgb(74, 86, 92);stroke:rgb(74, 86, 92);}#d1b97b1f9641ee4bflight .marker.cross{stroke:rgb(74, 86, 92);}#d1b97b1f9641ee4bflight svg{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,segoe ui,Roboto,helvetica neue,Arial,noto sans,sans-serif;font-size:16px;}#d1b97b1f9641ee4bflight p{margin:0;}#d1b97b1f9641ee4bflight .label{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,segoe ui,Roboto,helvetica neue,Arial,noto sans,sans-serif;color:#333;}#d1b97b1f9641ee4bflight .cluster-label text{fill:#000000;}#d1b97b1f9641ee4bflight .cluster-label span{color:#000000;}#d1b97b1f9641ee4bflight .cluster-label span p{background-color:transparent;}#d1b97b1f9641ee4bflight .label text,#d1b97b1f9641ee4bflight span{fill:#333;color:#333;}#d1b97b1f9641ee4bflight .node rect,#d1b97b1f9641ee4bflight .node circle,#d1b97b1f9641ee4bflight .node ellipse,#d1b97b1f9641ee4bflight .node polygon,#d1b97b1f9641ee4bflight .node path{fill:rgb(255, 255, 255);stroke:rgb(204, 216, 222);stroke-width:1px;}#d1b97b1f9641ee4bflight .rough-node .label text,#d1b97b1f9641ee4bflight .node .label text,#d1b97b1f9641ee4bflight .image-shape .label,#d1b97b1f9641ee4bflight .icon-shape .label{text-anchor:middle;}#d1b97b1f9641ee4bflight .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#d1b97b1f9641ee4bflight .rough-node .label,#d1b97b1f9641ee4bflight .node .label,#d1b97b1f9641ee4bflight .image-shape .label,#d1b97b1f9641ee4bflight .icon-shape .label{text-align:center;}#d1b97b1f9641ee4bflight .node.clickable{cursor:pointer;}#d1b97b1f9641ee4bflight .root .anchor path{fill:rgb(74, 86, 92)!important;stroke-width:0;stroke:rgb(74, 86, 92);}#d1b97b1f9641ee4bflight .arrowheadPath{fill:#000000;}#d1b97b1f9641ee4bflight .edgePaths .path{stroke:rgb(74, 86, 92);stroke-width:1px;}#d1b97b1f9641ee4bflight .flowchart-link{stroke:rgb(74, 86, 92);fill:none;}#d1b97b1f9641ee4bflight .edgeLabel{background-color:rgb(182, 240, 255);text-align:center;}#d1b97b1f9641ee4bflight .edgeLabel p{background-color:rgb(182, 240, 255);}#d1b97b1f9641ee4bflight .edgeLabel rect{opacity:0.5;background-color:rgb(182, 240, 255);fill:rgb(182, 240, 255);}#d1b97b1f9641ee4bflight .labelBkg{background-color:rgba(182, 240, 255, 0.5);}#d1b97b1f9641ee4bflight .cluster rect{fill:rgb(255, 255, 255);stroke:rgb(129, 146, 154);stroke-width:1px;}#d1b97b1f9641ee4bflight .cluster text{fill:#000000;}#d1b97b1f9641ee4bflight .cluster span{color:#000000;}#d1b97b1f9641ee4bflight .node .collapsed-indicator{fill:rgb(129, 146, 154);stroke:none;opacity:0.6;}#d1b97b1f9641ee4bflight .node .collapsed-separator{stroke:rgb(129, 146, 154);stroke-width:0.75px;}#d1b97b1f9641ee4bflight div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,segoe ui,Roboto,helvetica neue,Arial,noto sans,sans-serif;font-size:12px;background:rgb(255, 255, 255);border:1px solid rgb(129, 146, 154);border-radius:2px;pointer-events:none;z-index:100;}#d1b97b1f9641ee4bflight .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#d1b97b1f9641ee4bflight rect.text{fill:none;stroke-width:0;}#d1b97b1f9641ee4bflight .icon-shape,#d1b97b1f9641ee4bflight .image-shape{background-color:rgb(182, 240, 255);text-align:center;}#d1b97b1f9641ee4bflight .icon-shape p,#d1b97b1f9641ee4bflight .image-shape p{background-color:rgb(182, 240, 255);padding:2px;}#d1b97b1f9641ee4bflight .icon-shape .label rect,#d1b97b1f9641ee4bflight .image-shape .label rect{opacity:0.5;background-color:rgb(182, 240, 255);fill:rgb(182, 240, 255);}#d1b97b1f9641ee4bflight .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#d1b97b1f9641ee4bflight .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#d1b97b1f9641ee4bflight .node .neo-node{stroke:rgb(204, 216, 222);}#d1b97b1f9641ee4bflight [data-look="neo"].node rect,#d1b97b1f9641ee4bflight [data-look="neo"].cluster rect,#d1b97b1f9641ee4bflight [data-look="neo"].node polygon{stroke:url(#d1b97b1f9641ee4bflight-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#d1b97b1f9641ee4bflight [data-look="neo"].swimlane.cluster rect{filter:none;}#d1b97b1f9641ee4bflight [data-look="neo"].node path{stroke:url(#d1b97b1f9641ee4bflight-gradient);stroke-width:1px;}#d1b97b1f9641ee4bflight [data-look="neo"].node .outer-path{filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#d1b97b1f9641ee4bflight [data-look="neo"].node .neo-line path{stroke:rgb(204, 216, 222);filter:none;}#d1b97b1f9641ee4bflight [data-look="neo"].node circle{stroke:url(#d1b97b1f9641ee4bflight-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#d1b97b1f9641ee4bflight [data-look="neo"].node circle .state-start{fill:#000000;}#d1b97b1f9641ee4bflight [data-look="neo"].icon-shape .icon{fill:url(#d1b97b1f9641ee4bflight-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#d1b97b1f9641ee4bflight [data-look="neo"].icon-shape .icon-neo path{stroke:url(#d1b97b1f9641ee4bflight-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#d1b97b1f9641ee4bflight :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}&lt;/style&gt;&lt;g&gt;&lt;marker id="d1b97b1f9641ee4bflight_flowchart-v2-pointEnd" class="marker flowchart-v2" viewBox="0 0 10 10" refX="5" refY="5" markerUnits="userSpaceOnUse" markerWidth="8" markerHeight="8" orient="auto"&gt;&lt;path d="M 0 0 L 10 5 L 0 10 z" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"&gt;&lt;/path&gt;&lt;/marker&gt;&lt;marker id="d1b97b1f9641ee4bflight_flowchart-v2-pointStart" class="marker flowchart-v2" viewBox="0 0 10 10" refX="4.5" refY="5" markerUnits="userSpaceOnUse" markerWidth="8" markerHeight="8" orient="auto"&gt;&lt;path d="M 0 5 L 10 10 L 10 0 z" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"&gt;&lt;/path&gt;&lt;/marker&gt;&lt;marker id="d1b97b1f9641ee4bflight_flowchart-v2-pointEnd-margin" class="marker flowchart-v2" viewBox="0 0 11.5 14" refX="11.5" refY="7" markerUnits="userSpaceOnUse" markerWidth="10.5" markerHeight="14" orient="auto"&gt;&lt;path d="M 0 0 L 11.5 7 L 0 14 z" class="arrowMarkerPath" style="stroke-width: 0; stroke-dasharray: 1, 0;"&gt;&lt;/path&gt;&lt;/marker&gt;&lt;marker id="d1b97b1f9641ee4bflight_flowchart-v2-pointStart-margin" class="marker flowchart-v2" viewBox="0 0 11.5 14" refX="1" refY="7" markerUnits="userSpaceOnUse" markerWidth="11.5" markerHeight="14" orient="auto"&gt;&lt;polygon points="0,7 11.5,14 11.5,0" class="arrowMarkerPath" style="stroke-width: 0; stroke-dasharray: 1, 0;"&gt;&lt;/polygon&gt;&lt;/marker&gt;&lt;marker id="d1b97b1f9641ee4bflight_flowchart-v2-circleEnd" class="marker flowchart-v2" viewBox="0 0 10 10" refX="11" refY="5" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"&gt;&lt;circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"&gt;&lt;/circle&gt;&lt;/marker&gt;&lt;marker id="d1b97b1f9641ee4bflight_flowchart-v2-circleStart" class="marker flowchart-v2" viewBox="0 0 10 10" refX="-1" refY="5" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"&gt;&lt;circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"&gt;&lt;/circle&gt;&lt;/marker&gt;&lt;marker id="d1b97b1f9641ee4bflight_flowchart-v2-circleEnd-margin" class="marker flowchart-v2" viewBox="0 0 10 10" refY="5" refX="12.25" markerUnits="userSpaceOnUse" markerWidth="14" markerHeight="14" orient="auto"&gt;&lt;circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 0; stroke-dasharray: 1, 0;"&gt;&lt;/circle&gt;&lt;/marker&gt;&lt;marker id="d1b97b1f9641ee4bflight_flowchart-v2-circleStart-margin" class="marker flowchart-v2" viewBox="0 0 10 10" refX="-2" refY="5" markerUnits="userSpaceOnUse" markerWidth="14" markerHeight="14" orient="auto"&gt;&lt;circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 0; stroke-dasharray: 1, 0;"&gt;&lt;/circle&gt;&lt;/marker&gt;&lt;marker id="d1b97b1f9641ee4bflight_flowchart-v2-crossEnd" class="marker cross flowchart-v2" viewBox="0 0 11 11" refX="12" refY="5.2" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"&gt;&lt;path d="M 1,1 l 9,9 M 10,1 l -9,9" class="arrowMarkerPath" style="stroke-width: 2; stroke-dasharray: 1, 0;"&gt;&lt;/path&gt;&lt;/marker&gt;&lt;marker id="d1b97b1f9641ee4bflight_flowchart-v2-crossStart" class="marker cross flowchart-v2" viewBox="0 0 11 11" refX="-1" refY="5.2" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"&gt;&lt;path d="M 1,1 l 9,9 M 10,1 l -9,9" class="arrowMarkerPath" style="stroke-width: 2; stroke-dasharray: 1, 0;"&gt;&lt;/path&gt;&lt;/marker&gt;&lt;marker id="d1b97b1f9641ee4bflight_flowchart-v2-crossEnd-margin" class="marker cross flowchart-v2" viewBox="0 0 15 15" refX="17.7" refY="7.5" markerUnits="userSpaceOnUse" markerWidth="12" markerHeight="12" orient="auto"&gt;&lt;path d="M 1,1 L 14,14 M 1,14 L 14,1" class="arrowMarkerPath" style="stroke-width: 2.5;"&gt;&lt;/path&gt;&lt;/marker&gt;&lt;marker id="d1b97b1f9641ee4bflight_flowchart-v2-crossStart-margin" class="marker cross flowchart-v2" viewBox="0 0 15 15" refX="-3.5" refY="7.5" markerUnits="userSpaceOnUse" markerWidth="12" markerHeight="12" orient="auto"&gt;&lt;path d="M 1,1 L 14,14 M 1,14 L 14,1" class="arrowMarkerPath" style="stroke-width: 2.5; stroke-dasharray: 1, 0;"&gt;&lt;/path&gt;&lt;/marker&gt;&lt;g class="root"&gt;&lt;g class="clusters"&gt;&lt;/g&gt;&lt;g class="edges edgePaths"&gt;&lt;path d="M162,132L162,144.92893218813452Q162,152 154.92893218813452,152L95.07106781186548,152Q88,152 88,159.07106781186548L88,180" id="d1b97b1f9641ee4bflight-L_A_B_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style="stroke-dasharray: 0 0 112.67163848876953 4; stroke-dashoffset: 0;;" data-edge="true" data-et="edge" data-id="L_A_B_0" data-points="W3sieCI6MTYyLCJ5IjoxMzJ9LHsieCI6MTYyLCJ5IjoxNTJ9LHsieCI6ODgsInkiOjE1Mn0seyJ4Ijo4OCwieSI6MTg0fV0=" data-look="neo" marker-end="url(#d1b97b1f9641ee4bflight_flowchart-v2-pointEnd-margin)"&gt;&lt;/path&gt;&lt;path d="M206,132L206,144.92893218813452Q206,152 213.07106781186548,152L272.9289321881345,152Q280,152 280,159.07106781186548L280,168" id="d1b97b1f9641ee4bflight-L_A_C_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style="stroke-dasharray: 0 0 100.67166900634766 4; stroke-dashoffset: 0;;" data-edge="true" data-et="edge" data-id="L_A_C_0" data-points="W3sieCI6MjA2LCJ5IjoxMzJ9LHsieCI6MjA2LCJ5IjoxNTJ9LHsieCI6MjgwLCJ5IjoxNTJ9LHsieCI6MjgwLCJ5IjoxNzJ9XQ==" data-look="neo" marker-end="url(#d1b97b1f9641ee4bflight_flowchart-v2-pointEnd-margin)"&gt;&lt;/path&gt;&lt;path d="M88,256L88,328" id="d1b97b1f9641ee4bflight-L_B_D_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style="stroke-dasharray: 0 0 68 4; stroke-dashoffset: 0;;" data-edge="true" data-et="edge" data-id="L_B_D_0" data-points="W3sieCI6ODgsInkiOjI1Nn0seyJ4Ijo4OCwieSI6MzMyfV0=" data-look="neo" marker-end="url(#d1b97b1f9641ee4bflight_flowchart-v2-pointEnd-margin)"&gt;&lt;/path&gt;&lt;path d="M88,404L88,464" id="d1b97b1f9641ee4bflight-L_D_E_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style="stroke-dasharray: 0 0 56 4; stroke-dashoffset: 0;;" data-edge="true" data-et="edge" data-id="L_D_E_0" data-points="W3sieCI6ODgsInkiOjQwNH0seyJ4Ijo4OCwieSI6NDY4fV0=" data-look="neo" marker-end="url(#d1b97b1f9641ee4bflight_flowchart-v2-pointEnd-margin)"&gt;&lt;/path&gt;&lt;path d="M280,268L280,304" id="d1b97b1f9641ee4bflight-L_C_F_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style="stroke-dasharray: 0 0 32 4; stroke-dashoffset: 0;;" data-edge="true" data-et="edge" data-id="L_C_F_0" data-points="W3sieCI6MjgwLCJ5IjoyNjh9LHsieCI6MjgwLCJ5IjozMDh9XQ==" data-look="neo" marker-end="url(#d1b97b1f9641ee4bflight_flowchart-v2-pointEnd-margin)"&gt;&lt;/path&gt;&lt;path d="M280,428L280,464" id="d1b97b1f9641ee4bflight-L_F_G_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style="stroke-dasharray: 0 0 32 4; stroke-dashoffset: 0;;" data-edge="true" data-et="edge" data-id="L_F_G_0" data-points="W3sieCI6MjgwLCJ5Ijo0Mjh9LHsieCI6MjgwLCJ5Ijo0Njh9XQ==" data-look="neo" marker-end="url(#d1b97b1f9641ee4bflight_flowchart-v2-pointEnd-margin)"&gt;&lt;/path&gt;&lt;path d="M280,588L280,624" id="d1b97b1f9641ee4bflight-L_G_H_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style="stroke-dasharray: 0 0 32 4; stroke-dashoffset: 0;;" data-edge="true" data-et="edge" data-id="L_G_H_0" data-points="W3sieCI6MjgwLCJ5Ijo1ODh9LHsieCI6MjgwLCJ5Ijo2Mjh9XQ==" data-look="neo" marker-end="url(#d1b97b1f9641ee4bflight_flowchart-v2-pointEnd-margin)"&gt;&lt;/path&gt;&lt;/g&gt;&lt;g class="edgeLabels"&gt;&lt;/g&gt;&lt;g class="nodes"&gt;&lt;g class="node default" id="d1b97b1f9641ee4bflight-flowchart-A-0" data-look="neo" transform="translate(184, 72)"&gt;&lt;rect class="basic label-container" style="" x="-76" y="-60" width="152" height="120"&gt;&lt;/rect&gt;&lt;g class="label" style="" transform="translate(-60, -48)"&gt;&lt;rect&gt;&lt;/rect&gt;&lt;foreignObject width="120" height="96"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: table; white-space: break-spaces; line-height: 1.5; max-width: 120px; text-align: center; width: 120px;"&gt;&lt;span class="nodeLabel"&gt;&lt;p&gt;the same command:&lt;br&gt;log show ... | wc -l&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="node default" id="d1b97b1f9641ee4bflight-flowchart-B-1" data-look="neo" transform="translate(88, 220)"&gt;&lt;rect class="basic label-container" style="" x="-76" y="-36" width="152" height="72"&gt;&lt;/rect&gt;&lt;g class="label" style="" transform="translate(-60, -24)"&gt;&lt;rect&gt;&lt;/rect&gt;&lt;foreignObject width="120" height="48"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: table; white-space: nowrap; line-height: 1.5; max-width: 120px; text-align: center; width: 120px;"&gt;&lt;span class="nodeLabel"&gt;&lt;p&gt;my terminal&lt;br&gt;(interactive zsh)&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="node default" id="d1b97b1f9641ee4bflight-flowchart-C-3" data-look="neo" transform="translate(280, 220)"&gt;&lt;rect class="basic label-container" style="" x="-76" y="-48" width="152" height="96"&gt;&lt;/rect&gt;&lt;g class="label" style="" transform="translate(-60, -36)"&gt;&lt;rect&gt;&lt;/rect&gt;&lt;foreignObject width="120" height="72"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: table; white-space: break-spaces; line-height: 1.5; max-width: 120px; text-align: center; width: 120px;"&gt;&lt;span class="nodeLabel"&gt;&lt;p&gt;the agent's shell&lt;br&gt;(non-interactive zsh)&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="node default" id="d1b97b1f9641ee4bflight-flowchart-D-5" data-look="neo" transform="translate(88, 368)"&gt;&lt;rect class="basic label-container" style="" x="-76" y="-36" width="152" height="72"&gt;&lt;/rect&gt;&lt;g class="label" style="" transform="translate(-60, -24)"&gt;&lt;rect&gt;&lt;/rect&gt;&lt;foreignObject width="120" height="48"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: table; white-space: nowrap; line-height: 1.5; max-width: 120px; text-align: center; width: 120px;"&gt;&lt;span class="nodeLabel"&gt;&lt;p&gt;/etc/zshrc runs&lt;br&gt;disable log&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="node default" id="d1b97b1f9641ee4bflight-flowchart-E-7" data-look="neo" transform="translate(88, 516)"&gt;&lt;rect class="basic label-container" style="" x="-76" y="-48" width="152" height="96"&gt;&lt;/rect&gt;&lt;g class="label" style="" transform="translate(-60, -36)"&gt;&lt;rect&gt;&lt;/rect&gt;&lt;foreignObject width="120" height="72"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: table; white-space: break-spaces; line-height: 1.5; max-width: 120px; text-align: center; width: 120px;"&gt;&lt;span class="nodeLabel"&gt;&lt;p&gt;/usr/bin/log reads&lt;br&gt;the system log&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="node default" id="d1b97b1f9641ee4bflight-flowchart-F-9" data-look="neo" transform="translate(280, 368)"&gt;&lt;rect class="basic label-container" style="" x="-76" y="-60" width="152" height="120"&gt;&lt;/rect&gt;&lt;g class="label" style="" transform="translate(-60, -48)"&gt;&lt;rect&gt;&lt;/rect&gt;&lt;foreignObject width="120" height="96"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: table; white-space: break-spaces; line-height: 1.5; max-width: 120px; text-align: center; width: 120px;"&gt;&lt;span class="nodeLabel"&gt;&lt;p&gt;/etc/zshrc is skipped,&lt;br&gt;the zsh/watch builtin wins&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="node default" id="d1b97b1f9641ee4bflight-flowchart-G-11" data-look="neo" transform="translate(280, 528)"&gt;&lt;rect class="basic label-container" style="" x="-76" y="-60" width="152" height="120"&gt;&lt;/rect&gt;&lt;g class="label" style="" transform="translate(-60, -48)"&gt;&lt;rect&gt;&lt;/rect&gt;&lt;foreignObject width="120" height="96"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: table; white-space: break-spaces; line-height: 1.5; max-width: 120px; text-align: center; width: 120px;"&gt;&lt;span class="nodeLabel"&gt;&lt;p&gt;too many arguments,&lt;br&gt;exit 1, hidden by wc -l&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="node default" id="d1b97b1f9641ee4bflight-flowchart-H-13" data-look="neo" transform="translate(280, 676)"&gt;&lt;rect class="basic label-container" style="" x="-76" y="-48" width="152" height="96"&gt;&lt;/rect&gt;&lt;g class="label" style="" transform="translate(-60, -36)"&gt;&lt;rect&gt;&lt;/rect&gt;&lt;foreignObject width="120" height="72"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: table; white-space: break-spaces; line-height: 1.5; max-width: 120px; text-align: center; width: 120px;"&gt;&lt;span class="nodeLabel"&gt;&lt;p&gt;the audit reports&lt;br&gt;0 errors&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;defs&gt;&lt;filter id="d1b97b1f9641ee4bflight-drop-shadow" height="130%" width="130%"&gt;&lt;feDropShadow dx="4" dy="4" stdDeviation="0" flood-opacity="0.06" flood-color="#000000"&gt;&lt;/feDropShadow&gt;&lt;/filter&gt;&lt;/defs&gt;&lt;defs&gt;&lt;filter id="d1b97b1f9641ee4bflight-drop-shadow-small" height="150%" width="150%"&gt;&lt;feDropShadow dx="2" dy="2" stdDeviation="0" flood-opacity="0.06" flood-color="#000000"&gt;&lt;/feDropShadow&gt;&lt;/filter&gt;&lt;/defs&gt;&lt;linearGradient id="d1b97b1f9641ee4bflight-gradient" gradientUnits="objectBoundingBox" x1="0%" y1="0%" x2="100%" y2="0%"&gt;&lt;stop offset="0%" stop-color="rgb(204, 216, 222)" stop-opacity="1"&gt;&lt;/stop&gt;&lt;stop offset="100%" stop-color="rgb(28, 209, 255)" stop-opacity="1"&gt;&lt;/stop&gt;&lt;/linearGradient&gt;&lt;/svg&gt;&lt;/div&gt;&#10; &lt;div class="not-prose diagram diagram-dark"&gt;&lt;svg id="d1b97b1f9641ee4bfdark" width="100%" xmlns="http://www.w3.org/2000/svg" class="flowchart" style="max-width: 360px;" viewBox="4 4 360 728" role="graphics-document document" aria-roledescription="flowchart-v2"&gt;&lt;style&gt;#d1b97b1f9641ee4bfdark{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,segoe ui,Roboto,helvetica neue,Arial,noto sans,sans-serif;font-size:16px;fill:#ccc;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#d1b97b1f9641ee4bfdark .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#d1b97b1f9641ee4bfdark .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#d1b97b1f9641ee4bfdark .error-icon{fill:#a44141;}#d1b97b1f9641ee4bfdark .error-text{fill:#ddd;stroke:#ddd;}#d1b97b1f9641ee4bfdark .edge-thickness-normal{stroke-width:1px;}#d1b97b1f9641ee4bfdark .edge-thickness-thick{stroke-width:3.5px;}#d1b97b1f9641ee4bfdark .edge-pattern-solid{stroke-dasharray:0;}#d1b97b1f9641ee4bfdark .edge-thickness-invisible{stroke-width:0;fill:none;}#d1b97b1f9641ee4bfdark .edge-pattern-dashed{stroke-dasharray:3;}#d1b97b1f9641ee4bfdark .edge-pattern-dotted{stroke-dasharray:2;}#d1b97b1f9641ee4bfdark .marker{fill:lightgrey;stroke:lightgrey;}#d1b97b1f9641ee4bfdark .marker.cross{stroke:lightgrey;}#d1b97b1f9641ee4bfdark svg{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,segoe ui,Roboto,helvetica neue,Arial,noto sans,sans-serif;font-size:16px;}#d1b97b1f9641ee4bfdark p{margin:0;}#d1b97b1f9641ee4bfdark .label{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,segoe ui,Roboto,helvetica neue,Arial,noto sans,sans-serif;color:#ccc;}#d1b97b1f9641ee4bfdark .cluster-label text{fill:#F9FFFE;}#d1b97b1f9641ee4bfdark .cluster-label span{color:#F9FFFE;}#d1b97b1f9641ee4bfdark .cluster-label span p{background-color:transparent;}#d1b97b1f9641ee4bfdark .label text,#d1b97b1f9641ee4bfdark span{fill:#ccc;color:#ccc;}#d1b97b1f9641ee4bfdark .node rect,#d1b97b1f9641ee4bfdark .node circle,#d1b97b1f9641ee4bfdark .node ellipse,#d1b97b1f9641ee4bfdark .node polygon,#d1b97b1f9641ee4bfdark .node path{fill:#1f2020;stroke:#ccc;stroke-width:1px;}#d1b97b1f9641ee4bfdark .rough-node .label text,#d1b97b1f9641ee4bfdark .node .label text,#d1b97b1f9641ee4bfdark .image-shape .label,#d1b97b1f9641ee4bfdark .icon-shape .label{text-anchor:middle;}#d1b97b1f9641ee4bfdark .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#d1b97b1f9641ee4bfdark .rough-node .label,#d1b97b1f9641ee4bfdark .node .label,#d1b97b1f9641ee4bfdark .image-shape .label,#d1b97b1f9641ee4bfdark .icon-shape .label{text-align:center;}#d1b97b1f9641ee4bfdark .node.clickable{cursor:pointer;}#d1b97b1f9641ee4bfdark .root .anchor path{fill:lightgrey!important;stroke-width:0;stroke:lightgrey;}#d1b97b1f9641ee4bfdark .arrowheadPath{fill:lightgrey;}#d1b97b1f9641ee4bfdark .edgePaths .path{stroke:lightgrey;stroke-width:1px;}#d1b97b1f9641ee4bfdark .flowchart-link{stroke:lightgrey;fill:none;}#d1b97b1f9641ee4bfdark .edgeLabel{background-color:hsl(0, 0%, 34.4117647059%);text-align:center;}#d1b97b1f9641ee4bfdark .edgeLabel p{background-color:hsl(0, 0%, 34.4117647059%);}#d1b97b1f9641ee4bfdark .edgeLabel rect{opacity:0.5;background-color:hsl(0, 0%, 34.4117647059%);fill:hsl(0, 0%, 34.4117647059%);}#d1b97b1f9641ee4bfdark .labelBkg{background-color:rgba(87.75, 87.75, 87.75, 0.5);}#d1b97b1f9641ee4bfdark .cluster rect{fill:hsl(180, 1.5873015873%, 28.3529411765%);stroke:rgba(255, 255, 255, 0.25);stroke-width:1px;}#d1b97b1f9641ee4bfdark .cluster text{fill:#F9FFFE;}#d1b97b1f9641ee4bfdark .cluster span{color:#F9FFFE;}#d1b97b1f9641ee4bfdark .node .collapsed-indicator{fill:rgba(255, 255, 255, 0.25);stroke:none;opacity:0.6;}#d1b97b1f9641ee4bfdark .node .collapsed-separator{stroke:rgba(255, 255, 255, 0.25);stroke-width:0.75px;}#d1b97b1f9641ee4bfdark div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,segoe ui,Roboto,helvetica neue,Arial,noto sans,sans-serif;font-size:12px;background:hsl(20, 1.5873015873%, 12.3529411765%);border:1px solid rgba(255, 255, 255, 0.25);border-radius:2px;pointer-events:none;z-index:100;}#d1b97b1f9641ee4bfdark .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#ccc;}#d1b97b1f9641ee4bfdark rect.text{fill:none;stroke-width:0;}#d1b97b1f9641ee4bfdark .icon-shape,#d1b97b1f9641ee4bfdark .image-shape{background-color:hsl(0, 0%, 34.4117647059%);text-align:center;}#d1b97b1f9641ee4bfdark .icon-shape p,#d1b97b1f9641ee4bfdark .image-shape p{background-color:hsl(0, 0%, 34.4117647059%);padding:2px;}#d1b97b1f9641ee4bfdark .icon-shape .label rect,#d1b97b1f9641ee4bfdark .image-shape .label rect{opacity:0.5;background-color:hsl(0, 0%, 34.4117647059%);fill:hsl(0, 0%, 34.4117647059%);}#d1b97b1f9641ee4bfdark .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#d1b97b1f9641ee4bfdark .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#d1b97b1f9641ee4bfdark .node .neo-node{stroke:#ccc;}#d1b97b1f9641ee4bfdark [data-look="neo"].node rect,#d1b97b1f9641ee4bfdark [data-look="neo"].cluster rect,#d1b97b1f9641ee4bfdark [data-look="neo"].node polygon{stroke:url(#d1b97b1f9641ee4bfdark-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#d1b97b1f9641ee4bfdark [data-look="neo"].swimlane.cluster rect{filter:none;}#d1b97b1f9641ee4bfdark [data-look="neo"].node path{stroke:url(#d1b97b1f9641ee4bfdark-gradient);stroke-width:1px;}#d1b97b1f9641ee4bfdark [data-look="neo"].node .outer-path{filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#d1b97b1f9641ee4bfdark [data-look="neo"].node .neo-line path{stroke:#ccc;filter:none;}#d1b97b1f9641ee4bfdark [data-look="neo"].node circle{stroke:url(#d1b97b1f9641ee4bfdark-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#d1b97b1f9641ee4bfdark [data-look="neo"].node circle .state-start{fill:#000000;}#d1b97b1f9641ee4bfdark [data-look="neo"].icon-shape .icon{fill:url(#d1b97b1f9641ee4bfdark-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#d1b97b1f9641ee4bfdark [data-look="neo"].icon-shape .icon-neo path{stroke:url(#d1b97b1f9641ee4bfdark-gradient);filter:drop-shadow( 1px 2px 2px rgba(185,185,185,1));}#d1b97b1f9641ee4bfdark :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}&lt;/style&gt;&lt;g&gt;&lt;marker id="d1b97b1f9641ee4bfdark_flowchart-v2-pointEnd" class="marker flowchart-v2" viewBox="0 0 10 10" refX="5" refY="5" markerUnits="userSpaceOnUse" markerWidth="8" markerHeight="8" orient="auto"&gt;&lt;path d="M 0 0 L 10 5 L 0 10 z" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"&gt;&lt;/path&gt;&lt;/marker&gt;&lt;marker id="d1b97b1f9641ee4bfdark_flowchart-v2-pointStart" class="marker flowchart-v2" viewBox="0 0 10 10" refX="4.5" refY="5" markerUnits="userSpaceOnUse" markerWidth="8" markerHeight="8" orient="auto"&gt;&lt;path d="M 0 5 L 10 10 L 10 0 z" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"&gt;&lt;/path&gt;&lt;/marker&gt;&lt;marker id="d1b97b1f9641ee4bfdark_flowchart-v2-pointEnd-margin" class="marker flowchart-v2" viewBox="0 0 11.5 14" refX="11.5" refY="7" markerUnits="userSpaceOnUse" markerWidth="10.5" markerHeight="14" orient="auto"&gt;&lt;path d="M 0 0 L 11.5 7 L 0 14 z" class="arrowMarkerPath" style="stroke-width: 0; stroke-dasharray: 1, 0;"&gt;&lt;/path&gt;&lt;/marker&gt;&lt;marker id="d1b97b1f9641ee4bfdark_flowchart-v2-pointStart-margin" class="marker flowchart-v2" viewBox="0 0 11.5 14" refX="1" refY="7" markerUnits="userSpaceOnUse" markerWidth="11.5" markerHeight="14" orient="auto"&gt;&lt;polygon points="0,7 11.5,14 11.5,0" class="arrowMarkerPath" style="stroke-width: 0; stroke-dasharray: 1, 0;"&gt;&lt;/polygon&gt;&lt;/marker&gt;&lt;marker id="d1b97b1f9641ee4bfdark_flowchart-v2-circleEnd" class="marker flowchart-v2" viewBox="0 0 10 10" refX="11" refY="5" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"&gt;&lt;circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"&gt;&lt;/circle&gt;&lt;/marker&gt;&lt;marker id="d1b97b1f9641ee4bfdark_flowchart-v2-circleStart" class="marker flowchart-v2" viewBox="0 0 10 10" refX="-1" refY="5" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"&gt;&lt;circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 1; stroke-dasharray: 1, 0;"&gt;&lt;/circle&gt;&lt;/marker&gt;&lt;marker id="d1b97b1f9641ee4bfdark_flowchart-v2-circleEnd-margin" class="marker flowchart-v2" viewBox="0 0 10 10" refY="5" refX="12.25" markerUnits="userSpaceOnUse" markerWidth="14" markerHeight="14" orient="auto"&gt;&lt;circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 0; stroke-dasharray: 1, 0;"&gt;&lt;/circle&gt;&lt;/marker&gt;&lt;marker id="d1b97b1f9641ee4bfdark_flowchart-v2-circleStart-margin" class="marker flowchart-v2" viewBox="0 0 10 10" refX="-2" refY="5" markerUnits="userSpaceOnUse" markerWidth="14" markerHeight="14" orient="auto"&gt;&lt;circle cx="5" cy="5" r="5" class="arrowMarkerPath" style="stroke-width: 0; stroke-dasharray: 1, 0;"&gt;&lt;/circle&gt;&lt;/marker&gt;&lt;marker id="d1b97b1f9641ee4bfdark_flowchart-v2-crossEnd" class="marker cross flowchart-v2" viewBox="0 0 11 11" refX="12" refY="5.2" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"&gt;&lt;path d="M 1,1 l 9,9 M 10,1 l -9,9" class="arrowMarkerPath" style="stroke-width: 2; stroke-dasharray: 1, 0;"&gt;&lt;/path&gt;&lt;/marker&gt;&lt;marker id="d1b97b1f9641ee4bfdark_flowchart-v2-crossStart" class="marker cross flowchart-v2" viewBox="0 0 11 11" refX="-1" refY="5.2" markerUnits="userSpaceOnUse" markerWidth="11" markerHeight="11" orient="auto"&gt;&lt;path d="M 1,1 l 9,9 M 10,1 l -9,9" class="arrowMarkerPath" style="stroke-width: 2; stroke-dasharray: 1, 0;"&gt;&lt;/path&gt;&lt;/marker&gt;&lt;marker id="d1b97b1f9641ee4bfdark_flowchart-v2-crossEnd-margin" class="marker cross flowchart-v2" viewBox="0 0 15 15" refX="17.7" refY="7.5" markerUnits="userSpaceOnUse" markerWidth="12" markerHeight="12" orient="auto"&gt;&lt;path d="M 1,1 L 14,14 M 1,14 L 14,1" class="arrowMarkerPath" style="stroke-width: 2.5;"&gt;&lt;/path&gt;&lt;/marker&gt;&lt;marker id="d1b97b1f9641ee4bfdark_flowchart-v2-crossStart-margin" class="marker cross flowchart-v2" viewBox="0 0 15 15" refX="-3.5" refY="7.5" markerUnits="userSpaceOnUse" markerWidth="12" markerHeight="12" orient="auto"&gt;&lt;path d="M 1,1 L 14,14 M 1,14 L 14,1" class="arrowMarkerPath" style="stroke-width: 2.5; stroke-dasharray: 1, 0;"&gt;&lt;/path&gt;&lt;/marker&gt;&lt;g class="root"&gt;&lt;g class="clusters"&gt;&lt;/g&gt;&lt;g class="edges edgePaths"&gt;&lt;path d="M162,132L162,144.92893218813452Q162,152 154.92893218813452,152L95.07106781186548,152Q88,152 88,159.07106781186548L88,180" id="d1b97b1f9641ee4bfdark-L_A_B_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style="stroke-dasharray: 0 0 112.67163848876953 4; stroke-dashoffset: 0;;" data-edge="true" data-et="edge" data-id="L_A_B_0" data-points="W3sieCI6MTYyLCJ5IjoxMzJ9LHsieCI6MTYyLCJ5IjoxNTJ9LHsieCI6ODgsInkiOjE1Mn0seyJ4Ijo4OCwieSI6MTg0fV0=" data-look="neo" marker-end="url(#d1b97b1f9641ee4bfdark_flowchart-v2-pointEnd-margin)"&gt;&lt;/path&gt;&lt;path d="M206,132L206,144.92893218813452Q206,152 213.07106781186548,152L272.9289321881345,152Q280,152 280,159.07106781186548L280,168" id="d1b97b1f9641ee4bfdark-L_A_C_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style="stroke-dasharray: 0 0 100.67166900634766 4; stroke-dashoffset: 0;;" data-edge="true" data-et="edge" data-id="L_A_C_0" data-points="W3sieCI6MjA2LCJ5IjoxMzJ9LHsieCI6MjA2LCJ5IjoxNTJ9LHsieCI6MjgwLCJ5IjoxNTJ9LHsieCI6MjgwLCJ5IjoxNzJ9XQ==" data-look="neo" marker-end="url(#d1b97b1f9641ee4bfdark_flowchart-v2-pointEnd-margin)"&gt;&lt;/path&gt;&lt;path d="M88,256L88,328" id="d1b97b1f9641ee4bfdark-L_B_D_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style="stroke-dasharray: 0 0 68 4; stroke-dashoffset: 0;;" data-edge="true" data-et="edge" data-id="L_B_D_0" data-points="W3sieCI6ODgsInkiOjI1Nn0seyJ4Ijo4OCwieSI6MzMyfV0=" data-look="neo" marker-end="url(#d1b97b1f9641ee4bfdark_flowchart-v2-pointEnd-margin)"&gt;&lt;/path&gt;&lt;path d="M88,404L88,464" id="d1b97b1f9641ee4bfdark-L_D_E_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style="stroke-dasharray: 0 0 56 4; stroke-dashoffset: 0;;" data-edge="true" data-et="edge" data-id="L_D_E_0" data-points="W3sieCI6ODgsInkiOjQwNH0seyJ4Ijo4OCwieSI6NDY4fV0=" data-look="neo" marker-end="url(#d1b97b1f9641ee4bfdark_flowchart-v2-pointEnd-margin)"&gt;&lt;/path&gt;&lt;path d="M280,268L280,304" id="d1b97b1f9641ee4bfdark-L_C_F_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style="stroke-dasharray: 0 0 32 4; stroke-dashoffset: 0;;" data-edge="true" data-et="edge" data-id="L_C_F_0" data-points="W3sieCI6MjgwLCJ5IjoyNjh9LHsieCI6MjgwLCJ5IjozMDh9XQ==" data-look="neo" marker-end="url(#d1b97b1f9641ee4bfdark_flowchart-v2-pointEnd-margin)"&gt;&lt;/path&gt;&lt;path d="M280,428L280,464" id="d1b97b1f9641ee4bfdark-L_F_G_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style="stroke-dasharray: 0 0 32 4; stroke-dashoffset: 0;;" data-edge="true" data-et="edge" data-id="L_F_G_0" data-points="W3sieCI6MjgwLCJ5Ijo0Mjh9LHsieCI6MjgwLCJ5Ijo0Njh9XQ==" data-look="neo" marker-end="url(#d1b97b1f9641ee4bfdark_flowchart-v2-pointEnd-margin)"&gt;&lt;/path&gt;&lt;path d="M280,588L280,624" id="d1b97b1f9641ee4bfdark-L_G_H_0" class="edge-thickness-normal edge-pattern-solid edge-thickness-normal edge-pattern-solid flowchart-link" style="stroke-dasharray: 0 0 32 4; stroke-dashoffset: 0;;" data-edge="true" data-et="edge" data-id="L_G_H_0" data-points="W3sieCI6MjgwLCJ5Ijo1ODh9LHsieCI6MjgwLCJ5Ijo2Mjh9XQ==" data-look="neo" marker-end="url(#d1b97b1f9641ee4bfdark_flowchart-v2-pointEnd-margin)"&gt;&lt;/path&gt;&lt;/g&gt;&lt;g class="edgeLabels"&gt;&lt;/g&gt;&lt;g class="nodes"&gt;&lt;g class="node default" id="d1b97b1f9641ee4bfdark-flowchart-A-0" data-look="neo" transform="translate(184, 72)"&gt;&lt;rect class="basic label-container" style="" x="-76" y="-60" width="152" height="120"&gt;&lt;/rect&gt;&lt;g class="label" style="" transform="translate(-60, -48)"&gt;&lt;rect&gt;&lt;/rect&gt;&lt;foreignObject width="120" height="96"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: table; white-space: break-spaces; line-height: 1.5; max-width: 120px; text-align: center; width: 120px;"&gt;&lt;span class="nodeLabel"&gt;&lt;p&gt;the same command:&lt;br&gt;log show ... | wc -l&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="node default" id="d1b97b1f9641ee4bfdark-flowchart-B-1" data-look="neo" transform="translate(88, 220)"&gt;&lt;rect class="basic label-container" style="" x="-76" y="-36" width="152" height="72"&gt;&lt;/rect&gt;&lt;g class="label" style="" transform="translate(-60, -24)"&gt;&lt;rect&gt;&lt;/rect&gt;&lt;foreignObject width="120" height="48"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: table; white-space: nowrap; line-height: 1.5; max-width: 120px; text-align: center; width: 120px;"&gt;&lt;span class="nodeLabel"&gt;&lt;p&gt;my terminal&lt;br&gt;(interactive zsh)&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="node default" id="d1b97b1f9641ee4bfdark-flowchart-C-3" data-look="neo" transform="translate(280, 220)"&gt;&lt;rect class="basic label-container" style="" x="-76" y="-48" width="152" height="96"&gt;&lt;/rect&gt;&lt;g class="label" style="" transform="translate(-60, -36)"&gt;&lt;rect&gt;&lt;/rect&gt;&lt;foreignObject width="120" height="72"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: table; white-space: break-spaces; line-height: 1.5; max-width: 120px; text-align: center; width: 120px;"&gt;&lt;span class="nodeLabel"&gt;&lt;p&gt;the agent's shell&lt;br&gt;(non-interactive zsh)&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="node default" id="d1b97b1f9641ee4bfdark-flowchart-D-5" data-look="neo" transform="translate(88, 368)"&gt;&lt;rect class="basic label-container" style="" x="-76" y="-36" width="152" height="72"&gt;&lt;/rect&gt;&lt;g class="label" style="" transform="translate(-60, -24)"&gt;&lt;rect&gt;&lt;/rect&gt;&lt;foreignObject width="120" height="48"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: table; white-space: nowrap; line-height: 1.5; max-width: 120px; text-align: center; width: 120px;"&gt;&lt;span class="nodeLabel"&gt;&lt;p&gt;/etc/zshrc runs&lt;br&gt;disable log&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="node default" id="d1b97b1f9641ee4bfdark-flowchart-E-7" data-look="neo" transform="translate(88, 516)"&gt;&lt;rect class="basic label-container" style="" x="-76" y="-48" width="152" height="96"&gt;&lt;/rect&gt;&lt;g class="label" style="" transform="translate(-60, -36)"&gt;&lt;rect&gt;&lt;/rect&gt;&lt;foreignObject width="120" height="72"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: table; white-space: break-spaces; line-height: 1.5; max-width: 120px; text-align: center; width: 120px;"&gt;&lt;span class="nodeLabel"&gt;&lt;p&gt;/usr/bin/log reads&lt;br&gt;the system log&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="node default" id="d1b97b1f9641ee4bfdark-flowchart-F-9" data-look="neo" transform="translate(280, 368)"&gt;&lt;rect class="basic label-container" style="" x="-76" y="-60" width="152" height="120"&gt;&lt;/rect&gt;&lt;g class="label" style="" transform="translate(-60, -48)"&gt;&lt;rect&gt;&lt;/rect&gt;&lt;foreignObject width="120" height="96"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: table; white-space: break-spaces; line-height: 1.5; max-width: 120px; text-align: center; width: 120px;"&gt;&lt;span class="nodeLabel"&gt;&lt;p&gt;/etc/zshrc is skipped,&lt;br&gt;the zsh/watch builtin wins&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="node default" id="d1b97b1f9641ee4bfdark-flowchart-G-11" data-look="neo" transform="translate(280, 528)"&gt;&lt;rect class="basic label-container" style="" x="-76" y="-60" width="152" height="120"&gt;&lt;/rect&gt;&lt;g class="label" style="" transform="translate(-60, -48)"&gt;&lt;rect&gt;&lt;/rect&gt;&lt;foreignObject width="120" height="96"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: table; white-space: break-spaces; line-height: 1.5; max-width: 120px; text-align: center; width: 120px;"&gt;&lt;span class="nodeLabel"&gt;&lt;p&gt;too many arguments,&lt;br&gt;exit 1, hidden by wc -l&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;g class="node default" id="d1b97b1f9641ee4bfdark-flowchart-H-13" data-look="neo" transform="translate(280, 676)"&gt;&lt;rect class="basic label-container" style="" x="-76" y="-48" width="152" height="96"&gt;&lt;/rect&gt;&lt;g class="label" style="" transform="translate(-60, -36)"&gt;&lt;rect&gt;&lt;/rect&gt;&lt;foreignObject width="120" height="72"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml" style="display: table; white-space: break-spaces; line-height: 1.5; max-width: 120px; text-align: center; width: 120px;"&gt;&lt;span class="nodeLabel"&gt;&lt;p&gt;the audit reports&lt;br&gt;0 errors&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/foreignObject&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;/g&gt;&lt;defs&gt;&lt;filter id="d1b97b1f9641ee4bfdark-drop-shadow" height="130%" width="130%"&gt;&lt;feDropShadow dx="4" dy="4" stdDeviation="0" flood-opacity="0.06" flood-color="#FFFFFF"&gt;&lt;/feDropShadow&gt;&lt;/filter&gt;&lt;/defs&gt;&lt;defs&gt;&lt;filter id="d1b97b1f9641ee4bfdark-drop-shadow-small" height="150%" width="150%"&gt;&lt;feDropShadow dx="2" dy="2" stdDeviation="0" flood-opacity="0.06" flood-color="#FFFFFF"&gt;&lt;/feDropShadow&gt;&lt;/filter&gt;&lt;/defs&gt;&lt;linearGradient id="d1b97b1f9641ee4bfdark-gradient" gradientUnits="objectBoundingBox" x1="0%" y1="0%" x2="100%" y2="0%"&gt;&lt;stop offset="0%" stop-color="#cccccc" stop-opacity="1"&gt;&lt;/stop&gt;&lt;stop offset="100%" stop-color="hsl(180, 0%, 18.3529411765%)" stop-opacity="1"&gt;&lt;/stop&gt;&lt;/linearGradient&gt;&lt;/svg&gt;&lt;/div&gt;&#10;&lt;p&gt;I checked this from inside the agent&amp;rsquo;s own shell while writing this post:&lt;/p&gt;&#10;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-console" data-lang="console"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="gp"&gt;$&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;interactive? &lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;&lt;span class="o"&gt;[[&lt;/span&gt; -o interactive &lt;span class="o"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; yes &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; no&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;interactive? no&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="gp"&gt;$&lt;/span&gt; whence -w log ps ls&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;log: builtin&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;ps: alias&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="go"&gt;ls: alias&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;p&gt;The two shells share my aliases and functions, because the agent&amp;rsquo;s shell&#10;loads a snapshot of them. They do not share the system file that cleans up&#10;the &lt;code&gt;log&lt;/code&gt; name, and that one missing line is the whole difference between&#10;a log reader and a list of logged-in users.&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;Right exit code, wrong answer&#10; &lt;div id="right-exit-code-wrong-answer" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#right-exit-code-wrong-answer" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;Once I knew to look, &lt;code&gt;log&lt;/code&gt; was not alone. Two of my aliases shadow real&#10;commands in both shells, and they fail in different ways:&lt;/p&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Name&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;What it really is&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Failure&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Exit code&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;log&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;zsh/watch builtin (agent shell only)&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;prints &amp;ldquo;too many arguments&amp;rdquo;, output empty&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;1, hidden by the pipeline&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;ps -Ao ...&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;alias to procs&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;rejects the option loudly&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;ps aux&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;alias to procs&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;treats &lt;code&gt;aux&lt;/code&gt; as a search keyword&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;0, with the wrong rows&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;ls -t *.log&lt;/code&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;alias to eza&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;code&gt;-t&lt;/code&gt; takes a field name and eats the first file&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;The &lt;code&gt;ps aux&lt;/code&gt; row is the one I am most wary of. procs treats any extra word&#10;as a keyword to match against user and command names, so &lt;code&gt;aux&lt;/code&gt; becomes a&#10;filter instead of a set of flags. On the night of the original audit, it&#10;returned 4 rows where &lt;code&gt;/bin/ps aux&lt;/code&gt; returned 943. Today, from the agent&amp;rsquo;s&#10;shell, it is 12 rows against 935. The exit code is 0 both times.&lt;/p&gt;&#10;&lt;p&gt;A loud failure like &lt;code&gt;ps -Ao&lt;/code&gt; costs me a minute. A quiet one with the right&#10;exit code goes straight into a report as a fact.&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;The same bug, inside the suite meant to catch it&#10; &lt;div id="the-same-bug-inside-the-suite-meant-to-catch-it" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#the-same-bug-inside-the-suite-meant-to-catch-it" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;After writing the rule down, I went looking for the same shape in my own&#10;test suite, and it was already there:&lt;/p&gt;&#10;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# passed for every possible Brewfile, valid or not&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;brew bundle check --file&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$BREWFILE&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; head -1&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;p&gt;My test runner judges a check by its exit status, and this pipeline&amp;rsquo;s status&#10;belongs to &lt;code&gt;head -1&lt;/code&gt;, which succeeds as long as it can print a line. So the&#10;check passed no matter what the Brewfile contained. It now uses&#10;&lt;code&gt;brew bundle list&lt;/code&gt;, which fails on a syntax error and stays quiet about&#10;packages that are simply not installed yet. That second property matters,&#10;because otherwise CI would go red for roughly 280 packages it never&#10;installs.&lt;/p&gt;&#10;&lt;p&gt;The rule I wrote about all this was also wrong, twice, before review caught&#10;it. My first draft said the &lt;code&gt;log&lt;/code&gt; builtin exits 0. It exits 1, which is&#10;exactly why &lt;code&gt;pipefail&lt;/code&gt; catches it. The draft also implied the builtin&#10;shadows &lt;code&gt;log&lt;/code&gt; at my prompt, which it does not. I had written a rule about&#10;trusting unverified output, and I had not run the commands in the rule.&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;What I do now&#10; &lt;div id="what-i-do-now" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#what-i-do-now" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;I spell it &lt;code&gt;/usr/bin/log&lt;/code&gt;, every time, in scripts and in anything an agent&#10;will run.&lt;/li&gt;&#10;&lt;li&gt;Scripts that count lines set &lt;code&gt;pipefail&lt;/code&gt;, and they also check that the&#10;command produced output at all before they trust a count of zero.&lt;/li&gt;&#10;&lt;li&gt;Before trusting output that looks empty, I check what the name resolves to&#10;in the shell that ran it, with &lt;code&gt;whence -w&lt;/code&gt; or &lt;code&gt;which -a&lt;/code&gt;, not in my own&#10;terminal.&lt;/li&gt;&#10;&lt;li&gt;My agent instructions now list these shadowed names explicitly, with the&#10;row counts above as the example, so the next audit starts from the&#10;full path instead of rediscovering this.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;h2 class="relative group"&gt;Lessons&#10; &lt;div id="lessons" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#lessons" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;A pipeline reports its last command&amp;rsquo;s exit status. Anything earlier in the&#10;chain can fail silently behind a &lt;code&gt;wc -l&lt;/code&gt; or a &lt;code&gt;head -1&lt;/code&gt;.&lt;/li&gt;&#10;&lt;li&gt;Your agent&amp;rsquo;s shell is not your terminal. It skips the interactive startup&#10;files, so names your terminal has fixed can still mean something else&#10;there.&lt;/li&gt;&#10;&lt;li&gt;&amp;ldquo;It works when I type it&amp;rdquo; is evidence about your shell only. Reproduce in&#10;the shell that actually ran the command.&lt;/li&gt;&#10;&lt;li&gt;When a check can only fail quietly, give it a second check on its output.&#10;An exit code of 0 says the last command was happy, nothing more.&lt;/li&gt;&#10;&lt;li&gt;A count of zero is a claim. Before writing it down, show that the query&#10;produced output under a broader filter.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;h2 class="relative group"&gt;References&#10; &lt;div id="references" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#references" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="https://zsh.sourceforge.io/Doc/Release/Zsh-Modules.html#The-zsh_002fwatch-Module" target="_blank" rel="noreferrer"&gt;zsh manual: the zsh/watch module&lt;/a&gt;&#10;(the &lt;code&gt;log&lt;/code&gt; builtin, which lists logged-in users)&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://zsh.sourceforge.io/Doc/Release/Options.html" target="_blank" rel="noreferrer"&gt;zsh manual: options, &lt;code&gt;PIPE_FAIL&lt;/code&gt;&lt;/a&gt;&#10;(a pipeline&amp;rsquo;s status is its rightmost element&amp;rsquo;s by default)&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://github.com/dalance/procs" target="_blank" rel="noreferrer"&gt;procs&lt;/a&gt; (non-numeric arguments are&#10;matched as keywords against user and command)&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;log(1)&lt;/code&gt; on macOS for the real &lt;code&gt;/usr/bin/log&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;The rule and the fixed checks: &lt;a href="https://github.com/nickboy/dotfiles" target="_blank" rel="noreferrer"&gt;nickboy/dotfiles&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;</content:encoded></item></channel></rss>