<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Guangyi Zhao</title>
    <description>The latest articles on DEV Community by Guangyi Zhao (@ezrazhao).</description>
    <link>https://dev.to/ezrazhao</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4167549%2F163ceacd-453a-4419-ab24-108176eb332d.jpg</url>
      <title>DEV Community: Guangyi Zhao</title>
      <link>https://dev.to/ezrazhao</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ezrazhao"/>
    <language>en</language>
    <item>
      <title>The Total Was Right and the Structure Was Wrong: Stress-Testing a Flower-Counting Pipeline Against Light and Occlusion</title>
      <dc:creator>Guangyi Zhao</dc:creator>
      <pubDate>Sun, 15 Nov 2026 02:31:07 +0000</pubDate>
      <link>https://dev.to/ezrazhao/the-total-was-right-and-the-structure-was-wrong-stress-testing-a-flower-counting-pipeline-against-fgg</link>
      <guid>https://dev.to/ezrazhao/the-total-was-right-and-the-structure-was-wrong-stress-testing-a-flower-counting-pipeline-against-fgg</guid>
      <description>&lt;h2&gt;
  
  
  1. The problem
&lt;/h2&gt;

&lt;p&gt;A crop-counting pipeline does not deliver one number. For yield estimates and labor scheduling, a grower needs two: how many flowers have opened, and how many buds are still closed. The first drives this week's harvest, the second next week's. The real deliverable is the split, not the sum.&lt;/p&gt;

&lt;p&gt;My open-source project Bloom-Counter does exactly this: photos in, HSV color segmentation plus contour analysis out, with per-image bloom and bud counts aggregated by region and date. Its README carries a handsome scorecard: 6 simulated photos, 357 flowers, 99.7% detection recall. This article starts from an uncomfortable claim: that 99.7% proves nothing. Two reasons, both sitting in the code for anyone to check.&lt;/p&gt;

&lt;p&gt;First, the simulator and the detector were tuned to each other. A comment on line 23 of &lt;code&gt;simulator/generate.py&lt;/code&gt; says it plainly: the flower colors in BGR are "tuned to sit inside the detector's HSV petal ranges." The generator paints flowers to the detector's taste; the detector then counts them. A perfect score is structural.&lt;/p&gt;

&lt;p&gt;Second, the simulator's &lt;code&gt;_place&lt;/code&gt; function uses rejection sampling to guarantee that no two flowers ever overlap, and the demo's scoring in &lt;code&gt;examples/demo.py&lt;/code&gt; is (detected blooms + buds) / (true blooms + buds) — totals only, no per-object matching, no per-class breakdown.&lt;/p&gt;

&lt;p&gt;A real greenhouse inverts both assumptions: light swings across the day, leaves occlude as a matter of course, and flowers grow in clusters. So I took the unmodified detector and systematically broke the simulator's two hidden assumptions, measuring how it fails first, how badly, and whether two cheap remedies actually help.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Method
&lt;/h2&gt;

&lt;p&gt;Detector: the stock &lt;code&gt;ColorSegmentationDetector&lt;/code&gt; (&lt;code&gt;detector/color_segmentation.py&lt;/code&gt;), parameters untouched: &lt;code&gt;min_area=120&lt;/code&gt; px², &lt;code&gt;bloom_area_min=900&lt;/code&gt; px² (a connected component at or above 900 px² counts as a bloom, below it as a bud), morphology kernel 7. It thresholds pink, white, and yellow petal ranges in HSV, applies closing and opening, then counts components.&lt;/p&gt;

&lt;p&gt;Scenes: four 1280×960 images from the repo's own simulator (seeds 101/202/303/404), 210 objects in total: 134 blooms, 76 buds, each with a ground-truth center and radius.&lt;/p&gt;

&lt;p&gt;Scoring: not the totals ratio. Greedy center-distance matching — a detection counts as a hit only if its center lands within max(38 px, 1.1 × radius) of a ground-truth object of the same label — yielding precision, recall, and F1, with bloom recall and bud recall reported separately, micro-averaged over the four scenes. Sanity check first: on the untouched scenes this stricter scoring still returns precision = recall = F1 = 1.000 with zero false positives. The baseline is perfect because the pair is co-tuned, which is the point.&lt;/p&gt;

&lt;p&gt;Two stress groups:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lighting: parametric whole-image transforms standing in for time-of-day and weather: gamma 0.6 / 1.6 / 2.2, exposure −50 (α=0.78, β=−50) and overexposure +60 (α=1.25, β=+60), a left-to-right shadow gradient (0.35→1.0), a half-frame shadow (left 45% at ×0.40), a warm color cast (B×0.72, R×1.18), and low light (gamma 1.9 plus Gaussian noise σ=12).&lt;/li&gt;
&lt;li&gt;Occlusion: leaf-colored ellipses painted over 60% of objects at their true centers, with radius 0.5 / 0.8 / 1.1 × the object's radius; and extra blooms drawn beside existing ones at offsets of 2.2 / 1.6 / 1.2 / 0.8 / 0.45 × radius (+10 blooms per scene, true blooms rising to 174) to simulate clustering.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Two remedies: gray-world white balance followed by CLAHE on the V channel as preprocessing; and an area-based split estimator that, for bloom components much larger than the median single-bloom box area (5,889.5 px² in this batch), adds counts proportional to area.&lt;/p&gt;

&lt;p&gt;Raw data and scripts: &lt;code&gt;data/2026-10-17-bloom-bench.json&lt;/code&gt; and &lt;code&gt;data/2026-10-17-bloom-bench.py&lt;/code&gt;, reproducible with one command in the repo's virtualenv.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Results
&lt;/h2&gt;

&lt;h3&gt;
  
  
  3.1 Lighting: demotion before disappearance
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Condition&lt;/th&gt;
&lt;th&gt;Recall&lt;/th&gt;
&lt;th&gt;Bloom recall&lt;/th&gt;
&lt;th&gt;Bud recall&lt;/th&gt;
&lt;th&gt;Blooms found / 134&lt;/th&gt;
&lt;th&gt;Buds found / 76&lt;/th&gt;
&lt;th&gt;Total error&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Clean&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;134&lt;/td&gt;
&lt;td&gt;76&lt;/td&gt;
&lt;td&gt;0.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gamma 0.6 (brighter)&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;134&lt;/td&gt;
&lt;td&gt;76&lt;/td&gt;
&lt;td&gt;0.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gamma 1.6 (darker)&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;134&lt;/td&gt;
&lt;td&gt;76&lt;/td&gt;
&lt;td&gt;0.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Low light, gamma 1.9 + noise&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;134&lt;/td&gt;
&lt;td&gt;76&lt;/td&gt;
&lt;td&gt;0.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gamma 2.2 (much darker)&lt;/td&gt;
&lt;td&gt;0.576&lt;/td&gt;
&lt;td&gt;0.336&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;45&lt;/td&gt;
&lt;td&gt;179&lt;/td&gt;
&lt;td&gt;+6.7%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Exposure −50&lt;/td&gt;
&lt;td&gt;0.810&lt;/td&gt;
&lt;td&gt;0.702&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;94&lt;/td&gt;
&lt;td&gt;116&lt;/td&gt;
&lt;td&gt;0.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Overexposure +60&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;135&lt;/td&gt;
&lt;td&gt;90&lt;/td&gt;
&lt;td&gt;+7.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Shadow gradient 0.35→1.0&lt;/td&gt;
&lt;td&gt;0.895&lt;/td&gt;
&lt;td&gt;0.836&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;112&lt;/td&gt;
&lt;td&gt;98&lt;/td&gt;
&lt;td&gt;0.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Half-frame shadow ×0.40&lt;/td&gt;
&lt;td&gt;0.905&lt;/td&gt;
&lt;td&gt;0.851&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;114&lt;/td&gt;
&lt;td&gt;96&lt;/td&gt;
&lt;td&gt;0.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Warm cast&lt;/td&gt;
&lt;td&gt;0.638&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;0.000&lt;/td&gt;
&lt;td&gt;135&lt;/td&gt;
&lt;td&gt;25&lt;/td&gt;
&lt;td&gt;−23.8%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Look at exposure −50 and the two shadow conditions: total error 0.0%. Under the repo demo's scoring, all three are perfect runs. Yet a quarter to a sixth of the blooms are gone, and twenty-odd phantom buds appeared. Splitting the first half-shadow scene makes it vivid: of 20 objects inside the shadow, 70% were recovered; of 28 in the light, all of them.&lt;/p&gt;

&lt;p&gt;The mechanism is easy to trace. Dimming eats the petal mask from the edges first: V falls below the pink range's floor, the mask shrinks, and the component's area shrinks with it. Once area crosses below the 900 px² line, the object does not vanish — it is reclassified as a bud. This classifier demotes before it deletes: at gamma 2.2 only 45 blooms remain while "buds" swell to 179, and the total is off by just +6.7%.&lt;/p&gt;

&lt;p&gt;The warm cast fails in the opposite direction. Blooms survive intact (white and yellow ranges back them up), but bud recall goes to exactly zero: buds exist in only one color range, pink, and the cast pushes their hue out of it. All 76 buds disappear; the 25 detected "buds" are fragment false positives.&lt;/p&gt;

&lt;p&gt;Overexposure fails differently again: recall holds at 1.000 but precision drops to 0.933, with 15 false positives — washed-out leaf fragments impersonating buds. Getting brighter does not lose objects; it manufactures them.&lt;/p&gt;

&lt;p&gt;The good news is real, too: gamma 0.6 brightening, darkening up to gamma 1.6, and low light with noise leave the detector untouched. Its robust zone is wider than I expected. Between the intact 1.9 run and the collapsed 2.2 run the failure threshold sits somewhere in that interval — but sampling is sparse, and the 1.9 run also carried noise rather than being a pure gamma control, so I cannot pin the cliff down.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.2 Preprocessing: fixes global shifts, breaks clipped and noisy images
&lt;/h3&gt;

&lt;p&gt;Gray-world white balance plus CLAHE on V splits cleanly by failure type (false positives below are totals across the four scenes):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Condition&lt;/th&gt;
&lt;th&gt;Recall before&lt;/th&gt;
&lt;th&gt;Recall after&lt;/th&gt;
&lt;th&gt;F1 after&lt;/th&gt;
&lt;th&gt;Cost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Gamma 2.2&lt;/td&gt;
&lt;td&gt;0.576&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;0.981&lt;/td&gt;
&lt;td&gt;8 FP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Warm cast&lt;/td&gt;
&lt;td&gt;0.638&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;0.961&lt;/td&gt;
&lt;td&gt;17 FP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Shadow gradient&lt;/td&gt;
&lt;td&gt;0.895&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;0.963&lt;/td&gt;
&lt;td&gt;16 FP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Half-frame shadow&lt;/td&gt;
&lt;td&gt;0.905&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;0.959&lt;/td&gt;
&lt;td&gt;18 FP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Gamma 1.6 (was perfect)&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;0.970&lt;/td&gt;
&lt;td&gt;13 FP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Overexposure +60&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;0.319&lt;/td&gt;
&lt;td&gt;0.404&lt;/td&gt;
&lt;td&gt;Recall collapse&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Low light + noise (was perfect)&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;0.991&lt;/td&gt;
&lt;td&gt;0.726&lt;/td&gt;
&lt;td&gt;155 FP&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For global brightness and hue shifts the pipeline recovers almost everything. It is not free: on images that were already fine it invents 13–18 phantom buds. On overexposed images the highlights are clipped — the information is gone — and recall falls from perfect to 0.319. On the noisy low-light image it produces 155 false buds. One honest caveat: white balance and CLAHE were tested as one pipelined package, never ablated separately, so I cannot say which step does the damage in the bad cases. The operational conclusion stands either way: gate the preprocessing. Measure the frame first (mean luminance, cast statistics); turn it on only when a global shift is actually present.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.3 Occlusion: small targets die first, and fragments impersonate buds
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Cover radius&lt;/th&gt;
&lt;th&gt;Covered recall&lt;/th&gt;
&lt;th&gt;Uncovered recall&lt;/th&gt;
&lt;th&gt;Bloom recall&lt;/th&gt;
&lt;th&gt;Bud recall&lt;/th&gt;
&lt;th&gt;FP&lt;/th&gt;
&lt;th&gt;Total error&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0.5 × radius&lt;/td&gt;
&lt;td&gt;0.690&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;0.382&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;−20.5%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.8 × radius&lt;/td&gt;
&lt;td&gt;0.207&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;0.530&lt;/td&gt;
&lt;td&gt;0.290&lt;/td&gt;
&lt;td&gt;287&lt;/td&gt;
&lt;td&gt;+81.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1.1 × radius&lt;/td&gt;
&lt;td&gt;0.014&lt;/td&gt;
&lt;td&gt;1.000&lt;/td&gt;
&lt;td&gt;0.321&lt;/td&gt;
&lt;td&gt;0.290&lt;/td&gt;
&lt;td&gt;98&lt;/td&gt;
&lt;td&gt;−22.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;At half-radius cover, every uncovered object is still found, but 31% of covered ones are gone — and buds take the hit. A bud's radius is only 11–17 px; cover its center and the surviving fragments fall below &lt;code&gt;min_area=120&lt;/code&gt; and are discarded as noise. Blooms, being larger, keep a ring of petals and survive the same treatment.&lt;/p&gt;

&lt;p&gt;At 0.8 × radius comes the strangest number in this study: total error +81%. Occlusion does not only delete; it creates. A partly covered bloom breaks into fragments, each landing in the 120–900 px² band, each booked as a bud: 297 buds detected against 76 real. A heavily leafed photo will undercount blooms and overcount buds at the same time — and the overcount is the bigger error.&lt;/p&gt;

&lt;p&gt;One parameter ablation: dropping &lt;code&gt;min_area&lt;/code&gt; from 120 to 40.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Cover&lt;/th&gt;
&lt;th&gt;min_area&lt;/th&gt;
&lt;th&gt;Recall&lt;/th&gt;
&lt;th&gt;Precision&lt;/th&gt;
&lt;th&gt;Bud recall&lt;/th&gt;
&lt;th&gt;FP&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0.5 ×&lt;/td&gt;
&lt;td&gt;120&lt;/td&gt;
&lt;td&gt;0.776&lt;/td&gt;
&lt;td&gt;0.976&lt;/td&gt;
&lt;td&gt;0.382&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.5 ×&lt;/td&gt;
&lt;td&gt;40&lt;/td&gt;
&lt;td&gt;0.981&lt;/td&gt;
&lt;td&gt;0.808&lt;/td&gt;
&lt;td&gt;0.947&lt;/td&gt;
&lt;td&gt;49&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.8 ×&lt;/td&gt;
&lt;td&gt;120&lt;/td&gt;
&lt;td&gt;0.443&lt;/td&gt;
&lt;td&gt;0.245&lt;/td&gt;
&lt;td&gt;0.290&lt;/td&gt;
&lt;td&gt;287&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.8 ×&lt;/td&gt;
&lt;td&gt;40&lt;/td&gt;
&lt;td&gt;0.510&lt;/td&gt;
&lt;td&gt;0.226&lt;/td&gt;
&lt;td&gt;0.474&lt;/td&gt;
&lt;td&gt;366&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Under light cover, lowering the floor genuinely rescues buds — at ten times the false positives, flipping total error from −20.5% to +21.4%. Under heavy cover it buys almost nothing and adds fragments. It is a precision-for-recall trade that only pays in the light-occlusion regime, not a fix (script: &lt;code&gt;data/2026-10-17-bloom-minarea-ablation.py&lt;/code&gt;, results merged into the same raw data file).&lt;/p&gt;

&lt;h3&gt;
  
  
  3.4 Overlap: clustering always undercounts; area-splitting works in one band
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Offset&lt;/th&gt;
&lt;th&gt;Blooms found / 174&lt;/th&gt;
&lt;th&gt;Raw error&lt;/th&gt;
&lt;th&gt;After split correction&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2.2 × radius&lt;/td&gt;
&lt;td&gt;139&lt;/td&gt;
&lt;td&gt;−35&lt;/td&gt;
&lt;td&gt;+27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1.6 × radius&lt;/td&gt;
&lt;td&gt;117&lt;/td&gt;
&lt;td&gt;−57&lt;/td&gt;
&lt;td&gt;+20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1.2 × radius&lt;/td&gt;
&lt;td&gt;120&lt;/td&gt;
&lt;td&gt;−54&lt;/td&gt;
&lt;td&gt;+10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.8 × radius&lt;/td&gt;
&lt;td&gt;125&lt;/td&gt;
&lt;td&gt;−49&lt;/td&gt;
&lt;td&gt;−4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;0.45 × radius&lt;/td&gt;
&lt;td&gt;132&lt;/td&gt;
&lt;td&gt;−42&lt;/td&gt;
&lt;td&gt;−11&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Once two blooms touch, morphological closing welds them into one component, and every offset undercounts by 42–57 blooms. Area-splitting genuinely helps in the 0.8–1.2 × band (−49 → −4, −54 → +10). At wider offsets it overcorrects (+27 at 2.2 ×). The overcorrection is mostly the estimator's own doing: it rescales every bloom box by area, and single-bloom radius naturally varies from 30 to 49 px, so a large lone bloom gets rounded up into "one and a half." The wider the offset, the less true merging there is, and the more this systematic inflation dominates. A second confound: at 2.2 × offset in these dense scenes, the added bloom often lands on a third flower, so the raw −35 at that end mixes three-way merges and is not a clean pairwise reading.&lt;/p&gt;

&lt;p&gt;Combined stress (gamma 1.6 plus 0.8 × leaf cover) leaves recall at 0.429; preprocessing lifts it only to 0.500. Preprocessing repairs global shifts. It cannot repair something physically hidden, and that boundary deserves to be stated plainly.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. What I take from this
&lt;/h2&gt;

&lt;p&gt;Four things a practitioner can lift directly:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Acceptance metrics for a counting pipeline must be per-class, per-object matched precision/recall, plus an explicit error on the bloom-to-bud ratio. Totals alone certified three conditions in my runs as 0.0% error while a sixth to a quarter of the blooms were already wrong. I will change the repo demo's scoring and annotate the README's 99.7% with its methodology.&lt;/li&gt;
&lt;li&gt;Under the two most common degradations — dimming and moderate occlusion — an area-threshold classifier's dominant failure is class migration, not misses. Watching the class mix drift is an earlier alarm than watching the total. The boundary matters: under extreme underexposure and 1.1 × cover, objects simply vanish (covered recall 0.014) and there is no migration to watch.&lt;/li&gt;
&lt;li&gt;Preprocessing (white balance, CLAHE) should be conditional, triggered by measured global shift. On clipped or noisy input it is a net harm.&lt;/li&gt;
&lt;li&gt;Small-class targets need their own protection strategy under occlusion. Lowering &lt;code&gt;min_area&lt;/code&gt; only pays under light cover. The candidate beyond a single frame is cross-day tracking — yesterday's bud, hidden by a leaf today, restored from the time series. That idea is not validated by anything here (every experiment is a static single frame; wind sway and viewpoint shift are untested). It is a direction the failure modes point to, and it moves the roadmap's video / multi-frame de-duplication up in priority.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Why not jump straight to a trained detector? The &lt;code&gt;BloomDetector&lt;/code&gt; interface is already there; swapping the backend touches nothing else. But without real annotated photos there is nothing to train on. What this study does is map the baseline's failure boundaries under light and occlusion, so that any future backend has to pass the same destructive test suite, with the numbers side by side.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Limitations and open problems
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Everything is still synthetic: program-drawn flowers, flat-painted leaf occluders, global parametric lighting. Real greenhouse light is directional and spectral; real leaves have texture and translucency. Treat these numbers as a lower bound on failure direction and magnitude, not as field accuracy.&lt;/li&gt;
&lt;li&gt;Lighting transforms are whole-image; local specular reflection and lens flare are not modeled.&lt;/li&gt;
&lt;li&gt;The white-balance/CLAHE pair was never ablated separately; their individual contributions and harms are entangled.&lt;/li&gt;
&lt;li&gt;At 2.2 × offset the overlap group is confounded by third-flower merges: the raw error there mixes them in, and the split correction overshoots (+27). Neither end of that row is a clean reading.&lt;/li&gt;
&lt;li&gt;Four scenes, 210 objects, no confidence intervals computed. The claims I kept are the ones consistent across conditions; exact point values (such as where the gamma cliff sits) need denser sampling.&lt;/li&gt;
&lt;li&gt;The split estimator's unit area is the median from this same batch; it must be recalibrated per cultivar and camera distance, and I have not tested that transfer.&lt;/li&gt;
&lt;li&gt;Real-photo validation is still missing. The roadmap's trained detector backend and a real annotated set have not been started. That remains the largest open problem on this line.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  6. References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Bloom-Counter repository (MIT; all code used here): &lt;a href="https://github.com/Ezra-Zhao/Bloom-Counter" rel="noopener noreferrer"&gt;https://github.com/Ezra-Zhao/Bloom-Counter&lt;/a&gt; . Detector: &lt;code&gt;detector/color_segmentation.py&lt;/code&gt;; the co-tuning comment is on line 23 of &lt;code&gt;simulator/generate.py&lt;/code&gt;, non-overlap placement in its &lt;code&gt;_place&lt;/code&gt; function; totals-only scoring in &lt;code&gt;examples/demo.py&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;This study's scripts and raw data: the companion &lt;code&gt;data/2026-10-17-bloom-bench.py&lt;/code&gt;, &lt;code&gt;data/2026-10-17-bloom-minarea-ablation.py&lt;/code&gt;, and &lt;code&gt;data/2026-10-17-bloom-bench.json&lt;/code&gt; (4 scenes, seeds 101/202/303/404, fixed and re-runnable), archived with the article in the tech-deep-dives repository.&lt;/li&gt;
&lt;li&gt;OpenCV documentation: HSV color space and &lt;code&gt;inRange&lt;/code&gt;, morphological operations, &lt;code&gt;createCLAHE&lt;/code&gt;: &lt;a href="https://docs.opencv.org/4.x/" rel="noopener noreferrer"&gt;https://docs.opencv.org/4.x/&lt;/a&gt; .&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Author: Guangyi Zhao. All code and experiments described here are the author's own clean-room work: the detector, the simulator, and the stress-test scripts were written by the author, and the experiments ran on locally generated synthetic data. No client data, client imagery, or identifying information is involved.&lt;/p&gt;







&lt;p&gt;&lt;strong&gt;Support &amp;amp; follow&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub Sponsors: &lt;a href="https://github.com/sponsors/Ezra-Zhao" rel="noopener noreferrer"&gt;https://github.com/sponsors/Ezra-Zhao&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Telegram — Code &amp;amp; Psalms channel: &lt;a href="https://t.me/EzraZhao777" rel="noopener noreferrer"&gt;https://t.me/EzraZhao777&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Newsletter — Code &amp;amp; Psalms on beehiiv: &lt;a href="https://codeandpsalms.beehiiv.com" rel="noopener noreferrer"&gt;https://codeandpsalms.beehiiv.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>opensource</category>
      <category>python</category>
      <category>softwaredevelopment</category>
      <category>testing</category>
    </item>
    <item>
      <title>"Can You Make It Cheaper?" — and the Agent Booked the Order: A State-Machine Field Test of Wiper-Service-Agent</title>
      <dc:creator>Guangyi Zhao</dc:creator>
      <pubDate>Fri, 13 Nov 2026 02:27:00 +0000</pubDate>
      <link>https://dev.to/ezrazhao/can-you-make-it-cheaper-and-the-agent-booked-the-order-a-state-machine-field-test-of-50fm</link>
      <guid>https://dev.to/ezrazhao/can-you-make-it-cheaper-and-the-agent-booked-the-order-a-state-machine-field-test-of-50fm</guid>
      <description>&lt;h2&gt;
  
  
  1. Problem and background
&lt;/h2&gt;

&lt;p&gt;The hard part of a WhatsApp service agent for a small shop is not wiring up a model. It is walking one conversation down a path where money changes hands: ask for the vehicle, look up the size, quote a price, answer questions, record an order intent. Misread the customer once and the cost is real — hear a haggle as an order and the shop holds an order nobody placed; hear a hesitant "I don't know" as a rejection and a nearly closed sale is shut down on the spot.&lt;/p&gt;

&lt;p&gt;Wiper-Service-Agent is the agent I built for a wiper-blade shop. The conversation is not left to a language model. An explicit state machine runs it — GREETING → COLLECT_VEHICLE → QUOTE → DONE, four states — and the understanding layer defaults to a deterministic rule-based parser (MockLLM, marked SIMULATED in the repo). The real LLM parser (RealLLMProvider) is only ever asked to parse a message into an intent and vehicle slots; it never decides prices, sizes, or whether a deal closed. That division of labor is written into the README. Status, honestly: scaffold v0.2, a simulated catalog of 8 fitment records across 5 makes, a demo price table. This is not ready to take real orders.&lt;/p&gt;

&lt;p&gt;So this article does not measure whether the demo runs — the bundled demo and all 56 tests pass (I re-ran them: 56 passed; the README still says 44, which is stale). It measures how the machine behaves off the demo path: 27 scripted conversations, 62 messages, 13 intent-collision probes, a full recomputation of quotes for all 8 catalog records, one persistence round-trip, and one two-customer isolation check. The headline first: the main flow is steadier than I expected, the quote math is exact to the cent, and all six FAQ topics stay inside the quoting state. But the intent layer's substring matching produces three misreadings that would cost a real shop money — the worst being the title of this article. Under the default rule-based parser (MockLLM), a customer in the QUOTE state who asks "可以便宜点吗" ("can you make it cheaper?") is taken straight to DONE with a confirmed order intent, at the full, undiscounted price. Scope, stated once and binding for the whole article: every intent-layer finding here is about that default parser; behavior under the real LLM parser is a separate question, revisited in §5.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Method and architecture
&lt;/h2&gt;

&lt;p&gt;The core package, tools, and WhatsApp boundary total 1,659 lines, including a 258-line webhook server. Conversation state lives in a Conversation object: current state, three vehicle slots (make / model / year), the fitment result, the quote, a boolean haggled flag (has the one-time haggle discount been used), the outcome (confirmed / declined), detected language and confidence, and full history.&lt;/p&gt;

&lt;p&gt;The transition rules, state by state — everything later follows from these:&lt;/p&gt;

&lt;p&gt;GREETING: a message carrying all three vehicle slots goes straight to a fitment lookup — found means QUOTE; a miss (a year outside the catalog range, say) falls back to COLLECT_VEHICLE with a "not found" reply. A partial vehicle moves to COLLECT_VEHICLE and asks for what is missing. Anything else gets the greeting text and the state stays GREETING. This state has no branch for decline, FAQ, or price questions. None.&lt;/p&gt;

&lt;p&gt;COLLECT_VEHICLE: only two things are handled — a decline (DONE, marked declined) and completing the slots (lookup). Confirm, price, haggle, and FAQ intents are all unhandled here and get the same "what's still missing" reply.&lt;/p&gt;

&lt;p&gt;QUOTE: the fullest state. Haggle (once only, an extra 5%), FAQ (answered without leaving QUOTE), price question (re-present the quote), confirm (DONE / confirmed), decline (DONE / declined), a message carrying vehicle info (re-run the lookup — treated as a vehicle change), and anything else re-presents the quote with a nudge.&lt;/p&gt;

&lt;p&gt;DONE: intercepted in handle_message. Any new message after DONE discards the conversation and starts a fresh one — vehicle, quote, and haggle flag all reset. I verified the reset by round-trip.&lt;/p&gt;

&lt;p&gt;Intent parsing (MockLLM.parse) is where this article lives. The precedence order in code is: decline &amp;gt; confirm &amp;gt; haggle &amp;gt; FAQ &amp;gt; price &amp;gt; greeting &amp;gt; provide-vehicle &amp;gt; unknown. Keywords match by substring (&lt;code&gt;w in low&lt;/code&gt;); only three short tokens — sí, да, نه — get word-boundary matching. The confirm list contains everyday words: "买" (buy), "好的" (okay), "可以" (can/sure), "ok", "yes". The decline list contains a bare "no". Vehicle extraction only recognizes catalog vehicles: a (make, model) pair from the simulated catalog must both appear as substrings; the year is the first 4-digit number matching (19|20)\d\d.&lt;/p&gt;

&lt;p&gt;The two tools: wiper_db.lookup searches the 8 simulated fitments by make, model, and year range. pricing.build_quote prices blades in three length tiers (up to 20" $12.99, 21–24" $14.99, 25"+ $16.99), takes 10% off the subtotal (the code comment calls it a bundle discount), and a further 5% after a successful haggle.&lt;/p&gt;

&lt;p&gt;Method: repository code unmodified, conversations driven in-process under different "phone numbers" (arbitrary string IDs), logging every message, resulting state, quote total, haggle flag, and full order intent. Quotes for all 8 fitments were recomputed independently and compared. Collisions were first classified by calling parse directly, then the three worst were replayed inside real conversations to observe the consequences. The bench script and raw JSON are archived with this article and can be re-run.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Measurements
&lt;/h2&gt;

&lt;h3&gt;
  
  
  3.1 The main flow: split vehicle entry, a full Spanish run, exact quote math
&lt;/h3&gt;

&lt;p&gt;The standard path (hello → Toyota Camry → 2018 → how do I install it → okay, I'll take it) walks GREETING → COLLECT_VEHICLE → QUOTE → QUOTE → DONE and produces a confirmed intent with vehicle, sizes (26/20"), and a $26.98 total. All three slots in one message jump straight to QUOTE. A full Spanish run (Hola → Corolla 2021 → ¿Cuánto cuesta? → ¿Incluye instalación? → Vale, sí) answers in Spanish at every step, locks the language to es on the first message, and records detected_language: es on the final intent.&lt;/p&gt;

&lt;p&gt;All 8 quote recomputations matched. Camry, worked in full: $16.99 + $12.99 = $29.98 subtotal, $26.98 after 10% off, $25.48 after the haggle (85% of subtotal). The RAV4, the only record with a rear blade: $42.97 subtotal, $38.67 quoted, $36.52 haggled. One bookkeeping discrepancy worth recording: the comment describes the 10% as a driver+passenger bundle discount, but the discount base is the whole subtotal including the rear blade — the RAV4's $4.30 discount is computed on all three blades. The error favors the customer; the books should still say what the code does. A rounding note, so nobody's calculator disagrees: the Quote's discount field is rounded to cents on its own (the Camry's exact 10% is 2.998, stored as 3.0), while the total is computed from the unrounded discount and then rounded. I reconciled all 16 combinations (8 records, with and without haggle): discount plus total reproduces the subtotal exactly in every case.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.2 Haggle once, and only once — until the vehicle changes
&lt;/h3&gt;

&lt;p&gt;Altima 2019 quotes at $26.98. "太贵了" (too expensive) drops it to $25.48 and sets the flag. "再便宜点" and "还能便宜吗" both get "that's already my lowest," and the total does not move. As a one-shot allowance enforced by a boolean and a recomputation, there is no path around it. That part holds.&lt;/p&gt;

&lt;p&gt;What the tests never covered is haggling across a vehicle change. Haggle the Altima down to $25.48, then name a Civic 2020: the lookup rebuilds the quote without the haggle, the new total is back to $26.98 — and the haggled flag stays set. Haggle again and the agent replies "this is already the lowest price" about a price that was never discounted. The customer is told something factually false. The cause is granularity: the flag lives on the conversation, not on the quote. A vehicle change neither carries the discount over nor clears the flag; of the two coherent choices, the code makes neither.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.3 FAQ only lives inside QUOTE
&lt;/h3&gt;

&lt;p&gt;In QUOTE, all six FAQ topics (install, warranty, lifespan, payment, pickup, shipping) answer correctly, stay in QUOTE, leave the quote untouched, and close with an ordering prompt. That matches the documented design — FAQ must not break the sales flow — and it held in every probe.&lt;/p&gt;

&lt;p&gt;Ask before the quote and the question disappears. At GREETING, "怎么安装" (how do I install it?) gets only the greeting; the question is neither answered nor logged (no FAQ note is recorded). At COLLECT, the same question gets a repeat of "which year is it?", the question vanishes, and after completing the vehicle the customer has to ask again. Price and haggle attempts at COLLECT meet the same fate. There is no holding area in this machine for "remember this, answer it when we get there." Out-of-flow input is not refused; it is silently dropped, and the reply gives the customer no sign their question was never heard — it just reads as a non sequitur.&lt;/p&gt;

&lt;p&gt;Declines are state-dependent too. "算了" (forget it) at COLLECT and at QUOTE correctly ends as declined. "不要了" (I don't want it) as the very first message is not handled at all — GREETING has no decline branch — and earns a cheerful greeting. Minor on its own; included because it shows GREETING's intent coverage is not partial, it is zero.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.4 Intent collisions: 13 probes, three failure families
&lt;/h3&gt;

&lt;p&gt;Feeding everyday phrasings to parse, 7 of 13 came back with a classification visibly at odds with what the speaker meant, in three families:&lt;/p&gt;

&lt;p&gt;Confirm words are too broad and outrank everything else they co-occur with. "可以便宜点吗" (can you make it cheaper?) classifies as CONFIRM — "可以" is in the confirm list and confirm is checked before haggle. "好的，多少钱" (okay, how much?) is CONFIRM, not a price question. "我想买，先问问保修" (I do want to buy, but first let me ask about the warranty) is CONFIRM — "买" fires confirm even though the FAQ topic was correctly detected as warranty and never gets used. "yes but too expensive" is CONFIRM for the same structural reason.&lt;/p&gt;

&lt;p&gt;The decline list contains a bare substring. "no" is matched as a substring, so "I don't know" and "another question" both classify as DECLINE — both contain "no". The codebase already has a word-boundary mechanism for short tokens (CONFIRM_TOKENS / DECLINE_TOKENS); "no" simply was not put in it.&lt;/p&gt;

&lt;p&gt;Decline outranks haggle. "不要太贵了" (don't make it too expensive) and "不买了太贵" classify as DECLINE. Whether the first of those is really a refusal is debatable — it reads more like a haggle opening — but the machine offers no clarifying move. Between "kill the conversation" and "treat as haggle," it picks kill.&lt;/p&gt;

&lt;p&gt;The three worst, replayed inside real conversations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In QUOTE, "可以便宜点吗" → straight to DONE, a confirmed order intent at the full $26.98. The customer asked for a discount; the system recorded a sale.&lt;/li&gt;
&lt;li&gt;In QUOTE, "我想买，先问问保修" → straight to DONE, confirmed, warranty question never answered. The buying intent was genuine, but the flow closed before the customer's actual question, leaving the human follow-up holding a "confirmed" record and an unanswered conversation.&lt;/li&gt;
&lt;li&gt;In QUOTE, "I don't know" → straight to DONE, declined, logged as "declined at quote." The customer was undecided; the system recorded a rejection. The same sentence at COLLECT ends the same way.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Controls, so the word lists are not condemned wholesale: "能便宜点吗" (the same haggle without "可以") classifies correctly as HAGGLE; "先看看保修再说" goes to FAQ; "好的" and "OK" in QUOTE are legitimately CONFIRM. What breaks is the compound sentence — and real customers rarely speak in single keywords.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.5 Changing vehicles: an off-catalog car is quietly merged into the old one
&lt;/h3&gt;

&lt;p&gt;In QUOTE, "Honda Civic 2020" correctly re-quotes a new vehicle (same $26.98 total, but sizes change from 26/20 to 26/18, so the change is visible). "BMW X5 2020" produces the reply "Found it! Toyota Camry 2020." BMW and X5 are not in the simulated catalog, so vehicle extraction fails entirely and only the year, 2020, is captured; slot merging folds that year into the old vehicle, the lookup succeeds for a Camry 2020, and a fresh Camry quote is presented with total confidence. The customer thinks they asked about a BMW. The agent quoted them a Camry. At no point does anything say "I can't find that car."&lt;/p&gt;

&lt;p&gt;The same off-catalog car at the start of a conversation behaves almost honestly: extraction fails and the agent asks which vehicle — phrased as "still missing the vehicle," which will confuse a customer who just named one, but at least nothing is fabricated. Two different failures should not be conflated here: that was an extraction failure (make and model never parsed, slots incomplete, so all it can do is ask). A lookup failure is different — "Toyota Camry 2005" as a first message parses completely, misses the catalog, and gets an explicit "not found" with a fallback to COLLECT, which I also tested. In QUOTE, the pre-existing slots mask the failure and turn it into a silent substitution. The only difference is whether old slot values exist to paper over the gap.&lt;/p&gt;

&lt;p&gt;A year-only change has the mirror-image problem. "2025" merges into Camry, falls outside the catalog range (2018–2024), and this time the lookup properly misses: the state falls back to COLLECT and asks the customer to double-check. The handling is right; the cleanup is not — the old $26.98 quote stays attached to the conversation. When the customer then gives up ("算了"), the declined order intent carries that stale quote, with the vehicle field reading Camry 2025: a car with no fitment, wearing a 2018 quote, filed as if the customer had rejected a real offer.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.6 Persistence and isolation: two passing grades
&lt;/h3&gt;

&lt;p&gt;Mid-conversation — quoted and haggled — I restored the conversation into a brand-new agent instance from the same JSON file store. State QUOTE, vehicle, haggled total $25.48, the flag, and all 4 history entries came back exact, and the restored conversation answered a warranty question while staying in QUOTE. The to_dict / from_dict round-trip is lossless. Two interleaved customers (one haggling, one completing a vehicle) never leaked slots, quotes, or flags into each other; keying by phone number holds.&lt;/p&gt;

&lt;p&gt;Gibberish in QUOTE ("asdf qwer") re-presents the quote with a nudge and changes nothing. Not smart, but it neither crashes nor closes anything — and in context it is the intent layer's most trustworthy behavior. Only UNKNOWN gets this treatment. Every failure above came from a match that was almost right.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Analysis and trade-offs
&lt;/h2&gt;

&lt;h3&gt;
  
  
  4.1 What the architecture genuinely gets right: the parser never holds the pen on a deal
&lt;/h3&gt;

&lt;p&gt;Read against the design, the result worth keeping is the division of authority. The state machine owns the flow, the tools own the numbers, and the parsing layer — rules today, an LLM tomorrow — only emits intents and slots. Exact quote math, a hard one-time haggle cap, FAQ containment, and lossless persistence all follow from decisions being kept in deterministic code. Swapping in RealLLMProvider will improve parsing, but its intents still pass through the same transition table, and it still cannot mint a price or close a deal. For a small-shop agent that is the right border: language may be probabilistic; the ledger may not.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.2 The defects are not in the machine; they are in its entry contract
&lt;/h3&gt;

&lt;p&gt;None of the three measured problem families is a wrongly drawn transition. The table's flaw is that it trusts whatever the entrance hands it: whatever intent parse returns gets executed, whatever the slot merger produces gets looked up. Every business-harming action in the tests — the wrongly closed order, the wrongly quoted car, the fabricated intent record — happened at a point where input was over-trusted:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CONFIRM and DECLINE are irreversible (DONE, plus a recorded intent), yet they are triggered by the weakest evidence in the system: a single substring. Irreversible actions should demand stronger evidence than reversible ones (re-presenting a quote, answering an FAQ). The current precedence inverts that — the irreversible intents are checked first.&lt;/li&gt;
&lt;li&gt;Slot merging overwrites field by field and cannot distinguish "the customer added the year" from "the customer changed cars and the new car failed extraction." The second case should route to clarification, not be healed with stale values.&lt;/li&gt;
&lt;li&gt;haggled and quote have mismatched lifetimes. A quote can be replaced while its flag persists; a failed lookup retreats while its quote persists. Derived state has no rule that says "a new quote invalidates everything derived from the old one."&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4.3 Fix order: gate the irreversible actions first, upgrade the NLU later
&lt;/h3&gt;

&lt;p&gt;In cost-benefit order. First, move short words like "no" out of the substring lists into the existing word-boundary sets, and tighten confirm words like "可以" and "买" with co-occurrence conditions (confirm only when no haggle or price wording is present). That is an afternoon of word-list and ordering work and it dismantles most of §3.4. Second, reorder precedence so reversible intents win: FAQ, price, and haggle are evaluated before confirm and decline, and confirm only stands when the sentence carries no other request. "Wants to buy, but first the warranty" then gets its answer and stays in QUOTE instead of being closed early. Third, give CONFIRM a read-back step: before DONE, echo vehicle and total — "shall I book this?" — and record the intent only on an explicit yes. One extra CONFIRMING state holds it, and it mirrors what a human clerk does anyway. Fourth, add a merge rule: when a message carries a year or vehicle-like text but extraction comes back empty and inconsistent with the current vehicle, do not merge — clarify; and when a lookup miss retreats to COLLECT, clear the quote and the haggle flag with it. Fifth, and only then, swap MockLLM for RealLLMProvider, with this article's 13 probes plus real conversation logs as the regression set. A better brain fixes part of the compound-sentence problem; it fixes none of the merging or lifecycle problems, because those belong to the machine itself.&lt;/p&gt;

&lt;p&gt;The judgment underneath the ordering: in a demo, the thing most easily overlooked is not answer quality but closing correctness. A wrong FAQ answer gets asked again. A wrongly recorded confirmed intent gets acted on — the owner preps stock, reaches out, and finds nobody there.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Limitations and open questions
&lt;/h2&gt;

&lt;p&gt;Stated plainly. First, everything ran on MockLLM; the collision patterns are specific to a rule-based parser. A real LLM endpoint would very likely handle the compound sentences better, but I did not re-run the 13 probes against RealLLMProvider, so the post-swap error rate is unmeasured. Second, the catalog has 8 simulated records at demo prices. In a real catalog of hundreds of records, extraction failures get rarer but not harmless — the silent-merge mechanism is size-independent, and the claim here is about the mechanism. Third, the scripts were written backwards from the transition table, so they cover the paths I could think of; real customers' speech-to-text errors, code-switching, and two cars in one sentence were only spot-checked, not systematically tested. Fourth, the WhatsApp boundary layer (webhook signature verification, Cloud API delivery, usage counters) is out of scope — this round exercised the in-process agent API only; the repo's own tests, all 56 passing, cover parts of that layer, but no end-to-end message test was run. Fifth, beyond Spanish, the Russian and Persian flows were verified only at greeting and language-detection level, following the repo's own test coverage; the templates have not had native-speaker review, which the README also states.&lt;/p&gt;

&lt;p&gt;Three open questions. Adding a CONFIRMING read-back state will cost some completion rate — how much is only knowable with real traffic. How fine-grained the merge-clarification rule should be (year conflicts only, or any "vehicle-like text, empty extraction") needs real conversation logs to calibrate. And two cars in one order — a customer buying for themselves and a family member — does not fit the one-conversation-one-vehicle data model at all; whether that is a notes-field workaround or a multi-intent model change is undecided.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Wiper-Service-Agent source (version tested, commit 9675291): github.com/Ezra-Zhao/Wiper-Service-Agent. Key files: wiper_agent/agent.py (state machine, slot merging, language upgrade), wiper_agent/llm.py (MockLLM precedence and word lists, the RealLLMProvider parsing contract), wiper_agent/conversation.py and store.py (state and persistence), wiper_agent/schemas.py (the four states and data models), tools/wiper_db.py (8 simulated fitments, marked SIMULATED in the file header), tools/pricing.py (three price tiers and discounts), tools/faq.py (six FAQ topics, five-language templates).&lt;/li&gt;
&lt;li&gt;Bench script and raw data for this article: data/2026-10-16-wiper-bench.py and data/2026-10-16-wiper-bench.json (27 conversation traces, 13 intent-collision probes, 8 quote recomputations, persistence round-trip, two-customer isolation), archived with the article; the numbers can be reproduced by running the script against a clone of the repository.&lt;/li&gt;
&lt;li&gt;Repository test suite: tests/run_tests.py — 56 passed, 0 failed in this run (the README Quickstart says 44, which is out of date).&lt;/li&gt;
&lt;/ol&gt;







&lt;p&gt;&lt;strong&gt;Support &amp;amp; follow&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub Sponsors: &lt;a href="https://github.com/sponsors/Ezra-Zhao" rel="noopener noreferrer"&gt;https://github.com/sponsors/Ezra-Zhao&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Telegram — Code &amp;amp; Psalms channel: &lt;a href="https://t.me/EzraZhao777" rel="noopener noreferrer"&gt;https://t.me/EzraZhao777&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Newsletter — Code &amp;amp; Psalms on beehiiv: &lt;a href="https://codeandpsalms.beehiiv.com" rel="noopener noreferrer"&gt;https://codeandpsalms.beehiiv.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>automation</category>
      <category>llm</category>
    </item>
    <item>
      <title>How Many of a Scanner's Findings Are Real? Web-Vuln-Scanner's Detection Pipeline and False-Positive Control, Measured</title>
      <dc:creator>Guangyi Zhao</dc:creator>
      <pubDate>Wed, 11 Nov 2026 02:20:57 +0000</pubDate>
      <link>https://dev.to/ezrazhao/how-many-of-a-scanners-findings-are-real-web-vuln-scanners-detection-pipeline-and-false-positive-1b7d</link>
      <guid>https://dev.to/ezrazhao/how-many-of-a-scanners-findings-are-real-web-vuln-scanners-detection-pipeline-and-false-positive-1b7d</guid>
      <description>&lt;h1&gt;
  
  
  How Many of a Scanner's Findings Are Real? Web-Vuln-Scanner's Detection Pipeline and False-Positive Control, Measured
&lt;/h1&gt;

&lt;h2&gt;
  
  
  1. Problem and background
&lt;/h2&gt;

&lt;p&gt;A vulnerability scanner's report has a question that rarely gets asked to its face: how many of these findings are real?&lt;/p&gt;

&lt;p&gt;The cost of a false positive is not "a second look." One fake high-severity SQL injection drags the on-call engineer through a full incident loop — confirm, reproduce, read the code — until it turns out the page merely mentioned database errors in its prose. Enough false positives and nobody reads the report carefully anymore; the real findings get swept away with the noise. In a detection pipeline, false-positive control is not polish. It is what decides whether the report deserves trust.&lt;/p&gt;

&lt;p&gt;My own open-source project, Web-Vuln-Scanner, is a small ethics-first scanner: it refuses to run without an explicit target and an explicit authorization confirmation. It currently implements four checks — reflected XSS, error-based SQL injection, security response headers, and sensitive-path probing. The honest status, stated up front: scaffold v0.1, and the README says so. Stored XSS, blind SQLi, CSRF, and authenticated scanning are not implemented; they sit in the source as TODOs, not claimed features.&lt;/p&gt;

&lt;p&gt;This is not a usage tutorial. I ran the pipeline against six targets: the bundled intentionally vulnerable demo app; a hardened app written the careful way; a single-page-app shell that answers HTTP 200 for every unknown path; an article site whose prose legitimately talks about database errors; an app whose only form is POST and whose backend really is injectable; and an API app that reflects input verbatim into a JSON response. The six targets measure four things: whether real vulnerabilities are caught, whether clean targets stay clean, what shape the false positives take, and where the pipeline's field of view ends. The headline result: each check's logic is restrained in its own way, but the two checks that did produce false positives — sensitive-path probing and error-based SQLi — are missing the same thing: a baseline. Without a "first look at what the normal response looks like" step, a soft-404 site makes the sensitive-path check go 14 for 14 wrong, and one ordinary sentence about a "database error" buys you a high-severity injection alert.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Method and architecture
&lt;/h2&gt;

&lt;p&gt;The codebase totals 846 lines including the demo app and tests. The pipeline is four serial stages: scope.py validates authorization; crawler.py crawls the same host collecting pages, forms, and parameterized URLs; the four checks run independently against the crawl results; report.py emits a console and JSON report. Checks share no state, and the CLI wraps each check so one check's exception cannot kill the scan.&lt;/p&gt;

&lt;p&gt;Each check's decision logic, stated precisely, because every conclusion below follows from it:&lt;/p&gt;

&lt;p&gt;Reflected XSS (scanner/checks/xss.py): generates an 8-hex-character random token, builds a payload of the form &lt;code&gt;"&amp;gt;&amp;lt;svg/onload=alert('TOKEN')&amp;gt;&lt;/code&gt;, and injects it into every URL parameter and form field. A high-severity finding requires both the token and the complete payload to appear verbatim in the response body. Escaped reflection (quotes or angle brackets encoded) cannot match, because the full payload string no longer appears.&lt;/p&gt;

&lt;p&gt;Error-based SQLi (scanner/checks/sqli.py): four payloads only (single quote, double quote, two tautologies). The response body is matched against six database error-signature groups — SQLite, MySQL/MariaDB, PostgreSQL, MSSQL, Oracle, and a generic group — 21 regular expressions in total, including generic words like &lt;code&gt;syntax error&lt;/code&gt; and &lt;code&gt;database error&lt;/code&gt;. A match is a high-severity finding, at most one per parameter. The check never sends a baseline request and never diffs the response against the un-injected one.&lt;/p&gt;

&lt;p&gt;Security headers (scanner/checks/headers.py): examines exactly one response — the base page. Missing Content-Security-Policy, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, or Permissions-Policy headers are reported individually; HSTS is checked on HTTPS targets; a Server header earns an info-level version-disclosure note.&lt;/p&gt;

&lt;p&gt;Sensitive files (scanner/checks/sensitive_files.py): a fixed table of 14 probe paths (.git/HEAD, .env, admin, backup.zip, db.sqlite, and so on), requested one by one without following redirects. HTTP 200 with a non-empty body is a finding, at a per-path preset severity from info to high. The response content is never examined — the source's own TODOs admit soft-404 detection and content sniffing are unimplemented.&lt;/p&gt;

&lt;p&gt;The crawler's field of view bounds the checks': same-host links only, at most 20 pages by default, and only pages served as text/html are recorded — a non-HTML response is skipped entirely, neither stored nor parsed for links.&lt;/p&gt;

&lt;p&gt;Method: the repository ran unmodified. The demo target is the bundled demo/vulnerable_app.py; the other five targets were written for this article and are archived with the experiment script. Every target went through the full pipeline (crawl plus four checks) with per-check request counts and timings recorded; the demo scan was repeated three times for stability; the authorization guard got five dedicated probes; and the JSON endpoint got one manual payload-reflection probe. Scripts and raw JSON are archived with this article so every number can be re-run.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Measurements
&lt;/h2&gt;

&lt;h3&gt;
  
  
  3.1 Demo app: all four planted problem classes caught, 31 requests per run
&lt;/h3&gt;

&lt;p&gt;The demo app plants four problem classes: reflected XSS on /search, string-concatenated SQL with verbose error echo on /user, no security headers at all, and exposed /admin and /.git/HEAD. The scan reported 13 findings:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Check&lt;/th&gt;
&lt;th&gt;Requests&lt;/th&gt;
&lt;th&gt;Findings&lt;/th&gt;
&lt;th&gt;What&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Crawl&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;4 pages, 1 form, 2 parameterized URLs&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;reflected-xss&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;parameter q, parameter id, form field q&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;error-based-sqli&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;parameter id (SQLite error disclosed)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;security-headers&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;all five headers missing, plus Server version disclosure&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;sensitive-files&lt;/td&gt;
&lt;td&gt;14&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;/robots.txt, /.git/HEAD, /admin&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Thirty-one requests total; per-check time 0.04–0.19 s; a full local run finishes in under a second. Three repeated runs agreed exactly: 13 findings each time, same severity distribution (high 5, medium 2, low 3, info 3). The pipeline is deterministic; there is no random component in its verdicts.&lt;/p&gt;

&lt;p&gt;One hit deserves unpacking. XSS also fired on /user?id= — SQLi's home turf. The XSS payload was concatenated into the SQL statement, the database errored, and the error page echoed the exception — payload included, unescaped — inside a pre element. So the payload was reflected, through the error page. That is a true positive, but the reflection path is "via verbose error disclosure," not "the app renders the parameter into a normal page." A reader who only sees the title "Reflected XSS via parameter 'id'" will go looking in the wrong place: the check supplies the evidence string, but not the context in which the reflection happened. That is a reporting debt.&lt;/p&gt;

&lt;p&gt;The bundled test suite — 11 tests covering the four checks against the demo app plus the scope guard — passes under pytest in 1.61 s.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.2 Hardened app: zero vulnerability findings, one unavoidable info
&lt;/h3&gt;

&lt;p&gt;The second target was written the careful way: html.escape on output, parameterized queries with type validation, all five security headers set, real 404s for unknown paths, no sensitive paths. Result: XSS, SQLi, and sensitive-files all returned 0. The single finding was the security-headers info — the Server header disclosing the Werkzeug version.&lt;/p&gt;

&lt;p&gt;That info is worth a sentence of its own. It is not the application code's fault: the development server adds the Server header at the response layer, and my hardened app did not attempt to suppress it. Against any target running on a framework dev server with default settings, this info will very likely appear regardless of how disciplined the application code is. The lesson for report readers: judge info-level items by which layer produced them, and do not charge the framework's default behavior to the application.&lt;/p&gt;

&lt;p&gt;The positive conclusion matters just as much: on a "written properly" baseline, the four checks produced zero vulnerability-class findings. False positives are not this pipeline's default state. They appear on specific site shapes — the next three sections.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.3 Soft 404: 14 of 14 probes wrong, a report that is 93% noise
&lt;/h3&gt;

&lt;p&gt;The third target mimics the common SPA/fallback shape: every unknown path returns 200 with the app shell. It sets all five security headers and escapes its search output — an app with nothing planted. The scan reported 15 findings, 14 of them from sensitive-files: the entire 14-path probe table hit, including .env (high), db.sqlite (high), database.sql (high), .git/HEAD (high), backup.zip, phpinfo.php. The 15th finding was the Server version-disclosure info, same as section 3.2. All 14 sensitive-path hits are false positives — a 100% false-positive rate for that check — and 14 of the report's 15 findings, 93%, are noise.&lt;/p&gt;

&lt;p&gt;The cause is written into the decision rule: status 200 plus a non-empty body, content never examined. On a site where every path is a 200, the probe table's length is the false-positive count. The source's TODO already names the fix — fetch one random nonexistent path as a soft-404 sample and compare similarity — but until that lands, this check's output on SPA-shaped sites should be stamped untrusted as a block, not interleaved with real findings sorted by high severity. The practical damage is exactly there: the four high-severity findings at the top of the report are all fake, and the reader's trust in any real finding further down is spent along with them.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.4 No baseline comparison: one sentence of prose buys a high-severity alert
&lt;/h3&gt;

&lt;p&gt;The fourth target is an article site whose page legitimately discusses database errors — the prose contains the phrases "database error" and "SQL syntax" — and whose topic parameter feeds no SQL query at all. There is no injection. The scan reported one high-severity finding: "Possible SQL injection via parameter 'topic' (Generic SQL error disclosed)."&lt;/p&gt;

&lt;p&gt;The mechanism is easy to dissect. The check appends its four payloads to the parameter one at a time and matches every response against the error signatures. The article's prose contains signature words regardless of any payload, so the first payload already matches; the verdict has nothing to do with whether injection occurred. The missing step is the baseline: never request the page without a payload and check whether the signature words were already there. Baseline comparison is the textbook move for injection detection — this project's own blind-SQLi TODO sketches exactly that, comparing true-condition and false-condition responses — but the error-based path never got one. And because the generic signature group uses everyday words like "database error," the tripwire is low: any site that writes about database operations can set it off.&lt;/p&gt;

&lt;p&gt;This and section 3.3 are the same disease in two organs: the verdict asks only "is the thing I am looking for in this response," never "was it already there before I attacked."&lt;/p&gt;

&lt;h3&gt;
  
  
  3.5 POST forms: a real injection in plain sight, skipped by design
&lt;/h3&gt;

&lt;p&gt;The fifth target has a single POST form whose backend query is string-concatenated with verbose errors — a real, exploitable SQL injection. The SQLi check reported 0. By design it tests GET forms and URL parameters only; POST forms are skipped, with a TODO saying so. The miss is a scope boundary, not an implementation bug — but nothing in the report mentions that this form was never tested. The reader sees a clean zero.&lt;/p&gt;

&lt;p&gt;The same target produced a telling contrast. The XSS check does test POST forms, and it reported one high. Its HTML payload happened to contain quotes that broke the backend SQL; the error page echoed the payload unescaped, and the XSS check duly confirmed a reflected XSS — the same echo path as section 3.1. What it recorded is an XSS, not a SQLi. But that response objectively carried a full database error message, and no part of the pipeline ever matched it: the SQLi check had skipped the form, and the XSS check does not look at error signatures. The evidence appeared in the traffic and no check was responsible for claiming it. That is the price of hermetic check separation: every check answers for its own conclusions, and nobody answers for coverage completeness. A "not covered" section in the report — which forms, which parameters, which checks never ran on them — costs little and turns this silent miss into a stated boundary.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.6 JSON endpoints: outside the crawler's field of view
&lt;/h3&gt;

&lt;p&gt;The sixth target's home page links to a JSON endpoint, /api/search?q=, which places q verbatim into its JSON response. I verified with a separate manual probe: the endpoint returns 200 with Content-Type application/json, and both the token and the complete payload appear verbatim in the body — had this endpoint been probed, the XSS check's match condition would have been satisfied. In the real scan it was never probed. The crawler fetched the link, saw a non-HTML content type, and skipped it: the endpoint entered neither the page list nor the parameterized-URL list, so neither injection check ever saw it as input. The target's six findings were all headers-class; injection findings were 0.&lt;/p&gt;

&lt;p&gt;The characterization needs restraint. Verbatim reflection inside an application/json response is not the same as XSS in an HTML context; modern browsers will not execute it as a page. Calling this a "missed XSS" would overstate it. The real conclusion is about the field of view: this pipeline can only see the HTML-page portion of an application. API endpoints — JSON backends, mobile APIs — are entirely outside it, and the report never tells you how large the visible portion was. For a scaffold that calls itself a web scanner, that belongs in the report, not just the README.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.7 The authorization guard: five probes
&lt;/h3&gt;

&lt;p&gt;The last experiment measures not detection quality but whether the pipeline will run at all — five probes against scope.py:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Probe&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Target without an http(s) scheme&lt;/td&gt;
&lt;td&gt;Refused (ScopeError: explicit URL required)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Authorization not confirmed&lt;/td&gt;
&lt;td&gt;Refused (ScopeError)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Confirmed, local target&lt;/td&gt;
&lt;td&gt;Allowed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Allowlist not containing the target host&lt;/td&gt;
&lt;td&gt;Refused&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Allowlist containing the target host&lt;/td&gt;
&lt;td&gt;Allowed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All five matched the design: no default target, no confirmation no scan, and an allowlist, when given, actually narrows scope. The guard is enforced in code rather than advised in documentation — not a given among learning-grade scanners, and worth recording.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Analysis and trade-offs
&lt;/h2&gt;

&lt;h3&gt;
  
  
  4.1 The four checks' false-positive control, graded individually
&lt;/h3&gt;

&lt;p&gt;Ranked by decision method, the four checks are not equally armored. XSS carries the hardest evidence: a random token plus the complete payload as a dual condition excludes escaped reflection and static content by construction, and it produced a clean zero on the hardened target. Its only weakness is context expression — reflection via an error page is reported identically to reflection in normal rendering (sections 3.1 and 3.5). Sensitive-path probing has the weakest decision rule — status code only, zero content verification — and it fails wholesale on the most common modern deployment shape, the SPA. SQLi sits between: its payloads and signatures are not unreasonable, but the missing baseline makes it systematically wrong on sites that talk about databases, and the more generic the signature words, the worse it gets. Headers is the most deterministic check — a header is present or it is not — with one caveat: the Server info originates at the server layer, not in application code, and should not be graded alongside headers the application itself failed to set.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.2 Fix order: baselines before breadth
&lt;/h3&gt;

&lt;p&gt;In return-on-effort order. First, baselines and soft-404 sampling: the sensitive-path check should first fetch one random path as a baseline and downgrade or drop probe responses that closely resemble it; the SQLi check should send a baseline request before injecting, and skip any parameter whose normal response already contains the signature words. This one item treats sections 3.3 and 3.4 together — it is the hinge of false-positive control. Second, content sniffing: a .git/HEAD hit should begin with "ref:", an .env hit should contain key-value lines; verify content after a probe hits before assigning high severity. The source TODO already has this idea; it ranks after baselines because the baseline helps all 14 probes at once, while sniffing rules are written per path. Third, a not-covered section in the report: POST forms, non-HTML endpoints, pages beyond the crawl cap — listed explicitly, so misses become stated boundaries instead of silence. Fourth, and only then, breadth: POST SQLi, stored XSS, and blind SQLi are all on the TODO list, but breadth widens the promise; widen it before the baselines land and you manufacture false positives at a larger scale.&lt;/p&gt;

&lt;p&gt;The judgment underneath the ordering: a scanner's credibility comes first from "what it reports is mostly real," and only second from "it reports a lot." This pipeline currently leans the other way — coverage grows, at least in its TODO plans, while the baselines that make verdicts trustworthy are still missing.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.3 One judgment: false-positive control means giving every verdict a refutation procedure
&lt;/h3&gt;

&lt;p&gt;Looking across the four checks, the reliable verdict (XSS) has a shared structure: its evidence is exclusive. A random token cannot pre-exist in the page; the complete payload appearing verbatim excludes escaping. The unreliable two lack exactly that. A 200 status is not exclusive evidence — a soft 404 is also a 200. A signature word in the prose is not exclusive evidence — it was there with no injection at all. Doing false-positive control on a detection pipeline means, in engineering terms, attaching a refutation procedure to every verdict class: first prove "without my attack, it is not there," then report "after my attack, it appeared." Baseline requests, soft-404 samples, and random tokens are three implementations of the same idea. That is why baselines rank ahead of every breadth item in section 4.2 — the gap is not a missing patch on one check, it is a missing step in the verdict methodology.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Limitations and open questions
&lt;/h2&gt;

&lt;p&gt;The limitations, stated plainly. First, all six targets are minimal local apps, each isolating one site shape. Real sites mix shapes — an SPA with a genuinely exposed file, an article site with a real injection — and this article does not measure how false and true positives interact in mixed shapes. Second, the hardened app was written by the author against the checks' own list, a "studying to the test" bias: it proves the checks stay quiet on an ideal baseline, not that they stay equally quiet on mediocre real-world code. Third, every experiment ran over loopback; the timing figures are local orders of magnitude only (section 3.1's 0.04–0.19 s is one demo run's per-check times; across all six targets, per-check times spanned 0.003–0.23 s). Under real network latency, the 14 serial sensitive-path requests and the per-parameter serial payloads will stretch totals considerably, and concurrency and timeout behavior went unmeasured — the per-request timeout is a uniform 10 s in the source, and worst-case waits were not exercised. Fourth, the XSS-via-error-page path is classified here as a true positive because the payload does enter an HTML response unescaped; its exploitability in a real browser depends on the error page's content type and context, which this article did not verify at browser level. Fifth, the targets and the demo all run on the Flask/Werkzeug stack; other stacks change Server headers and error-page shapes, and the conclusions generalize only to similar shapes.&lt;/p&gt;

&lt;p&gt;Three open questions remain. What similarity algorithm and threshold should define a soft-404 baseline — too loose leaks real files, too tight resurrects false positives — needs a corpus of real SPA samples to calibrate. After SQLi gains baseline filtering, will targets whose pages echo the same error stack with and without injection lose true positives to the filter? That needs a dedicated target shape to measure. And at what granularity should a not-covered list be reported — endpoints, parameters, or a check-by-endpoint matrix — is a question to settle after one real round of using it.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Web-Vuln-Scanner source (version measured here): github.com/Ezra-Zhao/Web-Vuln-Scanner — key files: scanner/cli.py (pipeline assembly, per-check failure isolation), scanner/scope.py (authorization guard), scanner/crawler.py (crawl and field of view), scanner/checks/xss.py, scanner/checks/sqli.py, scanner/checks/headers.py, scanner/checks/sensitive_files.py (the four checks and their TODOs), demo/vulnerable_app.py (demo target).&lt;/li&gt;
&lt;li&gt;Experiment scripts and raw data for this article: data/2026-10-15-vuln-scanner-bench.py and data/2026-10-15-vuln-scanner-bench.json (per-check results, request counts, authorization probes, and the JSON reflection probe for all six targets), archived with this article; every number can be re-checked by re-running the script.&lt;/li&gt;
&lt;li&gt;OWASP Testing Guide and OWASP ASVS: the conventional framing for injection testing and security headers; used as background orientation only, no specific figures quoted.&lt;/li&gt;
&lt;/ol&gt;







&lt;p&gt;&lt;strong&gt;Support &amp;amp; follow&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub Sponsors: &lt;a href="https://github.com/sponsors/Ezra-Zhao" rel="noopener noreferrer"&gt;https://github.com/sponsors/Ezra-Zhao&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Telegram — Code &amp;amp; Psalms channel: &lt;a href="https://t.me/EzraZhao777" rel="noopener noreferrer"&gt;https://t.me/EzraZhao777&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Newsletter — Code &amp;amp; Psalms on beehiiv: &lt;a href="https://codeandpsalms.beehiiv.com" rel="noopener noreferrer"&gt;https://codeandpsalms.beehiiv.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>cybersecurity</category>
      <category>infosec</category>
      <category>security</category>
    </item>
    <item>
      <title>Oppenheimer's Script, Now Starring Jensen Huang? — History Rhymes Special</title>
      <dc:creator>Guangyi Zhao</dc:creator>
      <pubDate>Mon, 09 Nov 2026 23:39:54 +0000</pubDate>
      <link>https://dev.to/ezrazhao/oppenheimers-script-now-starring-jensen-huang-history-rhymes-special-6fm</link>
      <guid>https://dev.to/ezrazhao/oppenheimers-script-now-starring-jensen-huang-history-rhymes-special-6fm</guid>
      <description>&lt;p&gt;Oppenheimer's Script, Now Starring Jensen Huang? — History Rhymes Special&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Before You Wire an LLM Into GPU Fault Triage: AI-Node-Sentinel's Integration Point and Six Measured Failure Modes</title>
      <dc:creator>Guangyi Zhao</dc:creator>
      <pubDate>Sun, 08 Nov 2026 02:32:05 +0000</pubDate>
      <link>https://dev.to/ezrazhao/before-you-wire-an-llm-into-gpu-fault-triage-ai-node-sentinels-integration-point-and-six-measured-3p2m</link>
      <guid>https://dev.to/ezrazhao/before-you-wire-an-llm-into-gpu-fault-triage-ai-node-sentinels-integration-point-and-six-measured-3p2m</guid>
      <description>&lt;h1&gt;
  
  
  Before You Wire an LLM Into GPU Fault Triage: AI-Node-Sentinel's Integration Point and Six Measured Failure Modes
&lt;/h1&gt;

&lt;h2&gt;
  
  
  1. Problem and background
&lt;/h2&gt;

&lt;p&gt;In a GPU cluster, the first signal of failing hardware is usually one line in the kernel log: an Xid. XID is NVIDIA's numbering scheme for GPU hardware and firmware errors — a GPU falling off the PCIe bus, an uncorrectable double-bit ECC error, an NVLink fault, a GSP firmware timeout each has its own code. The on-call ritual is manual: pull dmesg from a thousand GPUs, look up what each code means, then decide — drain the node, reset the GPU, reboot, or start an RMA. Decide slowly and the training job keeps retrying on broken hardware, burning GPU-hours that cost real money.&lt;/p&gt;

&lt;p&gt;The obvious impulse is to hand this to an LLM agent. Let the model read telemetry, look up error codes, and recommend actions — isn't that exactly what agents are for?&lt;/p&gt;

&lt;p&gt;My own open-source project, AI-Node-Sentinel, was scaffolded around that idea: telemetry comes in, XID events are extracted, a lookup table enriches them, triage rules are applied, and a structured report comes out, with a LangChain-based slot reserved for LLM reasoning. Let me state the honest status up front, because everything after this paragraph depends on it: the project is scaffold v0.1, and its README says so. The triage decision tree is a deliberate stub — every event gets NEEDS_HUMAN_REVIEW with confidence 0.0. The LangChain provider is also a stub that raises NotImplementedError on construction. All telemetry is synthetic, produced by a bundled simulator. Only three stages actually run: ingestion, lookup, and report rendering.&lt;/p&gt;

&lt;p&gt;So this is not a write-up of a production diagnostic system. It is the opposite: I put the scaffold on the dissecting table and ran six fault-injection experiments to measure where this pipeline would break once an LLM is actually wired in. The results generalize to anyone attaching an LLM to an operations system, because none of the six breakpoints is a model-capability problem. They are wiring problems: an output contract that doesn't match, evidence fed too thin, one malformed record poisoning the whole batch, a prompt path coupled to the working directory, stateless single-event myopia, and corroborating signals discarded by the pipeline itself. A stronger model fixes none of these.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Method and architecture
&lt;/h2&gt;

&lt;p&gt;The codebase is small: eight core Python files, roughly 470 lines including tests and the demo. Four parts. agent/schemas.py defines the data types: TelemetryEvent (a normalized event with source, kind, and payload), XidFinding (an XID event enriched by lookup), and TriageVerdict (action, confidence, rationale). tools/xid_lookup.py is a static table mapping codes to name, category, and severity, seeded only from NVIDIA's public XID documentation and Google Cloud's GPU troubleshooting guide; a miss returns None — it never guesses. tools/triage_rules.py holds the decision tree, currently the stub. agent/orchestrator.py is the TriageAgent: ingest, extract XID events, triage each one, render the report.&lt;/p&gt;

&lt;p&gt;The LLM integration point lives in agent/llm.py: a minimal protocol, LLMProvider, requiring one method, reason(system_prompt, evidence) -&amp;gt; str. The orchestrator first computes the deterministic verdict; if a provider is present, it builds an evidence string, calls the provider, and appends the returned text to the verdict's rationale with an [LLM] prefix. The draft system prompt in prompts/triage_system.md instructs the model to cite only the evidence given, to say explicitly when a code is unknown, to return exactly one action with a confidence between 0 and 1, to force NEEDS_HUMAN_REVIEW whenever confidence is below 0.7, and to answer in JSON.&lt;/p&gt;

&lt;p&gt;Method: five experiment groups against the unmodified repository, with the scripts and raw JSON archived alongside this article. (1) Baseline scale: the bundled simulator generates telemetry windows for 4, 16, and 64 nodes; I record event composition, verdict distribution, and pipeline latency. (2) Lookup coverage: table size plus ten out-of-table probe codes. (3) Malformed-data injection: events with a missing xid key, a non-numeric xid, and xid=None, mixed into otherwise good batches. (4) Fake-LLM experiments: a local provider that returns exactly the JSON the prompt demands, to observe what actually changes in the verdict; then a provider that always raises, to observe fault propagation. (5) Failure-mode probes: repeat faults on one GPU, the fate of corroborating events, and prompt loading from a different working directory.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Measurements
&lt;/h2&gt;

&lt;h3&gt;
  
  
  3.1 Baseline: the deterministic part is too fast to matter, and the verdicts are the stub's
&lt;/h3&gt;

&lt;p&gt;The simulator emits one thermal and one ECC baseline event per GPU, then injects one or two XID events on about 35% of GPUs:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Scale&lt;/th&gt;
&lt;th&gt;Events&lt;/th&gt;
&lt;th&gt;XID events&lt;/th&gt;
&lt;th&gt;Verdicts&lt;/th&gt;
&lt;th&gt;Unknown verdicts&lt;/th&gt;
&lt;th&gt;Severity (critical/high/unknown)&lt;/th&gt;
&lt;th&gt;Pipeline time&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;4 nodes × 8 GPUs (seed 42)&lt;/td&gt;
&lt;td&gt;76&lt;/td&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;12&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;10 / 1 / 1&lt;/td&gt;
&lt;td&gt;~0.1 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;16 nodes × 8 GPUs (seed 42)&lt;/td&gt;
&lt;td&gt;313&lt;/td&gt;
&lt;td&gt;57&lt;/td&gt;
&lt;td&gt;57&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;39 / 13 / 5&lt;/td&gt;
&lt;td&gt;~0.2 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;64 nodes × 8 GPUs (seed 42)&lt;/td&gt;
&lt;td&gt;1,285&lt;/td&gt;
&lt;td&gt;261&lt;/td&gt;
&lt;td&gt;261&lt;/td&gt;
&lt;td&gt;34&lt;/td&gt;
&lt;td&gt;157 / 70 / 34&lt;/td&gt;
&lt;td&gt;~0.7 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;64 nodes × 8 GPUs (seed 7)&lt;/td&gt;
&lt;td&gt;1,295&lt;/td&gt;
&lt;td&gt;271&lt;/td&gt;
&lt;td&gt;271&lt;/td&gt;
&lt;td&gt;35&lt;/td&gt;
&lt;td&gt;177 / 59 / 35&lt;/td&gt;
&lt;td&gt;~0.7 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;64 nodes × 8 GPUs (seed 123)&lt;/td&gt;
&lt;td&gt;1,282&lt;/td&gt;
&lt;td&gt;258&lt;/td&gt;
&lt;td&gt;258&lt;/td&gt;
&lt;td&gt;28&lt;/td&gt;
&lt;td&gt;167 / 63 / 28&lt;/td&gt;
&lt;td&gt;~0.7 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Three observations. First, every verdict is NEEDS_HUMAN_REVIEW at confidence 0.0. That is stub behavior, not measured intelligence, and I record it as the control group for what follows. Second, roughly 1,300 events process in under a millisecond — about 1.77 million events per second on the raw single-run perf_counter timing (the table rounds to 0.1 ms; sub-millisecond figures are order-of-magnitude only, not a precise benchmark) — because lookup is a dictionary read. At this article's scale the deterministic part is free; streaming ingestion and window state will need their own measurement later, but the bulk of future latency and cost will come from the LLM step. Third, do not misread the 11–13% unknown share: the simulator's injection pool has eight codes, one of which (999) is a deliberately synthetic unknown, so the unknown rate is an artifact of pool design — one eighth by construction — not a field measurement of unknown codes in a real fleet.&lt;/p&gt;

&lt;p&gt;The repository's six bundled tests all pass when invoked directly (determinism, known-code lookup, unknown codes not guessed, stub routing to human review, report shape). This machine has no pytest installed, so I ran the test functions directly rather than through the runner; noted for accuracy.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.2 Lookup coverage: seven codes, everything else is "unknown"
&lt;/h3&gt;

&lt;p&gt;The table contains exactly seven codes: 13, 31, 48, 74, 79, 119, 120. Ten out-of-table probe codes (43, 45, 56, 63, 64, 68, 92, 94, 109, 154) all return None and are treated exactly like 999: severity unknown, known=False, routed to human review. The routing behavior is right — refusing to guess is this pipeline's most important safety property. The coverage is another matter: any XID outside those seven earns the operator exactly one piece of information, "an unknown error occurred, go look." The table was hand-seeded from public documents; extending it is unglamorous work, and section 4.3 argues it is still not the first thing to fix.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.3 Malformed data: one bad event poisons the batch
&lt;/h3&gt;

&lt;p&gt;The orchestrator extracts the code with int(event.payload["xid"]) — no validation, no per-event isolation. Mixing malformed events into good batches:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Injection&lt;/th&gt;
&lt;th&gt;Outcome&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;One well-formed event&lt;/td&gt;
&lt;td&gt;Completes, 1 verdict&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Good + missing xid key + good&lt;/td&gt;
&lt;td&gt;Entire run raises KeyError; completed verdicts are lost with it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Good + xid as a non-numeric string&lt;/td&gt;
&lt;td&gt;Entire run raises ValueError&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Good + xid=None&lt;/td&gt;
&lt;td&gt;Entire run raises TypeError&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;run() processes events in a list comprehension, so the first exception discards every verdict in the window. Translate to production: a dmesg parser will eventually emit a field-incomplete event, and when it does, the failure mode is not "one event undiagnosed" but "the whole window's verdicts vanish, as a process-level exception instead of a line in the report." Per-event isolation with a bad-record counter is table stakes for this kind of pipeline, and it is absent here.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.4 The fake-LLM experiment: the output contract is broken, and the model doesn't get a vote
&lt;/h3&gt;

&lt;p&gt;This is the experiment the article exists for. I implemented a fake provider that obeys the system prompt perfectly, returning JSON that recommends DRAIN_NODE at confidence 0.95 for XID 79 (GPU fallen off the bus). Wired into the orchestrator, the verdict's actual state:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Fake provider output&lt;/th&gt;
&lt;th&gt;Final verdict&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;action&lt;/td&gt;
&lt;td&gt;DRAIN_NODE&lt;/td&gt;
&lt;td&gt;NEEDS_HUMAN_REVIEW (unchanged)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;confidence&lt;/td&gt;
&lt;td&gt;0.95&lt;/td&gt;
&lt;td&gt;0.0 (unchanged)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;rationale&lt;/td&gt;
&lt;td&gt;The full JSON&lt;/td&gt;
&lt;td&gt;Appended verbatim as text, prefixed [LLM]&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The code makes the reason plain: the protocol returns a string, the orchestrator only concatenates it, nothing ever parses the JSON, and nothing overwrites the deterministic verdict. The prompt's output format and confidence gate are a gentlemen's agreement with the model that the code side never honors. Even if the real LangChain provider were implemented tomorrow and the model followed the format perfectly every time, the triage decision would remain 100% determined by the stub; the LLM's total influence would be a paragraph pasted into the rationale.&lt;/p&gt;

&lt;p&gt;The second half of the experiment is evidence thickness. The exact evidence string the orchestrator assembles is: node=node-00 gpu=0 xid=79 name=GPU has fallen off the bus severity=critical ts=. That is all. The lookup entry has category and notes fields — including remediation hints and sourcing notes — and neither enters the evidence. The same GPU's thermal and ECC readings cannot enter it either, because the evidence is built inside the per-event triage function, whose signature has no window context at all. The prompt's first rule orders the model to cite only the evidence provided. The pipeline starves the evidence down to a restatement of the error name, then forbids the model from reaching beyond it. If the model gives an informative answer anyway, it can only do so by breaking the rule. That contradiction is a wiring decision, not a model defect.&lt;/p&gt;

&lt;p&gt;Third: fault propagation. Replace the provider with one that always raises RuntimeError, and triage_event lets the exception straight through — the whole run dies, the same death as section 3.3. A provider is an external dependency; timeouts, rate limits, and network jitter are its normal weather. An optional reasoning step should degrade to the deterministic verdict, never take the batch down with it. There is no degradation path here.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.5 The prompt path is coupled to the working directory
&lt;/h3&gt;

&lt;p&gt;The orchestrator loads the prompt with a relative path, open("prompts/triage_system.md"). From the repository root it works. From /tmp, the identical code raises FileNotFoundError immediately. (The LangChain provider raising NotImplementedError on construction is an honest stub, not a defect.) The relative path is the kind of bug that bites exactly once, in production: services started by systemd, containers, or schedulers rarely have the repository root as their working directory, while a developer's terminal always does — which is why it never reproduces at a desk.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.6 No memory, and corroboration blindness: two failure modes with one root
&lt;/h3&gt;

&lt;p&gt;Repeat faults do not escalate. Three XID 79 events on the same GPU within three hours produce three verdicts that have never heard of each other: same action, same confidence, same rationale. Causality, stated precisely: the identical verdicts are directly caused by the decision tree being a stub — any architecture would produce them today. The architectural problem sits one layer down. The stub's own comments sketch the intended real rule — XID 79 twice in 24 hours on one GPU should mean drain plus reboot — but the orchestrator triages events one at a time, statelessly, so even once that rule is written, the pipeline has nowhere to put it. This is not only a missing rule; it is missing state.&lt;/p&gt;

&lt;p&gt;Corroborating signals are filtered out by the pipeline itself. I built a three-event window by hand: one GPU reports an ECC double-bit error count of 17, then a temperature of 104 °C, then XID 13. The prompt's second rule says app-level faults like XID 13/31 should not trigger a drain recommendation without corroborating evidence — which implies corroboration should change the judgment when present. The measured result: three events in, one verdict out. The two non-XID events are dropped at the extraction stage; they produce no verdicts and are never attached to the XID 13 verdict as context. At baseline scale this is 1,024 of 1,285 events in the 64-node window. The pipeline demands corroboration-aware reasoning in its prompt while deleting the corroboration from its data path.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Analysis and trade-offs
&lt;/h2&gt;

&lt;h3&gt;
  
  
  4.1 Deterministic first, LLM second — and the order is not negotiable
&lt;/h3&gt;

&lt;p&gt;The scaffold's best judgment call is its layering: lookup and rules in a deterministic core, the LLM as a downstream reasoning supplement, and — until the decision tree exists — everything routed to humans with an honest confidence of 0. The reasoning is simple. Drain, reset, reboot, and RMA are real operations on production hardware. Anything a table or a rule can decide should never be improvised by a probabilistic model at 3 a.m.; the LLM's value is synthesis and explanation, not authority.&lt;/p&gt;

&lt;p&gt;Section 3.4 yields a counterintuitive corollary: the broken output contract is currently an accidental safety net. Because the model's JSON is never parsed into the verdict, a hallucinating model today can pollute a rationale but cannot drain a node. But it is an accident, not a design. The correct fix is not to preserve the break; it is to add parsing plus validation — actions must land inside the site's runbook vocabulary, confidence below 0.7 must be rewritten to human review in code (the prompt already states this rule; move it from prose into the program), and parse failure must degrade to the deterministic verdict alone. Whoever wires up the parsing without the validation has personally removed the safety net.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.2 The failure-mode list, in fix order
&lt;/h3&gt;

&lt;p&gt;None of the six failure modes needs a better model or a better prompt. All six are ordinary engineering, and I would fix them in this order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Per-event isolation. Wrap each event's triage in exception handling; count and surface bad records in the report. Batch survival comes before everything else.&lt;/li&gt;
&lt;li&gt;Honor the output contract. JSON parsing, vocabulary validation, and the confidence gate in code, per section 4.1.&lt;/li&gt;
&lt;li&gt;Evidence assembly. Include the lookup's category and notes, and pass the triage function a per-GPU window summary — recent same-code counts, thermal and ECC extremes — so the prompt's "cite only the evidence" rule becomes executable.&lt;/li&gt;
&lt;li&gt;A state layer. Repeat counting and escalation need window-level aggregation, which means restructuring from stateless per-event triage to aggregate-then-triage. It is an architectural change, so it goes after the contract and evidence fixes.&lt;/li&gt;
&lt;li&gt;Resource paths and graceful degradation. Load the prompt as a package resource or absolute path; wrap provider calls with timeout and exception handling that fall back silently — but visibly in the report — to the deterministic verdict.&lt;/li&gt;
&lt;li&gt;Corroboration plumbing. Stop discarding non-XID events at extraction; attach them to the same GPU's XID verdicts as context. It shares a root with item 3 but is listed separately: item 3 changes the evidence template, this one changes the data path.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Extending the lookup table is deliberately not on this list. It is data-dictionary work, not a failure mode; seven codes is thin coverage and the table should grow — after these six, because without them a 70-code table still dies batch-wide on the first malformed event.&lt;/p&gt;

&lt;h3&gt;
  
  
  4.3 A judgment: trustworthiness in systems like this comes from restraint, not from the model
&lt;/h3&gt;

&lt;p&gt;The design choices I would defend most strongly in this scaffold are the things it refuses to do. Unknown codes are not assigned invented meanings. An unfinished decision tree issues no actions. Simulated data is labeled SIMULATED from the generator to the report header. The stub raises NotImplementedError instead of returning a fabricated rationale. Together these refusals make every output auditable: for any line in the report you can tell whether it came from the table, a rule, or a model. That is precisely what gets lost first when an LLM is bolted onto an operations system — once fluent model prose washes over the deterministic core's true state, the on-call engineer can no longer tell what was looked up from what was made up, and the report stops deserving trust. All six failure modes point at the same repair: make the model's scope, evidence, and failure behavior explicit in code, not implied by prompt wording.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Limitations and open questions
&lt;/h2&gt;

&lt;p&gt;The limitations are material. First, all telemetry is synthetic, generated by the bundled simulator; its distributions are set by injection probabilities and the injection pool, so every proportion in this article validates pipeline behavior only and says nothing about fault distributions in a real fleet. Second, the LLM experiments use a local fake provider and verify wiring contracts and fault propagation; no real model was called, so this article makes no claim about any model's reasoning quality. How often a real model, fed evidence this thin, would reach beyond it and fabricate is a separate measurement that requires wiring one up. Third, the scale ceiling here is 64 nodes and about 1,300 events on a single VM; concurrent ingestion, persistence, and alerting channels are untested. Fourth, lookup coverage is reported as table size plus out-of-table probes; I did not diff the table against NVIDIA's complete published catalog, so no coverage denominator is claimed.&lt;/p&gt;

&lt;p&gt;Three open questions remain. The aggregation grain for the state layer — per GPU, per node, or per NVLink domain — implies different escalation rules and false-positive costs, and calibrating it needs real fault sequences. The 0.7 confidence gate in the draft prompt was picked, not calibrated; once a real model is wired in, it should be set by replaying historical tickets. And once corroborating evidence enters triage, the baseline thermal and ECC stream is roughly four times the XID volume — what evidence assembly costs in tokens and context length has to be measured when the real model arrives.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;AI-Node-Sentinel source (version measured here): github.com/Ezra-Zhao/AI-Node-Sentinel — key files: agent/orchestrator.py (orchestration and evidence assembly), agent/llm.py (LLMProvider protocol and LangChain stub), agent/schemas.py (data types), tools/xid_lookup.py (lookup table), tools/triage_rules.py (decision-tree stub), prompts/triage_system.md (draft system prompt), telemetry/simulator.py (simulator).&lt;/li&gt;
&lt;li&gt;Experiment scripts and raw data for this article: data/2026-10-14-sentinel-bench.py and data/2026-10-14-sentinel-bench.json, archived with this article; every number can be re-checked by re-running the script.&lt;/li&gt;
&lt;li&gt;NVIDIA, Xid Errors documentation: docs.nvidia.com/deploy/xid-errors — the authoritative source for the lookup metadata, also cited in the header of tools/xid_lookup.py.&lt;/li&gt;
&lt;li&gt;Google Cloud, Troubleshooting GPU issues: cloud.google.com/compute/docs/troubleshooting/troubleshooting-gpus — cross-check source for the lookup table, as above.&lt;/li&gt;
&lt;/ol&gt;







&lt;p&gt;&lt;strong&gt;Support &amp;amp; follow&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub Sponsors: &lt;a href="https://github.com/sponsors/Ezra-Zhao" rel="noopener noreferrer"&gt;https://github.com/sponsors/Ezra-Zhao&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Telegram — Code &amp;amp; Psalms channel: &lt;a href="https://t.me/EzraZhao777" rel="noopener noreferrer"&gt;https://t.me/EzraZhao777&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Newsletter — Code &amp;amp; Psalms on beehiiv: &lt;a href="https://codeandpsalms.beehiiv.com" rel="noopener noreferrer"&gt;https://codeandpsalms.beehiiv.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>devops</category>
      <category>hardware</category>
      <category>llm</category>
    </item>
    <item>
      <title>Letting an AI Agent Drive Ghidra: A Hands-On Test of REA's 170 MCP Tools, One Recovered Password, and the Limits</title>
      <dc:creator>Guangyi Zhao</dc:creator>
      <pubDate>Fri, 06 Nov 2026 02:29:03 +0000</pubDate>
      <link>https://dev.to/ezrazhao/letting-an-ai-agent-drive-ghidra-a-hands-on-test-of-reas-170-mcp-tools-one-recovered-password-38jg</link>
      <guid>https://dev.to/ezrazhao/letting-an-ai-agent-drive-ghidra-a-hands-on-test-of-reas-170-mcp-tools-one-recovered-password-38jg</guid>
      <description>&lt;h1&gt;
  
  
  Letting an AI Agent Drive Ghidra: A Hands-On Test of REA's 170 MCP Tools, One Recovered Password, and the Limits
&lt;/h1&gt;

&lt;p&gt;Author: Guangyi Zhao&lt;br&gt;
Date: 2026-10-13&lt;br&gt;
Subject: morluto/rea (REA: Reverse Engineer Anything), npm package rea-agents 6.4.0, MIT license&lt;br&gt;
Environment: Ubuntu 24.04 (Linux x64), Node 24.20; target is an ELF built from my own C source&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Problem and background
&lt;/h2&gt;

&lt;p&gt;Reverse-engineering an unfamiliar binary the traditional way means sitting in front of Ghidra, paging through assembly, following cross-references, guessing what each function does, and writing the conclusions down by hand. The slowness is not even the worst part. The worst part is how easily conclusions drift away from evidence: three days later I reread my own notes and cannot reconstruct what I actually saw when I wrote a given claim.&lt;/p&gt;

&lt;p&gt;REA proposes a different division of labor. It does not implement decompilation itself. Instead, it standardizes the operating surface of reverse-engineering tools as MCP tools, so agents such as Claude Code, Codex, Cursor, or Gemini CLI can drive them directly: the agent asks the question, opens the binary, lists functions, pulls pseudocode, checks references, runs the target and diffs its behavior, then comes back with evidence attached. The human's job shifts from paging through assembly to asking the right questions and auditing the evidence chain.&lt;/p&gt;

&lt;p&gt;Is that division real, or does it only demo well? I spent a day running it end to end, from install to password recovery, and I did not dodge the failures. Every number below comes from that day's logs and Evidence JSON files, and I re-checked each one against the raw files before finalizing this article. Anything I could not verify is either deleted or explicitly labeled as inference.&lt;/p&gt;

&lt;p&gt;One ground rule up front: the only program analyzed here is one I wrote myself. The legal boundary is covered in Section 5, and it is not filler.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Method and architecture
&lt;/h2&gt;

&lt;p&gt;REA is easiest to understand in four layers.&lt;/p&gt;

&lt;p&gt;The first is the agent access layer. &lt;code&gt;rea mcp&lt;/code&gt; starts an MCP server over stdio. I performed a real JSON-RPC handshake: &lt;code&gt;initialize&lt;/code&gt; succeeded and &lt;code&gt;tools/list&lt;/code&gt; returned 170 tools, with names like &lt;code&gt;open_binary&lt;/code&gt;, &lt;code&gt;analyze_function&lt;/code&gt;, &lt;code&gt;batch_decompile&lt;/code&gt;, and &lt;code&gt;inspect_binary_layout&lt;/code&gt;. &lt;code&gt;npx rea-agents setup&lt;/code&gt; registers the server with the agent client you choose and installs an investigation-workflow skill that teaches the agent what to check first, what to check next, and how to follow up when the evidence is thin.&lt;/p&gt;

&lt;p&gt;The second is the workflow layer, shared by the CLI and MCP. The CLI exposes a hundred-plus commands — &lt;code&gt;analyze&lt;/code&gt;, &lt;code&gt;function&lt;/code&gt;, &lt;code&gt;decompile&lt;/code&gt;, &lt;code&gt;xrefs&lt;/code&gt;, &lt;code&gt;search&lt;/code&gt; for native analysis; &lt;code&gt;capture-process&lt;/code&gt; for behavior capture; &lt;code&gt;compare-process-captures&lt;/code&gt; for diffing two runs. The only difference is invocation: the CLI is a fresh process per call with results saved to disk, while MCP is a persistent session.&lt;/p&gt;

&lt;p&gt;The third is the analysis-engine layer, and the most commonly misunderstood. Deep native analysis — decompiled pseudocode, function dossiers — is not implemented by REA. It bridges to one of three existing engines: Ghidra, through a Java bridge script (ReaGhidraBridge) running headless and talking over a local unix socket, requiring Ghidra 12.1.x; Hopper, through a Python bridge; and IDA, through IDA's own MCP registration, bring-your-own-license and bring-your-own-instance. REA is MIT-licensed, but that license grants you no commercial engine. IDA and Hopper still cost what they cost. Ghidra is free, which is why it is the route tested here.&lt;/p&gt;

&lt;p&gt;A separate set of capabilities needs none of those engines: offline ELF layout parsing (through a Python environment you supply, pinned to pwntools 4.15.0, pyelftools 0.33, and Unicorn 2.1.2; read-only parsing of sections, segments, symbols, relocations, and mitigations, never executing the target), inspection of metadata embedded in Go binaries, purely static parsing of JavaScript and .NET files, and process behavior capture that actually runs the target under a PTY.&lt;/p&gt;

&lt;p&gt;The fourth layer is the evidence layer, and in my judgment it is the real design center. Every call returns a structured Evidence record: an &lt;code&gt;evidence_id&lt;/code&gt;, the target file's SHA-256, the provider and its version, the raw and normalized results, a confidence label such as observed or inferred, and an explicit list of limitations — what was not checked and what is inferred rather than seen. REA deliberately refuses to hand you a verdict. That is a different temperament from one-click report generators, and it is what makes automated follow-up questions defensible: every step can be traced back to specific evidence and open items.&lt;/p&gt;

&lt;p&gt;Two further design notes. According to REA's own documentation, analysis runs entirely on your machine and target files are not uploaded to REA's servers. I did not verify that with packet capture, so treat it as a vendor claim, not a measurement — and note that what your agent does with tool results afterward is governed by your model provider's data policy, which is a separate question. The claimed target coverage is broad: beyond native binaries it lists Go, .NET, JavaScript/Electron, Android APKs, firmware, WASM, EVM bytecode, SQLite, pcap files, and crash dumps. This article tests exactly one of those lanes, native ELF, and draws no conclusions about the rest.&lt;/p&gt;

&lt;p&gt;The target, &lt;code&gt;checkme&lt;/code&gt;, is 30 lines of my own C: it takes a key on the command line, and &lt;code&gt;check_key()&lt;/code&gt; first compares the length, then XORs the input byte-by-byte against a built-in constant and accumulates; only a zero sum passes. I built a symbolled and a stripped version. The correct key is 13 bytes. The question for the day: starting from "we do not know the answer," how far does this toolchain get, and at which step does a human — or an agent — still have to actually think?&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Measurements
&lt;/h2&gt;

&lt;h3&gt;
  
  
  3.1 Readiness check: half the tool works out of the box
&lt;/h3&gt;

&lt;p&gt;Installing &lt;code&gt;rea-agents&lt;/code&gt; globally (version 6.4.0) took about 1 minute 51 seconds. &lt;code&gt;rea doctor&lt;/code&gt; was refreshingly honest: Node and the host were healthy, but all three deep engines — Hopper, Ghidra, IDA — were missing, and the workflow skill was not installed. Out of the box you get only the built-in capabilities; deep decompilation requires bringing an engine. Doctor spelled out what was missing and how to fix each item, which already puts it ahead of tools that hand you a stack trace.&lt;/p&gt;

&lt;p&gt;One piece of friction runs through everything: every rea command cold-starts in roughly 20 to 30 seconds, &lt;code&gt;rea --help&lt;/code&gt; included. I did not profile where that time goes; my guess is Node loading the full tool catalog at startup, but that is a guess and I am labeling it as one. If you explore interactively at the rhythm you would use in Ghidra's GUI, this will wear on you. The tool rewards deciding your questions first and fetching evidence in batches.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.2 Offline ELF layout: the manual jigsaw, done in one pass
&lt;/h3&gt;

&lt;p&gt;I created a Python venv with pwntools — the versions landed exactly on REA's pins — pointed &lt;code&gt;REA_PWNTOOLS_PYTHON&lt;/code&gt; at it, and ran &lt;code&gt;rea inspect-binary-layout ./checkme --json&lt;/code&gt;. About 22 seconds later I had roughly 45 KB of Evidence JSON. I reopened that file while finalizing this article; the numbers are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;31 sections, 13 segments, 48 symbols, 11 relocations, with the file anchored by SHA-256;&lt;/li&gt;
&lt;li&gt;mitigations matching the build reality item by item: PIE on, NX on, non-executable stack, Full RELRO, and no stack canary — correct, because the source has no local arrays. The whole set is labeled inferred rather than observed, which is the honest label;&lt;/li&gt;
&lt;li&gt;a symbol table that names &lt;code&gt;main&lt;/code&gt;, &lt;code&gt;check_key&lt;/code&gt;, and &lt;code&gt;strlen&lt;/code&gt; outright, so you know where to start;&lt;/li&gt;
&lt;li&gt;12 limitations attached, including that link-time addresses are not runtime addresses and that relocation inventory completeness is unknown. Nothing swept under the rug.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This replaces the manual &lt;code&gt;checksec&lt;/code&gt;-plus-&lt;code&gt;readelf&lt;/code&gt; jigsaw with one structured pass. Repeating it on the stripped binary left only 9 dynamic symbols — the libc imports — with &lt;code&gt;check_key&lt;/code&gt; and &lt;code&gt;main&lt;/code&gt; gone. That is expected, and it draws the boundary of this lane precisely: layout only, no function recovery.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.3 Behavior diffing: locate the divergence before reading code
&lt;/h3&gt;

&lt;p&gt;Next, black-box capture. I ran &lt;code&gt;rea capture-process&lt;/code&gt; once with a wrong key and once with the right one (about 30 seconds each, PTY startup included) and diffed them with &lt;code&gt;rea compare-process-captures&lt;/code&gt;. The result names a first_divergence: terminal event 0, ACCESS DENIED on the left, ACCESS GRANTED on the right, with the exit dimension also marked changed. I checked the raw comparison JSON; its confidence is labeled derived — a conclusion computed from two captures rather than a single observation — which is the correct label.&lt;/p&gt;

&lt;p&gt;On a toy target this looks trivial. The value is the ordering habit: confirm behaviorally which input decides success before you open the static analysis. Get the order right and you skip a lot of wandering later.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.4 Ghidra deep analysis: it worked — the second time
&lt;/h3&gt;

&lt;p&gt;First, the setup bill, because it is real: this machine had no Java. Temurin JDK 21 (198 MB, about 2 minutes) plus the Ghidra 12.1 release (542 MB, about 10 minutes), roughly 874 MB unpacked, plus &lt;code&gt;GHIDRA_INSTALL_DIR&lt;/code&gt; and &lt;code&gt;JAVA_HOME&lt;/code&gt; to set. Call it about 740 MB of downloads before the deep lane opens. Any honest evaluation has to count that.&lt;/p&gt;

&lt;p&gt;Then &lt;code&gt;rea analyze ./checkme --provider ghidra --json&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Attempt one: about 3 minutes 26 seconds, failed with error code &lt;code&gt;cleanup_incomplete&lt;/code&gt;. Ghidra's own log showed import and post-analysis succeeding, but REA's teardown refused to confirm cleanup because the process tree contained orphaned or PID-reused processes, and failed the whole run. My inclination is that its process-ownership checking clashed with this containerized environment, but I did not root-cause it — container PID namespaces and process reaping were never individually ruled out — so this is recorded as an unlocalized failure, not an explained one. No workaround was applied and it is not reported as a success.&lt;/li&gt;
&lt;li&gt;Attempt two: about 2 minutes 50 seconds, success — with a caveat. The overview's normalized result is only about 2.7 KB (the saved JSON file is about 4.4 KB): segment layout plus counts. It counted 30 procedures and 80 strings and gave pseudocode for none of them. Deep answers require naming the function you want.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So I named it: &lt;code&gt;rea function ./checkme check_key --provider ghidra --json&lt;/code&gt; took about 2 minutes 42 seconds and returned a roughly 52 KB dossier with three things that matter. First, decompiled pseudocode matching the source logic line for line, with placeholder names like &lt;code&gt;param_1&lt;/code&gt; and &lt;code&gt;DAT_00102004&lt;/code&gt;: compare &lt;code&gt;strlen&lt;/code&gt; against 0xd — 13 — then XOR the input byte-by-byte against the constant at &lt;code&gt;DAT_00102004&lt;/code&gt; and accumulate; pass only if the sum is zero. Second, the full assembly listing: a 76-byte function body at 0x101189–0x1011d4, which I verified against the raw JSON. Third, the call graph edges: caller &lt;code&gt;main&lt;/code&gt; at 0x1011d5, callee the &lt;code&gt;strlen&lt;/code&gt; PLT thunk, with incoming reference addresses.&lt;/p&gt;

&lt;p&gt;That closed the loop. Within this target's value range — password and constant are plain ASCII, so every XOR result lands between 0 and 127 — a zero sum is equivalent to byte-for-byte equality, so the 13 bytes at that address are the key; I read them out by file offset and confirmed. One precision worth adding: the pseudocode accumulates the XOR result truncated to a char, so with high-bit bytes, signed interpretation could in theory let several mismatches cancel out to zero. As a teaching target this check is fine; as a real password check it would be an exploitable weakness, and "sum equals zero" should never be mistaken for a cryptographic equality test. From opening an unfamiliar binary to recovering both the checking logic and the key, no human read any assembly. For completeness: with no engine configured, the same analyze command fails politely — a structured &lt;code&gt;provider_unavailable&lt;/code&gt; error with remediation guidance instead of a crash.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.5 The MCP channel, and the full timing table
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;rea mcp&lt;/code&gt; runs over stdio; the JSON-RPC &lt;code&gt;initialize&lt;/code&gt; handshake succeeded, the server identifies as rea 6.4.0, and &lt;code&gt;tools/list&lt;/code&gt; returned 170 tools. Scope discipline matters here: 170 is the catalog size. The tools I actually exercised and verified are a small subset — binary opening, layout inspection, behavior capture and comparison, Ghidra analysis, and the function dossier. The other 160-plus tools are unverified by this article, and a directory count must not be passed off as capability verification. Within the subset I used, CLI and MCP are two front doors to the same workflows.&lt;/p&gt;

&lt;p&gt;Full run log, all from that day:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Shallow repo clone (56 MB): success, about 28 s&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;npm i -g rea-agents&lt;/code&gt;: success, about 1 min 51 s&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rea doctor&lt;/code&gt;: success, three engines reported missing, about 30 s&lt;/li&gt;
&lt;li&gt;Offline ELF layout, symbolled and stripped: both success, about 22 s each&lt;/li&gt;
&lt;li&gt;Process capture twice plus comparison: success, first behavioral divergence pinpointed, about 30 s each&lt;/li&gt;
&lt;li&gt;Analyze with no engine configured: failed cleanly with &lt;code&gt;provider_unavailable&lt;/code&gt;, as expected, about 23 s&lt;/li&gt;
&lt;li&gt;JDK 21 plus Ghidra 12.1 download and unpack: success, about 740 MB, about 14 min&lt;/li&gt;
&lt;li&gt;Ghidra analyze, attempt one: failed, &lt;code&gt;cleanup_incomplete&lt;/code&gt; (engine analysis succeeded, teardown verification failed), about 3 min 26 s&lt;/li&gt;
&lt;li&gt;Ghidra analyze, attempt two: success, segment-level overview only, about 2 min 50 s&lt;/li&gt;
&lt;li&gt;Ghidra function dossier for check_key: success, logic fully recovered, about 2 min 42 s&lt;/li&gt;
&lt;li&gt;MCP initialize plus tools/list: success, 170 tools, about 23 s&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Analysis and trade-offs
&lt;/h2&gt;

&lt;p&gt;Where the division of labor genuinely holds: it splits the Ghidra learning curve into two stages. First you understand what a function does by questioning an agent that fetches evidence; then you learn the tool itself against the assembly and pseudocode you already understand. For anyone studying malware analysis or binary fundamentals, that order beats staring at an empty Ghidra window. Behavior diffing is the second habit worth stealing: behavior first, statics second is the same discipline as comparing normal and anomalous samples in dynamic analysis.&lt;/p&gt;

&lt;p&gt;Four selection judgments for anyone evaluating this stack:&lt;/p&gt;

&lt;p&gt;First, Ghidra versus IDA. REA does not change either engine's economics. Ghidra is free and headless-friendly; the price is the setup bill above and minute-scale calls. IDA's recovery quality and ecosystem are their own argument, but the license is yours to buy — REA's MIT license does not extend to it. My recommended order: teams that already hold IDA licenses should use that integration; everyone else should get the workflow running on Ghidra first.&lt;/p&gt;

&lt;p&gt;Second, CLI versus MCP. For one-off scripts and auditable reruns, use the CLI; evidence on disk is naturally traceable. For multi-step investigations where an agent keeps asking follow-ups, use MCP. A persistent session should amortize repeated cold starts in theory — but I did not measure per-call latency inside a session, and the handshake alone took about 23 seconds, the same order as a single CLI call. So "MCP is faster" is an architectural expectation in this article, not a measured result; measure session latency yourself before choosing on speed. Also, a persistent session means evidence management depends on session semantics; do not mix the two modes' outputs in one folder and expect clean accounting.&lt;/p&gt;

&lt;p&gt;Third, is the evidence contract worth its verbosity? Every result carrying limitations and a confidence label looks like overhead until you are the reviewer: you no longer have to guess which sentence was observed and which was inferred. In report-writing, delivery, or graded casework, that verbosity is net profit. For a one-off glance at a binary, it is pure cost. Know which mode you are in.&lt;/p&gt;

&lt;p&gt;Fourth, and most important: every step that requires judgment was left to the caller, by design. Understanding the pseudocode's semantics — why a zero XOR sum means byte equality here, and when it would not — was the caller's work. Deciding to read the bytes at &lt;code&gt;DAT_00102004&lt;/code&gt; was the caller's work. Translating length 0xd into 13 characters was the caller's work. REA supplies evidence and open items; the conclusion belongs to whoever called it, and an agent that misreads pseudocode will produce a wrong conclusion that looks thoroughly evidenced. "Agent plus REA" does not mean unmanned reverse engineering. It means automated evidence collection with judgment still on the human side — and anyone who quietly drops the second half of that sentence will eventually be bitten by it.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Limitations and open questions
&lt;/h2&gt;

&lt;p&gt;Measured limitations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cold starts are slow: 20 to 30 seconds per CLI command, and Ghidra-backed calls are measured in minutes. Function-level answers must be requested one function at a time, so cost grows roughly linearly with function count. I did not test full deep analysis of a large binary and will not extrapolate to one.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;analyze&lt;/code&gt; overview is shallow by design — layout and counts only. If you expect one command to hand you function-level conclusions, you will be disappointed; the design pushes you to arrive with a question and fetch named evidence.&lt;/li&gt;
&lt;li&gt;Against stripped, packed, or obfuscated targets, the layout lane degrades to dynamic symbols, and the deep lane inherits whatever recovery ability the engine itself has. REA adds no magic. My target was an unobfuscated program I wrote, so this article has no standing to quote recovery rates on real-world samples.&lt;/li&gt;
&lt;li&gt;The process-ownership check failed once on containerized Linux with &lt;code&gt;cleanup_incomplete&lt;/code&gt; and passed on retry. Unattended batch runs need retries and failure logging budgeted in; do not assume a 100 percent first-pass success rate.&lt;/li&gt;
&lt;li&gt;Only the native ELF lane was tested. APK, firmware, WASM, EVM, and the rest of the coverage list went unexercised, and unexercised means unjudged.&lt;/li&gt;
&lt;li&gt;The ceiling on conclusion quality is the agent and the human reviewing it. Evidence chains can skip steps and pseudocode can be misread, and such errors arrive wearing Evidence IDs, which makes them look more credible, not less. That is the most dangerous failure mode in the whole setup.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Legal and compliance boundaries, which are not optional:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Analyze only software you own or are explicitly authorized to analyze: your own programs, CTF and lab targets, samples you purchased under terms that allow it, client deliverables with written authorization.&lt;/li&gt;
&lt;li&gt;Unauthorized reverse engineering of commercial software can trip three wires at once: anti-reverse-engineering clauses in the EULA; DMCA Section 1201 anti-circumvention rules, where bypassing a technical protection measure can be unlawful in itself and legitimate purposes have only bounded exceptions; and unauthorized-access statutes. REA's own DISCLAIMER takes the same line: lawful research, education, interoperability, and software preservation.&lt;/li&gt;
&lt;li&gt;Commercial engine licenses are yours to obtain legitimately, and trial-license restrictions on automation and sharing outputs apply in full.&lt;/li&gt;
&lt;li&gt;Practical rule: learn on crackmes, CTF challenges, and programs you wrote — exactly what this article does. At work, with a client binary, confirm the authorization paperwork is in hand before you touch anything.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Open questions I am leaving for follow-up measurements rather than pre-spending conclusions: recovery-quality differences on the same target with the IDA provider, deep-lane behavior on a packed sample, and the context cost of accumulated evidence in long MCP sessions.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. References and sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;REA repository and documentation: morluto/rea (MIT), npm package rea-agents 6.4.0; architecture descriptions checked against its README, docs, and the ReaGhidraBridge sources under bridge/ghidra.&lt;/li&gt;
&lt;li&gt;Primary test materials: target source checkme.c (30 lines, my own), and the Evidence JSON files — layout_checkme.json (31 sections, 13 segments, 48 symbols, 11 relocations; provider pwntools 4.15.0 / pyelftools 0.33 / Unicorn 2.1.2), layout_stripped.json (9 dynamic symbols), capture_compare.json (first_divergence at terminal event 0), ghidra_func_checkkey.json (check_key dossier, Ghidra 12.1, 76-byte body at 0x101189–0x1011d4). Each was re-opened and re-checked before this article was finalized.&lt;/li&gt;
&lt;li&gt;Engine versions: Ghidra 12.1 PUBLIC, Temurin JDK 21, Node 24.20, Ubuntu 24.04.&lt;/li&gt;
&lt;li&gt;Legal reference: DMCA anti-circumvention provisions, 17 U.S.C. § 1201. Consult a lawyer for specific cases; this article is not legal advice.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Disclosure: All code, target programs, and experiments in this article are the author's own clean-room work. The experiments were run only against the author's own program. No client information, client code, or unauthorized software is involved in any way.&lt;/p&gt;

&lt;p&gt;Author: Guangyi Zhao&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How Big Should the Worker Pool Be? Measuring the Concurrency Model of a Go Diagnostics Engine</title>
      <dc:creator>Guangyi Zhao</dc:creator>
      <pubDate>Thu, 05 Nov 2026 21:58:19 +0000</pubDate>
      <link>https://dev.to/ezrazhao/how-big-should-the-worker-pool-be-measuring-the-concurrency-model-of-a-go-diagnostics-engine-20ki</link>
      <guid>https://dev.to/ezrazhao/how-big-should-the-worker-pool-be-measuring-the-concurrency-model-of-a-go-diagnostics-engine-20ki</guid>
      <description>&lt;h1&gt;
  
  
  How Big Should the Worker Pool Be? Measuring the Concurrency Model of a Go Diagnostics Engine
&lt;/h1&gt;

&lt;p&gt;Author: Guangyi Zhao&lt;br&gt;
Date: 2026-10-13&lt;br&gt;
Subject: Go-Diagnoser-Engine (open source, github.com/Ezra-Zhao/Go-Diagnoser-Engine), Go 1.24, zero third-party dependencies&lt;br&gt;
Test setup: Linux x86_64 VM, 2 vCPUs, server and load client on the same host&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Problem and background
&lt;/h2&gt;

&lt;p&gt;Running diagnostics against a fleet of nodes has two failure modes callers hate. Wait synchronously and one slow check hangs the request. Spawn goroutines without limits and a traffic spike takes the service itself down before any node gets diagnosed. So I built Go-Diagnoser-Engine as an asynchronous service: POST /api/v1/diagnose submits a job and returns a job ID, GET /api/v1/jobs/{id} is polled for structured results. Execution sits behind a bounded worker pool fed by a bounded queue, and the checks inside one job fan out in parallel.&lt;/p&gt;

&lt;p&gt;The structure is easy to write. The numbers are the hard part. How many workers? How deep a queue? Does a job with three checks cost three times the latency of a one-check job, or roughly the same? When the queue fills up, do you block or reject — and can you predict the rejection count in advance? This article answers those questions by actually loading the service, then goes back to the source to judge which design choices the data supports and which ones only looked reasonable while I was typing them.&lt;/p&gt;

&lt;p&gt;One disclosure up front, because everything else depends on it: the project is a scaffold, and its README says so. The three registered checks (connectivity, disk_usage, service_health) are simulated — each sleeps a random 50–200 ms and passes with 90% probability, and every result is labeled SIMULATED. The real probes (ICMP/TCP, disk scraping, /healthz queries) are still TODOs in the code. So this article measures the concurrency skeleton, not diagnostic ability. The throughput, latency, backpressure, and race behavior below are real measurements; swap in real probes and some of the numbers will move. Section 5 spells out which conclusions break first.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Method and architecture
&lt;/h2&gt;

&lt;p&gt;The codebase is 523 lines across 6 Go files. go.mod contains a module path and a Go version and nothing else — no third-party dependencies. cmd/server is the entrypoint: it reads PORT, WORKERS, and QUEUE_SIZE, wires the parts together, and owns graceful shutdown. internal/api holds the net/http routes, registered with Go 1.22 method-and-pattern syntax. internal/engine is the worker pool and check registry. internal/store is a concurrency-safe in-memory job store. pkg/models holds the shared types.&lt;/p&gt;

&lt;p&gt;Four concurrency decisions, all deliberate:&lt;/p&gt;

&lt;p&gt;First, a fixed worker pool instead of a goroutine per request. Workers are long-lived goroutines; the pool size defaults to runtime.NumCPU() and is overridable via WORKERS. The concurrency ceiling is a deployment parameter, not something that drifts with traffic.&lt;/p&gt;

&lt;p&gt;Second, a bounded queue with fail-fast submission. Submit uses a non-blocking select: if the queue is full, the API returns 503 immediately instead of parking the HTTP request. The cost is pushed to the caller, who must retry. Whether that trade is fair is a data question, answered in section 3.3.&lt;/p&gt;

&lt;p&gt;Third, per-job fan-out. runJob starts one goroutine per check and collects results into a preallocated slice indexed by check position — each goroutine writes only its own slot, so there is no mutex and no result channel to drain. A sync.WaitGroup joins them, and each check runs under its own 30-second context timeout so one slow probe cannot stall the whole job.&lt;/p&gt;

&lt;p&gt;Fourth, cooperative shutdown. On SIGINT or SIGTERM, main closes the HTTP server (15-second budget), then engine.Shutdown cancels the engine context and waits for workers to drain, also capped at 15 seconds.&lt;/p&gt;

&lt;p&gt;Method: I copied the repository verbatim into a scratch directory and built it (8.7 MB binary; 11 MB with -race). A Python load script, archived with the raw results alongside this article, ran four experiments. A: 30 one-check jobs and 30 three-check jobs submitted sequentially, comparing end-to-end latency. B: 60 three-check jobs submitted concurrently at pool sizes 1, 2, 4, and 8, measuring wall time and completions per second. C: queue squeezed to 5 with a single worker, a burst of 30 concurrent submissions, counting 202s against 503s. D: the race-detector build under 100 concurrent jobs with aggressive polling, plus a SIGTERM shutdown check.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Measurements
&lt;/h2&gt;

&lt;h3&gt;
  
  
  3.1 Fan-out is real: three checks cost 19% more, not 200%
&lt;/h3&gt;

&lt;p&gt;Experiment A (30 jobs per row, 4 workers):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Configuration&lt;/th&gt;
&lt;th&gt;Mean end-to-end&lt;/th&gt;
&lt;th&gt;p50&lt;/th&gt;
&lt;th&gt;p95&lt;/th&gt;
&lt;th&gt;Mean per-check latency&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;One check (connectivity only)&lt;/td&gt;
&lt;td&gt;139.8 ms&lt;/td&gt;
&lt;td&gt;151.5 ms&lt;/td&gt;
&lt;td&gt;198.6 ms&lt;/td&gt;
&lt;td&gt;135.6 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Three checks (all)&lt;/td&gt;
&lt;td&gt;166.5 ms&lt;/td&gt;
&lt;td&gt;169.9 ms&lt;/td&gt;
&lt;td&gt;201.9 ms&lt;/td&gt;
&lt;td&gt;126.0 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Tripling the checks raised mean end-to-end latency by 19%. Had the fan-out secretly been serial, three checks would have landed near three times a single latency, around 400 ms. The numbers also agree with theory. A single check is uniform on 50–200 ms; a parallel job finishes with its slowest check, whose expected value is 50 + 150 × 3/4 = 162.5 ms. Measured: 166.5 ms, within 2.5%. Per-check means (135.6 and 126.0 ms) also sit close to the uniform expectation of 125 ms. This experiment validates two things at once: the fan-out is genuinely parallel, and my description of the simulated delay distribution was accurate.&lt;/p&gt;

&lt;p&gt;Where did the extra 27 ms (166.5 minus 139.8) go? I did not take segmented timings, so this is a labeled guess, not a finding: timer wakeups landing together, plus lock traffic when results are stored, are the plausible contributors. What matters more is the boundary of the claim — the fan-out dividend comes from checks waiting on each other. Make the checks CPU-bound and this arithmetic has to be redone.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.2 Throughput scales almost linearly — do not celebrate yet
&lt;/h3&gt;

&lt;p&gt;Experiment B (60 three-check jobs per row, 20 client threads submitting and polling):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Workers&lt;/th&gt;
&lt;th&gt;Wall time&lt;/th&gt;
&lt;th&gt;Completion rate&lt;/th&gt;
&lt;th&gt;Speedup vs 1 worker&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;9.71 s&lt;/td&gt;
&lt;td&gt;6.2 jobs/s&lt;/td&gt;
&lt;td&gt;1.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;4.98 s&lt;/td&gt;
&lt;td&gt;12.0 jobs/s&lt;/td&gt;
&lt;td&gt;1.9&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;2.58 s&lt;/td&gt;
&lt;td&gt;23.2 jobs/s&lt;/td&gt;
&lt;td&gt;3.7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;1.34 s&lt;/td&gt;
&lt;td&gt;44.9 jobs/s&lt;/td&gt;
&lt;td&gt;7.2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Eight workers on a 2-vCPU box delivering 7.2× the single-worker rate looks too good, and it is — for the right reason. A simulated check does no work at all; it parks on a timer. Worker count is therefore pure concurrency, and the rate is simply workers divided by per-job time. The single-worker prediction is 1 / 0.1625 ≈ 6.15 jobs/s; measured 6.2.&lt;/p&gt;

&lt;p&gt;What this actually proves is narrow but worth having: the pool has no hidden serial bottleneck — neither the queue nor the store's locking ate the scaling. It proves nothing about real probes. Add CPU-heavy parsing or classification and a 2-vCPU box will saturate around 2–4 workers, possibly regressing beyond that. Make the probes network-bound and the bottleneck moves to the targets or to connection counts. Extrapolating this line into production claims is the most common way load tests like this one get abused, so the line stops here.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.3 Backpressure you can compute in advance
&lt;/h3&gt;

&lt;p&gt;Experiment C used the tightest settings: 1 worker, queue depth 5, one burst of 30 concurrent submissions. Result: 6 accepted with 202, 24 rejected with 503. The 6 is not luck. Total admission capacity is workers plus queue depth — one job running, five waiting — and the seventh submission onward failed fast. No request was parked. All six accepted jobs were later polled to completion; nothing accepted was silently dropped.&lt;/p&gt;

&lt;p&gt;The gap is on the response side. A 503 from this API carries one error string: no Retry-After, no queue depth, nothing a client can schedule a retry against. For a machine-facing API, fixing that outranks adding any new check.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.4 Races and shutdown
&lt;/h3&gt;

&lt;p&gt;Experiment D ran 100 jobs against the -race build with submissions, execution, and polling all hammering the same in-memory store. The race detector reported nothing, and all 100 jobs completed. The code supports the result: every store access goes through one sync.RWMutex and reads return copies; fan-out writes land in disjoint slice slots, and the WaitGroup join establishes the happens-before edge before results are persisted.&lt;/p&gt;

&lt;p&gt;One honest footnote. My first run of this experiment saw only 92 of 100 jobs finish inside the polling budget. The cause was my harness, not the server: the -race build answers each request more slowly, and my poll loop gave up too early. Widening the budget to 20 seconds and rerunning produced 100 out of 100. I am leaving this in because it is exactly how load tests lie — the observer's limit masquerading as the system's failure.&lt;/p&gt;

&lt;p&gt;Shutdown: SIGTERM on an idle server produced the full sequence (shutting down, all workers stopped, bye) in about 1.0 second. That test had no jobs in flight. What shutdown does to in-flight work was not measured — but reading the code turned up a real problem, covered next.&lt;/p&gt;

&lt;h3&gt;
  
  
  3.5 A small defect found along the way: unstable result order
&lt;/h3&gt;

&lt;p&gt;With all checks selected, the order of the results array is not stable. In a sample of 20 jobs, two orders appeared (connectivity, disk_usage, service_health in 17; service_health first in 3). The cause sits in resolveChecks: for the "all checks" case it ranges over a map, Go map iteration order is randomized, results are filled by that list's indices, and the randomness leaks straight into the API response. Clients must match results by name, never by position. The fix is a one-line ordered registry, but the lesson generalizes: any map inside your service is a randomness source waiting to surface at the API boundary.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Analysis and trade-offs
&lt;/h2&gt;

&lt;p&gt;Four judgments I would reuse, each tied to evidence above:&lt;/p&gt;

&lt;p&gt;Make the concurrency ceiling explicit, not traffic-dependent. A fixed pool plus a bounded queue turns admission capacity into a computable constant — workers plus queue depth — and the measured 503 boundary matched that constant exactly. Alerting, capacity planning, and rate policy all need a number like that. A goroutine per request is faster at low load and has a ceiling nobody can state.&lt;/p&gt;

&lt;p&gt;Async submission buys a predictable submit path. A submit request only validates, creates a record, and enqueues; the HTTP layer's 10 s read and 30 s write timeouts can never be touched by a slow check. The price is client-side polling and, until server-sent events exist (they are on the roadmap, not in the code), delayed completion awareness.&lt;/p&gt;

&lt;p&gt;Pick the simplest fan-out primitive that is actually correct. An indexed slice plus a WaitGroup beat a result channel here: less code, no collection loop, and a clean race-detector run to back it. The precondition is that checks share no writes and have no ordering dependencies. The day checks need to hand intermediate results to each other, this structure gets replaced, not stretched.&lt;/p&gt;

&lt;p&gt;Zero dependencies is a deliberate constraint with an expiry date. Standard library only — ServeMux routing from Go 1.22, crypto/rand job IDs — keeps the build and audit surface small at 523 lines. The missing production pieces (metrics, rate limiting, structured logging) are equally obvious. For a scaffold this is the right call; the call expires the day real probes land.&lt;/p&gt;

&lt;p&gt;Three spots in the code do not survive scrutiny, in order of severity:&lt;/p&gt;

&lt;p&gt;Shutdown semantics disagree with job status. engine.Shutdown cancels the context first, and the worker loop selects between the cancellation case and the queue — when both are ready, the choice is random. A queued job may be abandoned with its status stuck at queued forever. Worse, an in-flight job whose checks abort on cancellation still flows into SetResults and gets marked done, indistinguishable from a job that ran to completion. With an in-memory store the process exits and none of this matters; the roadmap's durable store turns it into real semantic debt. Abandoned jobs need an explicit terminal state.&lt;/p&gt;

&lt;p&gt;The store never evicts. Every job record lives in the map for the life of the process. Fine for a scaffold; a long-running service needs a TTL or a capacity cap. This one is not a risk, it is a certainty with a date.&lt;/p&gt;

&lt;p&gt;Submit has a narrow shutdown race. Its select includes the context-done case, the queue-send case, and a default. If shutdown begins while the queue still has room, the send case can win and enqueue a job nobody will ever run. Rare, but precisely the kind of rare that costs an afternoon when it fires. Checking the context once before the select closes it.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Limitations and open questions
&lt;/h2&gt;

&lt;p&gt;The largest limitation is the one from section 1: every load in this article is a timer. Linear throughput scaling therefore certifies the skeleton, not the probes; the fan-out latency dividend assumes checks that wait; memory and GC behavior under this load would be meaningless to report, so they are not reported.&lt;/p&gt;

&lt;p&gt;Method limits, stated plainly: one batch per configuration (30 jobs per row in A, 60 in B, a single burst in C), no repeated trials and no confidence intervals. Client and server shared a host, so polling cost excludes any network. The box is a shared 2-vCPU VM; treat the digits as magnitudes and ratios, not as constants of nature.&lt;/p&gt;

&lt;p&gt;Three open questions gate the next round of code. Once real probes exist, should pool size be tuned to CPU or to what the targets can absorb — those two tuning curves need separate load runs. How should queue depth, the 503 rate, and client retry policy interact — that needs a retrying client in the loop. And when the durable store lands, the shutdown and terminal-state semantics from section 4 get fixed first, followed by a shutdown test with jobs actually in flight.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Go-Diagnoser-Engine source (the version measured here): github.com/Ezra-Zhao/Go-Diagnoser-Engine — internal/engine/engine.go (pool and fan-out), internal/engine/checks.go (simulated checks and registry), internal/api/router.go (routes and the 503 path), internal/store/store.go (in-memory store), cmd/server/main.go (wiring and shutdown).&lt;/li&gt;
&lt;li&gt;Raw data and load scripts archived with this article in the project ledger's data directory (2026-10-13-go-diagnoser-bench.json, bench.py, race_shutdown.py); every number above can be reproduced from them.&lt;/li&gt;
&lt;li&gt;Go documentation: net/http ServeMux method and pattern routing (Go 1.22+), sync.WaitGroup, and the happens-before definitions in the Go memory model (pkg.go.dev, go.dev/ref/mem).&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;Author: Guangyi Zhao. All code, experiments, and text in this article are clean-room work by the author: the system under test is the author's own open-source scaffold, load was generated in a self-hosted environment, and no client information, client systems, or third-party non-public data are involved. All figures come from the measurements described above; the simulated nature of the workload is stated in the text and no simulated result is presented as real diagnostic performance.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>TradingView 看盘渠道</title>
      <dc:creator>Guangyi Zhao</dc:creator>
      <pubDate>Wed, 04 Nov 2026 01:10:23 +0000</pubDate>
      <link>https://dev.to/ezrazhao/tradingview-kan-pan-qu-dao-34fp</link>
      <guid>https://dev.to/ezrazhao/tradingview-kan-pan-qu-dao-34fp</guid>
      <description>&lt;p&gt;我平时用 TradingView 看盘：图表、筛选、提醒都顺手。专属链接 → &lt;a href="https://www.tradingview.com/?aff_id=1172518%EF%BC%88Affiliate" rel="noopener noreferrer"&gt;https://www.tradingview.com/?aff_id=1172518（Affiliate&lt;/a&gt; link / 联盟链接，通过此链接注册，我可能获得佣金）&lt;/p&gt;

</description>
    </item>
    <item>
      <title>GitHub Sponsors 上线</title>
      <dc:creator>Guangyi Zhao</dc:creator>
      <pubDate>Wed, 04 Nov 2026 01:05:26 +0000</pubDate>
      <link>https://dev.to/ezrazhao/github-sponsors-shang-xian-439j</link>
      <guid>https://dev.to/ezrazhao/github-sponsors-shang-xian-439j</guid>
      <description>&lt;p&gt;我的 GitHub Sponsors 页面上线了：9 个赞助档位已全部发布，$3 起。欢迎支持我的开源项目与内容创作 → &lt;a href="https://github.com/sponsors/Ezra-Zhao" rel="noopener noreferrer"&gt;https://github.com/sponsors/Ezra-Zhao&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>《代码与诗篇》Code &amp; Psalms 上线</title>
      <dc:creator>Guangyi Zhao</dc:creator>
      <pubDate>Wed, 04 Nov 2026 01:00:05 +0000</pubDate>
      <link>https://dev.to/ezrazhao/-code-psalms-shang-xian-55c</link>
      <guid>https://dev.to/ezrazhao/-code-psalms-shang-xian-55c</guid>
      <description>&lt;p&gt;《代码与诗篇》Code &amp;amp; Psalms 上线：聊市场、指数投资和工程师的工具箱。免费订阅 → &lt;a href="https://codeandpsalms.beehiiv.com" rel="noopener noreferrer"&gt;https://codeandpsalms.beehiiv.com&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Wiper-Service-Agent explained</title>
      <dc:creator>Guangyi Zhao</dc:creator>
      <pubDate>Sun, 01 Nov 2026 21:44:10 +0000</pubDate>
      <link>https://dev.to/ezrazhao/wiper-service-agent-explained-2cfn</link>
      <guid>https://dev.to/ezrazhao/wiper-service-agent-explained-2cfn</guid>
      <description>&lt;p&gt;What if a tiny wiper-blade shop had a service rep that never sleeps? A customer messages their car model at two a.m.; the bot instantly looks up the blade size and quotes a price. Meet Wiper-Service-Agent: an open-source conversational AI agent for auto-parts customer service.&lt;/p&gt;

&lt;p&gt;Small shops feel this pain daily. A customer asks for a price at midnight, nobody replies, and by morning they bought elsewhere. Night staff is too costly, answering everything yourself does not scale, and some customers write in Spanish or Russian. Every unanswered message is a lost order.&lt;/p&gt;

&lt;p&gt;Four steps. First, the customer sends make, model and year, say Toyota Corolla 2021, and the language module detects Chinese, English, Spanish, Russian or Persian, replying in that language throughout. Second, wiper_db looks up the blade sizes. Third, pricing quotes and handles haggling: one discount only, five percent. Fourth, faq answers install, warranty and payment questions without breaking the sales flow. A state machine drives it all: greeting, collect vehicle, quote, done, ending with an order-intent J S O N.&lt;/p&gt;

&lt;p&gt;I ran the real demo: four scenarios, standard order, missing-year follow-up, haggling, and a full Spanish customer, who went from hello to order entirely in Spanish while the bot logged the detected language. All forty-four tests pass.&lt;/p&gt;

&lt;p&gt;Honest note: the demo runs on simulated data; the catalog, price table and N L U are mocked and marked SIMULATED. What is real: the state machine, tool interfaces, quoting math, language-detection rules, and the WhatsApp message boundary. To do: real fitment database, real price list, native-speaker review, L L M wiring. The webhook server is live on Render on the real WhatsApp Cloud A P I. M I T open source, link in the description. Sell auto parts? Fork it for your shop. See you next time!&lt;/p&gt;

&lt;p&gt;S6: Take a breather. China has an old saying: 'sharpening the axe won't delay the woodcutting.' Good tools plus heartfelt service make a lasting business. May God, the Creator of heaven and earth, bless the work of your hands.&lt;/p&gt;

&lt;p&gt;S7: May the favor of the Lord our God rest on us. Psalm 90:17 Technology becomes outdated, but love never ends. May God bless you and your family. If this project helped you, please give it a Star and share it with more people.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>nlp</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Web-Vuln-Scanner explained in</title>
      <dc:creator>Guangyi Zhao</dc:creator>
      <pubDate>Sun, 01 Nov 2026 21:43:44 +0000</pubDate>
      <link>https://dev.to/ezrazhao/web-vuln-scanner-explained-in-158b</link>
      <guid>https://dev.to/ezrazhao/web-vuln-scanner-explained-in-158b</guid>
      <description>&lt;p&gt;Does your website have vulnerabilities? If a hacker tells you first, it's too late. Web-Vuln-Scanner is a lightweight web vulnerability scanner in Python, ethics-first: it only scans targets you own or are explicitly authorized to test. It crawls the target, runs a set of independent checks, and produces a console plus JSON report.&lt;/p&gt;

&lt;p&gt;Small sites get hit the hardest: one reflected XSS can steal user cookies, one SQL injection can dump the whole database. A professional pentest is expensive; cleaning up after a breach costs more. Scanning it yourself first and picking the low-hanging fruit is the cheapest security habit there is.&lt;/p&gt;

&lt;p&gt;Four steps. First, the crawler: same-host only, collecting pages, links, forms, and URLs with parameters. Second, the checks: four independent modules — reflected XSS injects a unique token into params and watches for unescaped reflection; error-based SQLi fires quote payloads and matches error signatures from five database engines; the headers check flags missing security response headers; the sensitive-files prober knocks on .git, .env, /admin and similar paths. Third, the ethics gate: you must pass an explicit target, type SCAN to confirm, and optionally use an allowlist. Fourth, the report: console table plus JSON.&lt;/p&gt;

&lt;p&gt;I ran it against the bundled vulnerable demo app: a Flask app on 127.0.0.1:5000. Results matched expectations — reflected XSS on /search, error-based SQLi on /user, and a pile of missing security headers. All four checks verified against the demo target.&lt;/p&gt;

&lt;p&gt;Honest note: this is a scaffold v0.1 learning project, built alongside a cybersecurity master's program. Stored XSS, blind SQLi, CSRF, and authenticated scanning are NOT implemented — marked as TODOs, not claimed features. Only scan targets you own or are authorized to test; unauthorized scanning is illegal in most places. MIT licensed, link in the description. Run it against your test site and see the score. See you next time!&lt;/p&gt;

&lt;p&gt;S6: Take a breather. The Chinese character 安 (peace) holds 'woman' under a 'roof' — with loved ones home, the heart is at peace. Cybersecurity guards exactly that peace. May God, the Creator of heaven and earth, bless the work of your hands.&lt;/p&gt;

&lt;p&gt;S7: The Lord bless you and keep you. Numbers 6:24 Technology becomes outdated, but love never ends. May God bless you and your family. If this project helped you, please give it a Star and share it with more people.&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>python</category>
      <category>security</category>
    </item>
  </channel>
</rss>
