<?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: Felixwang007</title>
    <description>The latest articles on DEV Community by Felixwang007 (@felixwang007).</description>
    <link>https://dev.to/felixwang007</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%2F4050246%2F367055f4-756f-41a0-96f9-b2b5447699ae.png</url>
      <title>DEV Community: Felixwang007</title>
      <link>https://dev.to/felixwang007</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/felixwang007"/>
    <language>en</language>
    <item>
      <title>My Stock Picks Fell 39% in Six Sessions. Then the Whole Ranking Reversed at -0.73. I Tested That Rule on 210 Windows.</title>
      <dc:creator>Felixwang007</dc:creator>
      <pubDate>Thu, 03 Dec 2026 04:11:23 +0000</pubDate>
      <link>https://dev.to/felixwang007/my-stock-picks-fell-39-in-six-sessions-then-the-whole-ranking-reversed-at-073-i-tested-that-2130</link>
      <guid>https://dev.to/felixwang007/my-stock-picks-fell-39-in-six-sessions-then-the-whole-ranking-reversed-at-073-i-tested-that-2130</guid>
      <description>&lt;p&gt;On 2026-11-12 I froze a cross-sectional snapshot of 587 A-share names and their "three-pillar" scores, then published the picks. Six sessions later (2026-11-20) my top-ranked name, 603381 永臻股份, was down &lt;strong&gt;38.72%&lt;/strong&gt; — four consecutive limit-downs. I wrote that up as a failure of the scorer and left it there.&lt;/p&gt;

&lt;p&gt;This week I extended the same frozen scores another nine sessions, to 2026-12-03. The name rebounded &lt;strong&gt;+6.07%&lt;/strong&gt;. But the thing worth writing about is not that one stock — it is what happened to the &lt;em&gt;entire cross-section&lt;/em&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Rank correlation between each stock's return over the first six sessions and its return over the next nine sessions: &lt;strong&gt;−0.732&lt;/strong&gt; (n = 563, permutation p &amp;lt; 0.001).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A −0.73 rank correlation on stock returns is not a signal. That is a money printer. So I spent the rest of the session trying to kill it, and the killing is the useful part.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the two windows actually contained
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Window&lt;/th&gt;
&lt;th&gt;Sessions&lt;/th&gt;
&lt;th&gt;Mean&lt;/th&gt;
&lt;th&gt;Median&lt;/th&gt;
&lt;th&gt;Win rate&lt;/th&gt;
&lt;th&gt;Std&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;W1: 11-13 → 11-20&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;−5.32%&lt;/td&gt;
&lt;td&gt;−3.70%&lt;/td&gt;
&lt;td&gt;27.7%&lt;/td&gt;
&lt;td&gt;8.61%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;W2: 11-23 → 12-03&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;+3.92%&lt;/td&gt;
&lt;td&gt;+2.01%&lt;/td&gt;
&lt;td&gt;64.6%&lt;/td&gt;
&lt;td&gt;8.15%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Full: 11-13 → 12-03&lt;/td&gt;
&lt;td&gt;15&lt;/td&gt;
&lt;td&gt;−2.07%&lt;/td&gt;
&lt;td&gt;−2.11%&lt;/td&gt;
&lt;td&gt;35.8%&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;W1 was a broad decline (11-20 alone: −2.35% equal-weight, 7 names at limit-down). W2 was a violent rebound (11-27 alone: &lt;strong&gt;+3.99% equal-weight with 64 names at limit-up&lt;/strong&gt;). Almost every name fell in the first window and rose in the second, so the cross-sectional ranking is close to mechanically reversed: the deeper the hole, the bigger the bounce.&lt;/p&gt;

&lt;p&gt;The deciles make it visual. Sort all 563 names by their W1 return, then look at what the next nine sessions did:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Decile&lt;/th&gt;
&lt;th&gt;W1&lt;/th&gt;
&lt;th&gt;W2&lt;/th&gt;
&lt;th&gt;Full 15 sessions&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;D1 (worst)&lt;/td&gt;
&lt;td&gt;−21.10%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+15.63%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;−8.77%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D2&lt;/td&gt;
&lt;td&gt;−13.59%&lt;/td&gt;
&lt;td&gt;+9.40%&lt;/td&gt;
&lt;td&gt;−5.49%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D3&lt;/td&gt;
&lt;td&gt;−10.00%&lt;/td&gt;
&lt;td&gt;+6.99%&lt;/td&gt;
&lt;td&gt;−3.71%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D4&lt;/td&gt;
&lt;td&gt;−7.16%&lt;/td&gt;
&lt;td&gt;+4.67%&lt;/td&gt;
&lt;td&gt;−2.78%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D5&lt;/td&gt;
&lt;td&gt;−4.58%&lt;/td&gt;
&lt;td&gt;+1.00%&lt;/td&gt;
&lt;td&gt;−3.64%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D6&lt;/td&gt;
&lt;td&gt;−2.58%&lt;/td&gt;
&lt;td&gt;+0.67%&lt;/td&gt;
&lt;td&gt;−1.92%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D7&lt;/td&gt;
&lt;td&gt;−1.06%&lt;/td&gt;
&lt;td&gt;+0.22%&lt;/td&gt;
&lt;td&gt;−0.81%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D8&lt;/td&gt;
&lt;td&gt;+0.89%&lt;/td&gt;
&lt;td&gt;+0.08%&lt;/td&gt;
&lt;td&gt;+0.92%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D9&lt;/td&gt;
&lt;td&gt;+3.55%&lt;/td&gt;
&lt;td&gt;−1.89%&lt;/td&gt;
&lt;td&gt;+1.65%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D10 (best)&lt;/td&gt;
&lt;td&gt;+7.27%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−1.17%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;+5.93%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Perfectly monotone. And note the last column: the bounce recovered 15.63 of the 21.10 points D1 had lost. The round trip still ends at &lt;strong&gt;−8.77%&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The measurement, in about a dozen lines
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;ret&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;d1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;                      &lt;span class="c1"&gt;# one snapshot of closes, so no qfq rebase artefact&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;d1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;d0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;series&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;items&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;d0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;D&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="no"&gt;K&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;       &lt;span class="c1"&gt;# D = sorted trading dates, K = 6&lt;/span&gt;
    &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;ret&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="no"&gt;K&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;ret&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="no"&gt;K&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;D&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="no"&gt;K&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;cs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;corr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;spearman&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;cs&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;cs&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two details that matter and that I got wrong before: take &lt;strong&gt;all three prices from the same fetched snapshot&lt;/strong&gt; (a forwards-adjusted series is recomputed after dividends, so prices from two fetch dates silently disagree), and require the name to have bars on both boundary dates rather than forward-filling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does it survive out of the crash?
&lt;/h2&gt;

&lt;p&gt;I ran the same measurement on every adjacent pair of 6-session windows from 2026-01-05 to 2026-12-03 — &lt;strong&gt;210 windows, 566 names with ≥300 bars each&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;mean autocorrelation &lt;strong&gt;−0.016&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;median &lt;strong&gt;−0.005&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;min −0.707, max +0.511&lt;/li&gt;
&lt;li&gt;windows at or below −0.40: &lt;strong&gt;8 of 210 (3.8%)&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Split those 210 windows by what the &lt;em&gt;first&lt;/em&gt; window did:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;First window (equal-weight market)&lt;/th&gt;
&lt;th&gt;Windows&lt;/th&gt;
&lt;th&gt;Mean autocorr&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Drop ≤ −4%&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−0.263&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;−4% to +2%&lt;/td&gt;
&lt;td&gt;172&lt;/td&gt;
&lt;td&gt;−0.007&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rise ≥ +2%&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;td&gt;−0.002&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;So the effect is real, and it lives almost entirely in crash windows. It is not a property of the market; it is a property of the market having just fallen hard. The same measurement one day apart doesn't rescue it either — single-session autocorrelation from 11-20 to 11-23 was −0.61, which is the same event seen at a smaller scale.&lt;/p&gt;

&lt;p&gt;I also checked whether it's just "high-volatility names bounce": split names into volatility terciles by their 20-day realised vol before 11-12 and the correlation is −0.476 / −0.711 / −0.568. All three negative, so no.&lt;/p&gt;

&lt;h2&gt;
  
  
  The reframe: the rule is worthless unconditionally
&lt;/h2&gt;

&lt;p&gt;"Buy the decile that fell the most over the last six sessions, hold six" sounds like a rule. Here it is across all 210 windows, measured as excess return over the equal-weight universe:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;unconditional excess: &lt;strong&gt;−0.32 pp per window&lt;/strong&gt; (median −0.14 pp)&lt;/li&gt;
&lt;li&gt;after a first window of ≤ −4%: &lt;strong&gt;+3.93 pp&lt;/strong&gt; (median +2.54 pp), positive in 7 of 8&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Read that second line carefully, because it is where people fool themselves. Those 8 windows are overlapping: five of them are the same March episode counted five times, plus 05-21, 11-20 and 11-25. That is roughly &lt;strong&gt;four independent observations&lt;/strong&gt;, and two of them (11-20, 11-25) are the same 2026-November crash. An "n=8, 7 wins, mean +3.93pp" that is really n≈3 should never leave the notebook, let alone get shipped as a strategy.&lt;/p&gt;

&lt;p&gt;There is a second, uglier detail inside D1. Its worst five names were not its best rebounds:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;W1&lt;/th&gt;
&lt;th&gt;W2&lt;/th&gt;
&lt;th&gt;Full&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;603381 永臻股份&lt;/td&gt;
&lt;td&gt;−38.72%&lt;/td&gt;
&lt;td&gt;+6.07%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−35.00%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;603366 日出东方&lt;/td&gt;
&lt;td&gt;−29.46%&lt;/td&gt;
&lt;td&gt;+0.75%&lt;/td&gt;
&lt;td&gt;−28.93%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;600641 万业企业&lt;/td&gt;
&lt;td&gt;−27.25%&lt;/td&gt;
&lt;td&gt;+29.47%&lt;/td&gt;
&lt;td&gt;−5.81%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;603124 江南新材&lt;/td&gt;
&lt;td&gt;−27.14%&lt;/td&gt;
&lt;td&gt;+29.23%&lt;/td&gt;
&lt;td&gt;−5.84%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;600316 洪都航空&lt;/td&gt;
&lt;td&gt;−27.13%&lt;/td&gt;
&lt;td&gt;+12.61%&lt;/td&gt;
&lt;td&gt;−17.94%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;D1 averaged +15.63%. The four-limit-down name averaged +6%. "Buy what fell hardest" fails precisely at the tail where the rule claims its edge — because whatever caused four straight limit-downs is not the same thing as a beta bounce, and the cross-section can't tell the two apart.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part that actually broke: my factors flipped sign
&lt;/h2&gt;

&lt;p&gt;Same frozen 11-12 scores, three windows, rank-IC against forward returns:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Factor&lt;/th&gt;
&lt;th&gt;W1 (6 sessions)&lt;/th&gt;
&lt;th&gt;W2 (9 sessions)&lt;/th&gt;
&lt;th&gt;Full (15 sessions)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;20-day momentum&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;+0.220&lt;/strong&gt; (p=.000)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;−0.149&lt;/strong&gt; (p=.000)&lt;/td&gt;
&lt;td&gt;+0.107 (p=.005)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Volume/price score&lt;/td&gt;
&lt;td&gt;−0.108 (p=.009)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;+0.219&lt;/strong&gt; (p=.000)&lt;/td&gt;
&lt;td&gt;+0.100 (p=.015)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Technical score&lt;/td&gt;
&lt;td&gt;+0.051 (p=.216)&lt;/td&gt;
&lt;td&gt;−0.036 (p=.389)&lt;/td&gt;
&lt;td&gt;+0.028 (p=.499)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Composite (tech + volume/price)&lt;/td&gt;
&lt;td&gt;−0.008 (p=.857)&lt;/td&gt;
&lt;td&gt;+0.059 (p=.145)&lt;/td&gt;
&lt;td&gt;+0.066 (p=.107)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two weeks ago I published "20-day momentum was the only factor that survived the out-of-sample check." That was true and it was a coincidence of the window. The same factor, same frozen scores, next nine sessions: −0.149 with p = .000. The volume/price pillar flipped the other way with the same confidence. The composite score was never significant in any window, and its name-level result is equally thin: composite Top-50 returned −0.73% over the full window vs −2.07% for the universe (+1.34 pp excess); Bottom-50 −3.09% (−1.02 pp). Directionally right, economically nothing.&lt;/p&gt;

&lt;p&gt;The honest reading: &lt;strong&gt;a six-session out-of-sample check is a regime sample, not a test.&lt;/strong&gt; Both of my "significant" ICs at p &amp;lt; .001 were measuring the market's direction, not a stock-level property.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I changed in the tool
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Window context travels with the number. &lt;code&gt;autocorr_regime.py&lt;/code&gt; prints, for every window, the equal-weight return of both legs &lt;em&gt;and&lt;/em&gt; the autocorrelation, so a −0.15 IC sitting inside a window that read −0.7 can't be read as if it were a −0.15 IC from a quiet window. I could not see that distinction before, and both of my p &amp;lt; .001 "finds" were really readings of the market's direction.&lt;/li&gt;
&lt;li&gt;The rule I now apply, in writing: no factor is called "working" on one window. Two regime windows minimum — one up, one down — or it stays in the notebook with its window's market return attached. In practice that means most of my factor list is currently in the notebook.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;autocorr_regime.py&lt;/code&gt; ships with the regime split built in and exits &lt;strong&gt;3&lt;/strong&gt; when it can't see enough names. An empty universe printing "correlation 0.00, all clear" is a failure mode I've had to unlearn more than once.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The script also runs offline against a cached snapshot (&lt;code&gt;--cache&lt;/code&gt;), which is how I re-derived every number above after the endpoint cut me off — on the full 587-name cache it prints −0.017 mean across 210 windows, −0.31 pp/window unconditionally, and +4.20 pp after a ≤ −4% first window.&lt;/p&gt;

&lt;p&gt;The script, the raw per-window output (all 210 windows with dates, market returns, D1 excess) and the frozen-score check are in the repo:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/Felixwang007/a-share-signal-lab" rel="noopener noreferrer"&gt;https://github.com/Felixwang007/a-share-signal-lab&lt;/a&gt;&lt;/strong&gt; → &lt;code&gt;autocorr_regime.py&lt;/code&gt;, &lt;code&gt;results/autocorr-2026-12-03.json&lt;/code&gt;, &lt;code&gt;prereg_check.py&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;The earlier pre-registration write-up and the other replication studies (breadth, gaps, stop-loss brackets, liquidity) are in the same repo's &lt;code&gt;results/&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One operational warning if you reuse the data path: pulling 587 names from the free Tencent endpoint in one burst tripped their WAF and it started answering &lt;strong&gt;HTTP 501&lt;/strong&gt; with a &lt;code&gt;waf.tencent.com&lt;/code&gt; redirect for a while afterwards. Throttle it, or cache the snapshot and compute everything from the cache the way the analysis above does.&lt;/p&gt;

&lt;p&gt;If you want a second opinion on the measurement — or you have a factor you think survives a regime split — the repo's issues are open. I'd rather be told the −0.73 is an artefact than ship it as an edge.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>stocks</category>
    </item>
    <item>
      <title>I Ran My 82 Published AI Skill Packages on an Empty Folder. Three Said "All Clear."</title>
      <dc:creator>Felixwang007</dc:creator>
      <pubDate>Mon, 30 Nov 2026 04:05:38 +0000</pubDate>
      <link>https://dev.to/felixwang007/i-ran-my-82-published-ai-skill-packages-on-an-empty-folder-three-said-all-clear-4p93</link>
      <guid>https://dev.to/felixwang007/i-ran-my-82-published-ai-skill-packages-on-an-empty-folder-three-said-all-clear-4p93</guid>
      <description>&lt;p&gt;Every AI "skill pack" I publish goes through a gate: build it, run its selftest, scan a real codebase, then upload. Last week I pointed the gate back at itself and audited all 82 packages that ship a runnable entry point in my skill directory.&lt;/p&gt;

&lt;p&gt;Three of them graded an empty folder as perfectly clean. One gave 100/100 to a path that does not exist.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I was auditing
&lt;/h2&gt;

&lt;p&gt;100 packages in one folder, 93 with a &lt;code&gt;SKILL.md&lt;/code&gt;, 50 with an &lt;code&gt;evaluation_cases.md&lt;/code&gt; (the newer standard — the older packs predate it). Most are "doctor"-style static scanners: money/float precision, timeout defaults, cache correctness, secret leaks, subprocess injection, path traversal. 82 of them ship a Python script under &lt;code&gt;scripts/&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I ran three probes against all 82.&lt;/p&gt;

&lt;h2&gt;
  
  
  Probe 1: can a generic harness even start the selftest?
&lt;/h2&gt;

&lt;p&gt;65 packs mention &lt;code&gt;selftest&lt;/code&gt;, but they don't agree on how to invoke it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;43&lt;/strong&gt; accept it as a positional subcommand: &lt;code&gt;tool.py selftest&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;18&lt;/strong&gt; only accept a flag: &lt;code&gt;tool.py --selftest&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;4&lt;/strong&gt; mention the word but neither form works under my harness&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A harness that greps for one convention sees 43 out of 65 — it under-detects &lt;strong&gt;34%&lt;/strong&gt; of the packs that actually have a working selftest. That's not a tool bug, it's an interface bug: a capability with two names is a capability you cannot rely on programmatically.&lt;/p&gt;

&lt;p&gt;Of the 61 I could dispatch, 60 exit 0. The one that doesn't, &lt;code&gt;path-traversal-doctor&lt;/code&gt;, exits 1 with &lt;code&gt;selftest: 55/56 — FAILED: PAT001&lt;/code&gt;. That's a real regression in a pack I already published, found only because the harness ran it instead of trusting the README.&lt;/p&gt;

&lt;h2&gt;
  
  
  Probe 2: zero input
&lt;/h2&gt;

&lt;p&gt;Empty directory, no files, exit codes across 82 packs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;exit 2 : 42   (argparse usage error / unknown subcommand)
exit 1 : 20
exit 3 : 16   (a dedicated "no input" code)
exit 0 :  3   (printed a clean-looking report)
exit 4 :  1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The three exit-0 cases are the whole point:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;code-review-assistant  审查范围: 0 个文件  →  健康分: 100/100 — ✅ 可以合并
security-audit-helper  扫描文件数: 0 | 命中数: 0  →  [✓] 未发现敏感信息泄露
secret-leak-guard      total 0.00s over 0 files
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;"0 files scanned" is not a result. It is the absence of a result, formatted to look like one. If a CI job, an agent, or a human reads only the verdict line, all three say "all clear" about nothing at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Probe 3: the path doesn't exist
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight clean"&gt;&lt;code&gt;&lt;span class="n"&gt;exit&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;clean&lt;/span&gt; &lt;span class="n"&gt;language&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;82&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;code-review-assistant&lt;/code&gt; on a nonexistent path: &lt;code&gt;跳过不存在的路径&lt;/code&gt; → 0 files → &lt;strong&gt;100/100, ready to merge&lt;/strong&gt;, exit 0. A typo and a spotless codebase are indistinguishable from the outside.&lt;/p&gt;

&lt;p&gt;One more, unprompted: &lt;code&gt;official-doc-writer&lt;/code&gt; with &lt;strong&gt;no arguments at all&lt;/strong&gt; wrote a 37,335-byte &lt;code&gt;.docx&lt;/code&gt; to the Desktop and exited 0. Zero input produced a file side effect. In a "scan every pack in a loop" harness, that's an accidental write to the user's home directory.&lt;/p&gt;

&lt;h2&gt;
  
  
  The gate I now use
&lt;/h2&gt;

&lt;p&gt;Four rules, all of them learnable from the three probes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;"No input" gets its own exit code (3)&lt;/strong&gt;, distinct from "findings present" and from "you typed the command wrong".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exit 0 is not a verdict.&lt;/strong&gt; Green requires evidence: an independent walk must find more than zero candidate files, &lt;em&gt;and&lt;/em&gt; the tool's own reported count must equal that independent count.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compare numbers, not prose.&lt;/strong&gt; A human-readable summary is not an interface.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One exit-code enum per tool, documented in &lt;code&gt;--help&lt;/code&gt;.&lt;/strong&gt; Today &lt;code&gt;money-doctor&lt;/code&gt; uses &lt;code&gt;0/2/3/4&lt;/code&gt; (clean/findings/no-input/selftest-failed) while 42 other packs use &lt;code&gt;2&lt;/code&gt; for argparse misuse and &lt;code&gt;silent-failure-doctor&lt;/code&gt; uses &lt;code&gt;2&lt;/code&gt; for "findings present". The same code means "bad command line" and "your code has bugs" depending on which pack you're holding.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="no"&gt;CODE_EXT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;".py"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;".js"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;".ts"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;".java"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;".go"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;".rb"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;".php"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;".rs"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;".c"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;".cpp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;".cs"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;count_candidates&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="s2"&gt;"""Our own count. Never the tool's number."""&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isdir&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;                      &lt;span class="c1"&gt;# nonexistent path is its own failure&lt;/span&gt;
    &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dirs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;walk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;dirs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;dirs&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;".git"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"__pycache__"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"node_modules"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;".venv"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;splitext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="no"&gt;CODE_EXT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;gate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tool&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;expect&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;count_candidates&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;executable&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tool&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cwd&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dirname&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tool&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                       &lt;span class="n"&gt;capture_output&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;180&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;claim&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;claimed_count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stdout&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;stderr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="c1"&gt;# from --json, not from prose&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;expect&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;                     &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"FAIL_NONEXISTENT_PATH"&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;expect&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;                        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"NO_EVIDENCE"&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;returncode&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="s2"&gt;"NO_INPUT_REFUSED"&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;returncode&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;                  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"RED"&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;claim&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;claim&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"NO_EVIDENCE_COUNT_MISMATCH"&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;"GREEN"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The distinction that matters: &lt;code&gt;NO_EVIDENCE&lt;/code&gt; is neither pass nor fail. It means the run cannot be used as a grade, and it must not be allowed to turn green just because a process exited 0.&lt;/p&gt;

&lt;h2&gt;
  
  
  The gate had two bugs, of course
&lt;/h2&gt;

&lt;p&gt;First run, 10 out of 10 cases: &lt;code&gt;ERR bufsize must be an integer&lt;/code&gt;. &lt;code&gt;subprocess.run(cmd, root)&lt;/code&gt; passes &lt;code&gt;root&lt;/code&gt; into the &lt;em&gt;bufsize&lt;/em&gt; slot, not into &lt;code&gt;cwd&lt;/code&gt;. I wrote a gate for positional-argument failures and then made one with a positional argument.&lt;/p&gt;

&lt;p&gt;Second run, three false verdicts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;money-doctor&lt;/code&gt; prints &lt;code&gt;扫描: 18 文件 / 5629 行&lt;/code&gt;. My regex required &lt;code&gt;个文件&lt;/code&gt;, so a perfectly good tool was flagged as "reports no count".&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;security-audit-helper&lt;/code&gt; reported &lt;code&gt;扫描文件数: 0&lt;/code&gt; on a directory with 18 Python files. My gate calls that a mismatch; it's probably legitimate extension filtering — it scans config and credential files, not &lt;code&gt;.py&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both are the article's own thesis happening to me: &lt;strong&gt;a gate that parses prose produces false verdicts, and an independent counter must use the tool's declared extension scope or it becomes a false-alarm machine.&lt;/strong&gt; After fixing the regex and scoping the counter, 5 tools × 2 corpora (empty dir, and &lt;code&gt;requests&lt;/code&gt; with 18 files):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;code-review-assistant   empty → NO_EVIDENCE    real → GREEN    (18 = 18)
secret-leak-guard       empty → NO_EVIDENCE    real → GREEN    (18 = 18)
security-audit-helper   empty → NO_EVIDENCE    real → COUNT_MISMATCH (scope)
silent-failure-doctor   empty → NO_INPUT(3)    real → RED by gate, but exit 2 = findings
money-doctor            empty → NO_INPUT(3)    real → GREEN    (18 = 18)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What transfers to your own agent tools
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;"No input" ≠ "clean input".&lt;/strong&gt; Give it a distinct exit code and a distinct word in the output. Most of the bugs above are one line away from fixed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A tool may not grade its own homework.&lt;/strong&gt; The count that decides green has to come from outside the tool — otherwise a counter is a claim, not a measurement.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Selftest invocation is an interface.&lt;/strong&gt; Accept both &lt;code&gt;selftest&lt;/code&gt; and &lt;code&gt;--selftest&lt;/code&gt;, or your first automated consumer will under-count you and never tell you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Exit codes are an API.&lt;/strong&gt; Two packs using &lt;code&gt;2&lt;/code&gt; for two different meanings will page you at 3 a.m. for a typo.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero-arg behavior is part of the interface.&lt;/strong&gt; Mine wrote a &lt;code&gt;.docx&lt;/code&gt; to the Desktop.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Total cost of finding all of this: one 80-line audit script and about four minutes of wall clock. The empty-folder probe alone — &lt;code&gt;tool.py $(mktemp -d)&lt;/code&gt; and look at the verdict line — catches the entire "ok means never ran" family in 30 seconds.&lt;/p&gt;

&lt;p&gt;I've since added &lt;code&gt;exit 3&lt;/code&gt; and a machine-readable &lt;code&gt;files_scanned&lt;/code&gt; to the packs I touched, and the release script refuses to publish when &lt;code&gt;selftest&lt;/code&gt; exits non-zero (that's how &lt;code&gt;path-traversal-doctor&lt;/code&gt;'s 55/56 stayed out of the next batch).&lt;/p&gt;

&lt;p&gt;The doctor family and the audit gate live in my GitHub repo: &lt;a href="https://github.com/Felixwang007/awesome-content-tools" rel="noopener noreferrer"&gt;Felixwang007/awesome-content-tools&lt;/a&gt; — the &lt;code&gt;tools/&lt;/code&gt; folder has the scripts and the write-ups behind each rule. Individual packs (money-doctor, cache-doctor, timeout-doctor, silent-failure-doctor, and the rest) are published on 虾评 at &lt;a href="https://xiaping.coze.com" rel="noopener noreferrer"&gt;xiaping.coze.com&lt;/a&gt; if you want to run one against your own repo before adopting the habit.&lt;/p&gt;

&lt;p&gt;If you ship tools that an agent will call in a loop, run the empty-folder test first. The failure mode isn't a crash — it's a green check mark on a run that never happened.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>testing</category>
    </item>
    <item>
      <title>I Rebuilt GitHub Trending From the API — and Caught Six "Different" Apps Shipping the Same Binary</title>
      <dc:creator>Felixwang007</dc:creator>
      <pubDate>Thu, 26 Nov 2026 04:13:08 +0000</pubDate>
      <link>https://dev.to/felixwang007/i-rebuilt-github-trending-from-the-api-and-caught-six-different-apps-shipping-the-same-binary-4m06</link>
      <guid>https://dev.to/felixwang007/i-rebuilt-github-trending-from-the-api-and-caught-six-different-apps-shipping-the-same-binary-4m06</guid>
      <description>&lt;p&gt;&lt;code&gt;github.com/trending&lt;/code&gt; doesn't load from my machine. &lt;code&gt;curl&lt;/code&gt; sits in TCP connect for 20 seconds and returns nothing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;trending_html:000 time:20.000647
api:200 time:0.286833
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same machine, same minute. The HTML page is unreachable; &lt;code&gt;api.github.com&lt;/code&gt; answers in 0.29s. So if you're building anything that watches GitHub trends — a digest bot, a "is this repo worth reading" filter — the API is the only road you have.&lt;/p&gt;

&lt;p&gt;Rebuilding trending from the API turned out to be straightforward. What it surfaced in the top 30 was not.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rebuilding the ranking
&lt;/h2&gt;

&lt;p&gt;"Trending" is not an endpoint. The closest honest reconstruction is: repos created recently, sorted by stars.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="na"&gt;GET /search/repositories?q&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;created&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="mi"&gt;2026&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;19&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;stars&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;sort&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;stars&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;desc&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;per_page&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That returned &lt;strong&gt;1,303 repositories&lt;/strong&gt; created in the previous seven days with more than 50 stars. I pulled the top 30, then for each one: the recursive file tree, the releases, and the recent event stream. Then I read the numbers instead of the READMEs.&lt;/p&gt;

&lt;p&gt;Six of the thirty — &lt;strong&gt;20%&lt;/strong&gt; — turned out to be one campaign: six accounts, six different "products", one binary. Combined stars: &lt;strong&gt;6,418&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Filter 1: forks
&lt;/h2&gt;

&lt;p&gt;The cheapest tell is four-digit stars with zero forks.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;repo&lt;/th&gt;
&lt;th&gt;stars&lt;/th&gt;
&lt;th&gt;forks&lt;/th&gt;
&lt;th&gt;files&lt;/th&gt;
&lt;th&gt;created&lt;/th&gt;
&lt;th&gt;last push&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Indigo-0167/universal-game-mod-manager&lt;/td&gt;
&lt;td&gt;1,298&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;693&lt;/td&gt;
&lt;td&gt;2026-11-23&lt;/td&gt;
&lt;td&gt;2026-11-23&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Umbra9179/clipboard-history-manager-windows&lt;/td&gt;
&lt;td&gt;1,262&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;348&lt;/td&gt;
&lt;td&gt;2026-11-23&lt;/td&gt;
&lt;td&gt;2026-11-23&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;zero5122/offline-file-converter-windows&lt;/td&gt;
&lt;td&gt;1,061&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;429&lt;/td&gt;
&lt;td&gt;2026-11-23&lt;/td&gt;
&lt;td&gt;2026-11-23&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;solv4626/steam-achievement-manager-windows&lt;/td&gt;
&lt;td&gt;1,058&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;196&lt;/td&gt;
&lt;td&gt;2026-11-23&lt;/td&gt;
&lt;td&gt;2026-11-23&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;kai415-debug/ffmpeg-video-audio-converter&lt;/td&gt;
&lt;td&gt;1,020&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;302&lt;/td&gt;
&lt;td&gt;2026-11-23&lt;/td&gt;
&lt;td&gt;2026-11-23&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;olive527/steam-library-manager-windows&lt;/td&gt;
&lt;td&gt;719&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;129&lt;/td&gt;
&lt;td&gt;2026-11-23&lt;/td&gt;
&lt;td&gt;2026-11-23&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For contrast, the two most-starred repos in the same window: &lt;code&gt;xcl-dev/xcl&lt;/code&gt; (8,346★ / 1,148 forks) and &lt;code&gt;Marvisak/VIctory&lt;/code&gt; (12,690★ / 2,077 forks). Real repos with four-digit stars have hundreds of forks — a fork costs one click, and people click.&lt;/p&gt;

&lt;p&gt;But forks alone is a heuristic: people delete forks, and private forks don't count. I wanted a measurement that doesn't depend on anyone's intent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Filter 2: the cadence of the stars
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;/repos/{owner}/{repo}/events&lt;/code&gt; exposes &lt;code&gt;WatchEvent&lt;/code&gt; — one per star. Not every star is there (the window is limited and sampled), but what is there has a timestamp, and the &lt;em&gt;shape&lt;/em&gt; of those timestamps is the tell.&lt;/p&gt;

&lt;p&gt;For each repo I took the 100 most recent events, kept the star events, sorted them, and measured the gaps. Then one number: &lt;strong&gt;median gap ÷ mean gap&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Organic growth: many medium gaps plus quiet periods → median and mean are close → ratio near 1.&lt;/li&gt;
&lt;li&gt;Scheduler-driven growth: a burst of near-identical gaps followed by a long dead tail → median tiny, mean large → ratio collapses.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Across the 27 repos with at least 8 star events:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;group&lt;/th&gt;
&lt;th&gt;median / mean gap&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;the six above&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.058 – 0.171&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;all 21 others&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.351 – 1.111&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two clean populations, no overlap, roughly 2× apart. And inside the burst the gaps are unnaturally literal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Indigo-0167/universal-game-mod-manager        first 5 gaps: 37 37 37 37 38   median 55s
Umbra9179/clipboard-history-manager-windows   first 5 gaps: 37 37 37 37 38   median 55s
solv4626/steam-achievement-manager-windows    first 5 gaps: 37 37 37 37 37   median 46s
kai415-debug/ffmpeg-video-audio-converter     first 5 gaps: 37 37 38 38 38   median 49s
xcl-dev/xcl (organic)                        first 5 gaps: 21 45 50 55 160   median 160s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Four accounts, four unrelated projects, the same 37-second tick. Humans don't star things 37 seconds apart. A timer does — and four different repo owners are running timers with the same interval, which means they share a driving tool, not merely a motive.&lt;/p&gt;

&lt;p&gt;The same repos also have an event stream that is &lt;strong&gt;98–100% stars&lt;/strong&gt;: no pushes, no issues, no pull requests in the visible window. Repos that people actually use have some.&lt;/p&gt;

&lt;h2&gt;
  
  
  Filter 3: the payload
&lt;/h2&gt;

&lt;p&gt;This is where it stops being a heuristics argument and becomes a hash.&lt;/p&gt;

&lt;p&gt;Each of the six publishes release assets only — one zip per version, no source builds. The zip sizes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Universal Game Mod Manager 4.0.3         1,996,142 bytes
Windows Clipboard History Manager 4.2.1  1,996,156 bytes
Steam Achievement Manager 4.1.8          1,996,164 bytes
FFmpeg Video &amp;amp; Audio Converter 4.1.2     1,996,150 bytes
Steam Library Manager 4.0.4              1,996,132 bytes
Offline File Converter 4.1.3             1,996,158 bytes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Six unrelated Windows tools. Total spread: &lt;strong&gt;32 bytes&lt;/strong&gt;. That is not six builds. That is one archive with six names.&lt;/p&gt;

&lt;p&gt;I downloaded them and unzipped. Every zip contains a single &lt;code&gt;*.exe&lt;/code&gt; of exactly &lt;strong&gt;1,050,048 bytes&lt;/strong&gt; — same size, same CRC (&lt;code&gt;0x9e9b55d4&lt;/code&gt;), same SHA-256 prefix &lt;code&gt;63d0d02df6e466d642b824dc&lt;/code&gt; — plus a byte-identical &lt;code&gt;libvlc.dll&lt;/code&gt; (2,161,943 bytes). Six "products", one executable.&lt;/p&gt;

&lt;p&gt;And the size deltas prove the mechanism. Compare each zip's size difference from the base against the length difference of the inner filename:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;repo&lt;/th&gt;
&lt;th&gt;Δ zip size&lt;/th&gt;
&lt;th&gt;2 × Δ inner filename length&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;steam-achievement-manager&lt;/td&gt;
&lt;td&gt;+22&lt;/td&gt;
&lt;td&gt;+22&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ffmpeg-video-audio-converter&lt;/td&gt;
&lt;td&gt;+8&lt;/td&gt;
&lt;td&gt;+8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;steam-library-manager&lt;/td&gt;
&lt;td&gt;−10&lt;/td&gt;
&lt;td&gt;−10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;offline-file-converter&lt;/td&gt;
&lt;td&gt;+16&lt;/td&gt;
&lt;td&gt;+16&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Exactly 2×, every time, because a zip stores the name twice — local header and central directory. Nothing in the payload changed; only the string on the front of it.&lt;/p&gt;

&lt;p&gt;The repos I inspected for this carry four version tags each (&lt;code&gt;v1.1.8&lt;/code&gt; → &lt;code&gt;v4.0.3&lt;/code&gt;), and every tag's asset is the same byte size as the newest one. The version history is a list of labels, not a list of releases.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this does and does not prove
&lt;/h2&gt;

&lt;p&gt;What it proves: six accounts published one Windows executable as six different tools, with mechanically driven stars and no source code. That is enough to disqualify all six as anything you would install, regardless of what the binary does.&lt;/p&gt;

&lt;p&gt;What it does not prove: that these six names belong to one legal entity, or that the binary is malicious. I didn't run it — I hashed it and read its strings. Its embedded certificate chains (DigiCert / Sectigo / UserTrust) mean the file is code-signed, so "signed" is not a safety signal here either: a signature records who submitted a file, and here it tells you nothing about the six names the file is wearing.&lt;/p&gt;

&lt;p&gt;Byte identity across unrelated products is a disqualifier on its own. You don't need a malware verdict to decide not to run it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 60-line version for your own pipeline
&lt;/h2&gt;

&lt;p&gt;If you aggregate or filter repos, run three checks before anything reaches a human:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;forks vs stars&lt;/strong&gt; — four-digit stars with 0–2 forks: stop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;star cadence&lt;/strong&gt; — &lt;code&gt;median_gap / mean_gap &amp;lt; 0.2&lt;/code&gt; over ≥8 star events: stop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;payload collision&lt;/strong&gt; — group release assets by byte size across "unrelated" repos; a 32-byte spread across six products is one archive.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;statistics&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;collections&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;defaultdict&lt;/span&gt;

&lt;span class="no"&gt;TOKEN&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"GITHUB_TOKEN"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;check_output&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"gh"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"auth"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"token"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="no"&gt;H&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"Authorization"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"Bearer {TOKEN}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Accept"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"application/vnd.github+json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
     &lt;span class="s2"&gt;"User-Agent"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"curl/8.0"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;api&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;req&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"https://api.github.com"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="no"&gt;H&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;urlopen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loads&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;cadence&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;full&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# median/mean gap between star events; &amp;lt;0.2 over &amp;gt;=8 events means a scheduler&lt;/span&gt;
    &lt;span class="n"&gt;ev&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;api&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"/repos/{full}/events?per_page=100"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;ts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromisoformat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"created_at"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"+00:00"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;ev&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"WatchEvent"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;
    &lt;span class="n"&gt;gaps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;total_seconds&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;zip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;statistics&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;median&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gaps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;statistics&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fmean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gaps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;assets&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;full&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;rel&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;api&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"/repos/{full}/releases?per_page=1"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;rel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"size"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;rel&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"assets"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;repos&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;api&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/search/repositories?q=created:&amp;gt;2026-11-19+stars:&amp;gt;50"&lt;/span&gt;
            &lt;span class="s2"&gt;"&amp;amp;sort=stars&amp;amp;order=desc&amp;amp;per_page=30"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"items"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="n"&gt;sizes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;defaultdict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;list&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;repos&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;full&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"full_name"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;ratio&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;cadence&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;full&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;flags&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"stargazers_count"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"forks_count"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;flags&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"stars/forks"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;ratio&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;ratio&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mf"&gt;0.2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;flags&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"cadence={ratio}"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;assets&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;full&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;sizes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;full&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{r['stargazers_count']:&amp;gt;6}* {r['forks_count']:&amp;gt;5}f  {full:52} {' '.join(flags)}"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# assets whose byte sizes collide across different repos = one archive, many names&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sizes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;near&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;sizes&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;group&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;o&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;near&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;o&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;sizes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;group&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"payload cluster:"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;near&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"-&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;sorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;group&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it and you get the same numbers I did — the six, plus whatever the next campaign is, because this pattern has been running for months and the interval barely changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters beyond one bad week
&lt;/h2&gt;

&lt;p&gt;Trending pages are how people find libraries, and "1,200 stars" is doing a lot of work in that decision. When a star count can be bought, the count is a claim and the artifact is a fact. Prefer measurements taken from the thing itself — how the bytes are made, how the events scatter — over measurements taken from attention.&lt;/p&gt;

&lt;p&gt;The corollary is uncomfortable if you build aggregators: &lt;strong&gt;if your pipeline sorts by stars, your pipeline is sortable by anyone with a timer.&lt;/strong&gt; Three cheap checks, all from public endpoints, all stdlib, and none of them require trusting a README.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Other diagnostics in this series (process timeouts, clock calibration, write durability, idempotency) live at &lt;a href="https://github.com/Felixwang007/awesome-content-tools" rel="noopener noreferrer"&gt;github.com/Felixwang007/awesome-content-tools&lt;/a&gt;. Smaller single-purpose checkers are on &lt;a href="https://xiaping.coze.com" rel="noopener noreferrer"&gt;虾评&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>github</category>
    </item>
    <item>
      <title>I Pre-Registered My Stock Screener's Picks. Six Sessions Later, the #1 Name Had Four Straight Limit-Downs.</title>
      <dc:creator>Felixwang007</dc:creator>
      <pubDate>Mon, 23 Nov 2026 04:55:05 +0000</pubDate>
      <link>https://dev.to/felixwang007/i-pre-registered-my-stock-screeners-picks-six-sessions-later-the-1-name-had-four-straight-56c6</link>
      <guid>https://dev.to/felixwang007/i-pre-registered-my-stock-screeners-picks-six-sessions-later-the-1-name-had-four-straight-56c6</guid>
      <description>&lt;p&gt;Last time I wrote about this screener, the article was an autopsy: I audited my own "three-pillar" A-share model and found every pillar's rank-IC against forward 5-day returns was &lt;strong&gt;negative&lt;/strong&gt; — technical -0.048 (t = -2.72), volume-price -0.055 (t = -3.31), composite -0.040 (t = -2.11), over 41,090 stock-days.&lt;/p&gt;

&lt;p&gt;The comfortable reaction is "let me improve the model." The useful reaction is: &lt;strong&gt;stop tuning and freeze a prediction.&lt;/strong&gt; So on Nov 12 I saved the full 587-name cross-section — every score, untouched — and committed to one checkpoint six sessions later.&lt;/p&gt;

&lt;p&gt;This is what that checkpoint returned. Including the part where my top-ranked stock went down 38.7%, and the part where a "finding" turned out to be my own sort key measuring the exchange instead of the signal.&lt;/p&gt;

&lt;h2&gt;
  
  
  The protocol (fixed before I looked)
&lt;/h2&gt;

&lt;p&gt;Pre-registration matters more than any indicator here. If I compute a signal, then pick the window, then pick the metric, I will always find alpha. So the rules were written down first:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Scores frozen at the Nov 12 close.&lt;/strong&gt; No recomputation, no re-ranking after the fact.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One window, no cherry-picking:&lt;/strong&gt; 6 sessions, 2026-11-13 → 2026-11-20 (last complete session when I ran this).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Both return endpoints from the same data pull.&lt;/strong&gt; Sounds trivial; it is the single biggest source of fake returns (the &lt;code&gt;qfq&lt;/code&gt; trap below).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Significance by permutation only.&lt;/strong&gt; 2,000 shuffles of the forward-return vector; &lt;code&gt;p&lt;/code&gt; = share of shuffles with |IC| at least as large. No eyeballing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Losers reported at the same resolution as winners.&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Universe: 587 Shanghai/Shenzhen names I already cached — 538 SSE main board, 28 STAR Market, 21 Shenzhen (main + ChiNext). That mix matters later. Data: Tencent's free forward-adjusted daily endpoint (&lt;code&gt;web.ifzq.gtimg.cn&lt;/code&gt;), 320 bars per name, ~14 seconds for all 587 across 8 threads. No key, no vendor.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the market did
&lt;/h2&gt;

&lt;p&gt;Not a friendly week to be long anything:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;SSE Composite&lt;/td&gt;
&lt;td&gt;3655.83 → 3533.79 = &lt;strong&gt;-3.34%&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;My 587-name universe, equal-weight mean&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-5.30%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Universe median&lt;/td&gt;
&lt;td&gt;-3.65%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Share of names with a positive return&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;27.6%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cross-sectional std&lt;/td&gt;
&lt;td&gt;8.59%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The universe fell harder than the index — it is large-cap-tilted but equal-weighted, so a beta-driven drawdown smears every ranking. Which is exactly why the cross-sectional test, not the absolute return, is the one that counts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 1: the composite is dead flat
&lt;/h2&gt;

&lt;p&gt;Rank-IC of each Nov 12 score against the realized 6-session return, n = 587:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;signal&lt;/th&gt;
&lt;th&gt;in-sample IC (70 days)&lt;/th&gt;
&lt;th&gt;out-of-sample IC (6 sessions)&lt;/th&gt;
&lt;th&gt;permutation p&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;technical (24 indicators)&lt;/td&gt;
&lt;td&gt;-0.0479 (t = -2.72)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+0.0542&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;0.185&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;volume-price "intel"&lt;/td&gt;
&lt;td&gt;-0.0552 (t = -3.31)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-0.1087&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.006&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;composite (tech + intel)&lt;/td&gt;
&lt;td&gt;-0.0402 (t = -2.11)&lt;/td&gt;
&lt;td&gt;-0.0047&lt;/td&gt;
&lt;td&gt;0.915&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;20-day past return&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+0.2174&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.000&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Three different things are happening in that table:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The technical pillar flipped sign.&lt;/strong&gt; -0.048 in-sample, +0.054 out-of-sample. Both noise-sized. A pillar whose sign depends on the window is not a signal, it is a random number generator with a nice name.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The volume-price pillar kept its sign.&lt;/strong&gt; Negative in both windows, p = 0.006 here. That is the only line I am willing to act on — and acting on it means &lt;em&gt;deleting&lt;/em&gt; the pillar, not trading it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;My mean-reversion belief was wrong.&lt;/strong&gt; +0.217 for 20-day past return means winners kept winning. The most-oversold quintile returned &lt;strong&gt;-9.56% with an 11.1% win rate&lt;/strong&gt;; the 50 worst 20-day performers averaged &lt;strong&gt;-10.15%&lt;/strong&gt; while the average stock lost 5.30%. "Buy the dip" was the worst trade in the sample.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Composite quintiles (positional, n≈117 each):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Q1 [-6, 1]     -5.02%   win 19.7%
Q2 [ 1, 3]     -4.21%   win 29.1%
Q3 [ 3, 5]     -6.01%   win 22.0%
Q4 [ 5, 6]     -4.20%   win 35.9%
Q5 [ 6,13]     -7.02%   win 31.4%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No monotonicity. Top-50 by composite: -5.62% vs a -5.30% universe (-0.33 pp). Bottom-50: -6.19%. Long-short spread: &lt;strong&gt;+0.57 pp&lt;/strong&gt;, i.e. inside the noise of one window. Six sessions can refute a strong claim; it cannot confirm a weak one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 2: the "finding" that was actually my sort key
&lt;/h2&gt;

&lt;p&gt;Here is the mistake I nearly published.&lt;/p&gt;

&lt;p&gt;The volume-price score is discrete and mostly zero: 309 of 587 names (52.6%) score exactly 0, another 222 score -2. Split that into positional quintiles and Python must break ties somehow. My first output looked like a discovery:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Q1 -3.70%   Q2 -4.09%   Q3 -4.57%   Q4 -2.88%   Q5 -11.19%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;"Monotone-ish, Q5 is the killer." But Q3 and Q4 were &lt;em&gt;entirely&lt;/em&gt; 118 and 117 names with identical score 0 — and they differ by 1.7 pp. So what was the bucket actually sorting on? My snapshot's insertion order happened to be &lt;strong&gt;stock code order&lt;/strong&gt;, so positional bucketing on a tied score silently became bucketing by exchange and board. Verified: splitting the 309 tied-at-zero names into code-ordered thirds gives -4.75% / -3.15% / -9.14% — an observed range of 6.0 pp, against a random-shuffle median range of 1.35 pp (95th percentile 2.85 pp). The 9 pp spread inside Q5 was &lt;strong&gt;board beta wearing a score's clothes&lt;/strong&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;board&lt;/th&gt;
&lt;th&gt;n&lt;/th&gt;
&lt;th&gt;mean 6-session return&lt;/th&gt;
&lt;th&gt;win rate&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;60x SSE main&lt;/td&gt;
&lt;td&gt;538&lt;/td&gt;
&lt;td&gt;-4.57%&lt;/td&gt;
&lt;td&gt;28.8%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;688 STAR Market&lt;/td&gt;
&lt;td&gt;28&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;-17.12%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;7.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;30x ChiNext&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;-11.30%&lt;/td&gt;
&lt;td&gt;16.7%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;00x/002 Shenzhen&lt;/td&gt;
&lt;td&gt;15&lt;/td&gt;
&lt;td&gt;-6.85%&lt;/td&gt;
&lt;td&gt;26.7%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The high-code names clustered at the top of the sorted array, the STAR Market crashed, and the "top bucket" looked predictive. It wasn't predicting anything — it was a 28-name exchange bucket's worst week.&lt;/p&gt;

&lt;p&gt;Grouped by &lt;em&gt;value&lt;/em&gt; instead of position, the picture is different, cleaner, and — importantly — survives a board control:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;intel score&lt;/th&gt;
&lt;th&gt;all names (n=587)&lt;/th&gt;
&lt;th&gt;SSE main only (n=538)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&amp;lt; 0&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;-3.76%&lt;/strong&gt; (n=231)&lt;/td&gt;
&lt;td&gt;-3.44% (n=221)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;= 0&lt;/td&gt;
&lt;td&gt;-5.68% (n=309)&lt;/td&gt;
&lt;td&gt;-5.06% (n=283)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;gt; 0&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;-10.30%&lt;/strong&gt; (n=47)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;-7.85%&lt;/strong&gt; (n=34)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;IC stays negative within the SSE main board alone (-0.061), and the 20-day momentum effect survives too (+0.235). So &lt;em&gt;that&lt;/em&gt; claim is real for this window; the quintile drama was not.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The transferable rule:&lt;/strong&gt; a positional quantile on a tied score doesn't measure the score — it measures whatever your secondary sort key is. Group by value, print &lt;code&gt;n&lt;/code&gt; per group, and if a bucket is mostly ties, say so or don't report it. And with a 92%-SSE universe, put a board control in every table: one 28-name STAR bucket moving 17% can flip a "market-wide" conclusion you never tested.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 3: the top-ranked name lost 38.7% in four sessions
&lt;/h2&gt;

&lt;p&gt;The ranking doesn't merely fail to predict — it filters nothing. My highest score on Nov 12 was &lt;strong&gt;603381 (永臻股份)&lt;/strong&gt;, composite +13, the maximum in the cross-section. What followed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;11-13  -10.01%   limit down
11-16   -9.99%   limit down
11-17  -10.01%   limit down
11-18   -9.97%   limit down
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;22.57 → 13.83, &lt;strong&gt;-38.72%&lt;/strong&gt; in six sessions. Four consecutive limit-downs mean there was no exit: the bid is gone before an order reaches the book. My #2 name, 603283 (赛腾股份), went 45.29 → 34.64, &lt;strong&gt;-23.51%&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The detail that bothers me more than the loss: in the Nov 20 cross-section — &lt;em&gt;after&lt;/em&gt; that -23.5% week — &lt;strong&gt;603283 still ranks #4 by technical score (tied at +11)&lt;/strong&gt;. The screen re-confirms a name after it broke, because moving averages and momentum are computed from the same prices that just collapsed. It is a lagging detector wearing a leading-indicator costume, and it will happily hand you a fresh top-10 containing yesterday's wreckage.&lt;/p&gt;

&lt;h2&gt;
  
  
  The trap that would have faked the whole experiment
&lt;/h2&gt;

&lt;p&gt;I pulled history twice: a snapshot on Nov 12, and a fresh pull today. The naive forward return is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# WRONG when two pulls disagree about adjustment&lt;/span&gt;
&lt;span class="n"&gt;c0&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;old_pull&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'close'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;   &lt;span class="c1"&gt;# Nov 12 close, adjusted as of Nov 12&lt;/span&gt;
&lt;span class="n"&gt;c1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;new_pull&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'close'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;   &lt;span class="c1"&gt;# Nov 20 close, adjusted as of today&lt;/span&gt;
&lt;span class="n"&gt;ret&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;c1&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;c0&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Forward-adjusted (&lt;code&gt;qfq&lt;/code&gt;) prices get rebased whenever a name pays a dividend or splits: the &lt;em&gt;historical&lt;/em&gt; closes shift, so an old pull and a new pull can disagree about the same date. Comparing one file's price to another file's price manufactures returns that never happened.&lt;/p&gt;

&lt;p&gt;The fix is one line of discipline — anchor the observation date inside the new pull:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;snap_date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;old_pull&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'date'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;          &lt;span class="c1"&gt;# when I froze the scores&lt;/span&gt;
&lt;span class="n"&gt;futmap&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'date'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'close'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;new_pull&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;c0&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;futmap&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;snap_date&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;                          &lt;span class="c1"&gt;# same adjustment basis as c1&lt;/span&gt;
&lt;span class="n"&gt;c1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;new_pull&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'date'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="no"&gt;LAST_SESSION&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'close'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c0&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;old_pull&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'close'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mf"&gt;0.005&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;rebased&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;        &lt;span class="c1"&gt;# 8 of 587 in my run — audit these, never include them silently&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;8 of 587 names tripped that check. Small number; catastrophic if one lands on your top pick.&lt;/p&gt;

&lt;p&gt;Significance without distributional assumptions, because IC z-scores lie on 6 observations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;permutation_p&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ys&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;observed_ic&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;seed&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;rng&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Random&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seed&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;hits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;perm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ys&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;rng&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;shuffle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;perm&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;spearman&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;xs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;perm&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="nb"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="nb"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;observed_ic&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;hits&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;hits&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both scripts are in the repo, unchanged: &lt;a href="https://github.com/Felixwang007/a-share-signal-lab/blob/main/prereg_check.py" rel="noopener noreferrer"&gt;prereg_check.py&lt;/a&gt; and the &lt;a href="https://github.com/Felixwang007/a-share-signal-lab/blob/main/results/prereg-2026-11-12-to-11-20.json" rel="noopener noreferrer"&gt;result JSON&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I actually changed
&lt;/h2&gt;

&lt;p&gt;Not "improved the model." Four edits, each traceable to a number above:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Volume-price pillar weight → 0.&lt;/strong&gt; Two windows agree on a negative sign and it survives a board control, so it earns nothing until it earns something. I am explicitly &lt;em&gt;not&lt;/em&gt; inverting it: flipping a sign because two windows liked it is the same overfitting sin with better manners.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Every ranking now ships dispersion and risk columns&lt;/strong&gt;, not just a rank. A "top 50" that hides the fact that #1 has a 40% drawdown profile is not information, it is a lottery ticket.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Buckets are grouped by value with &lt;code&gt;n&lt;/code&gt; printed&lt;/strong&gt;, and board mix is a required column whenever the universe is that lopsided.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Every future claim of edge needs a pre-registered checkpoint date.&lt;/strong&gt; If I cannot say when the claim gets judged and on which window, the claim is a story.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Scoreboard for the "expert"
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;claim&lt;/th&gt;
&lt;th&gt;verdict&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;"three pillars, diversified"&lt;/td&gt;
&lt;td&gt;pillars are near-orthogonal (daily corr 0.14 / 0.02 / -0.03) — orthogonal noise is still noise&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;composite ranks better than random&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;not supported&lt;/strong&gt;: IC -0.005, p = 0.92, long-short 0.57 pp&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;volume-price confirmation adds value&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;refuted in both windows&lt;/strong&gt;, survives board control&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;buy the oversold&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;refuted here&lt;/strong&gt;: -9.56% vs -5.30% universe, 11.1% win rate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;technical score leads&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;not supported&lt;/strong&gt;: sign flips between windows, re-confirms crashed names&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;my quintile table measured the score&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;false&lt;/strong&gt;, it measured the exchange — caught before publishing&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;One window in one crash regime proves nothing about the next window. What it &lt;em&gt;can&lt;/em&gt; do is delete a pillar and delete a belief for free, before those beliefs cost money. That is cheaper than another year of backtesting.&lt;/p&gt;

&lt;p&gt;Toolkit, raw result files, and the earlier replication study (15,900 stock-days, regime-split): &lt;strong&gt;&lt;a href="https://github.com/Felixwang007/a-share-signal-lab" rel="noopener noreferrer"&gt;github.com/Felixwang007/a-share-signal-lab&lt;/a&gt;&lt;/strong&gt;. &lt;code&gt;prereg_check.py&lt;/code&gt; is self-contained — you need the scoring module and nothing but &lt;code&gt;urllib&lt;/code&gt; for data, so you can run the same checkpoint on your own universe.&lt;/p&gt;

&lt;p&gt;If you have ever pre-registered a trading signal and posted the miss, I would like to read it — especially the ones where the sign flipped, or where the bucket was sorting on something you didn't choose. That is the only kind of result that teaches anyone anything.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Not investment advice. Every figure here lives in the two result files linked above; if a number is not in those files, treat it as unverified.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>stocks</category>
    </item>
    <item>
      <title>My Leak Scanner Reported 16 Bugs in CPython. I Read All 16: Every One Was a Handoff.</title>
      <dc:creator>Felixwang007</dc:creator>
      <pubDate>Thu, 19 Nov 2026 10:58:17 +0000</pubDate>
      <link>https://dev.to/felixwang007/my-leak-scanner-reported-16-bugs-in-cpython-i-read-all-16-every-one-was-a-handoff-1h6l</link>
      <guid>https://dev.to/felixwang007/my-leak-scanner-reported-16-bugs-in-cpython-i-read-all-16-every-one-was-a-handoff-1h6l</guid>
      <description>&lt;p&gt;I wrote a resource-leak scanner for Python. Its own documentation claims it was calibrated on real code and comes back clean: "CPython standard library, 736 files, 1 HIGH — and that one is a genuine leak."&lt;/p&gt;

&lt;p&gt;This week I pointed the same tool at a bigger target: the whole &lt;code&gt;Lib/&lt;/code&gt; tree of CPython 3.14, including the test package.&lt;/p&gt;

&lt;p&gt;It reported &lt;strong&gt;16 HIGH severity leaks&lt;/strong&gt;. I read all 16, line by line, and then wrote down what each one actually was.&lt;/p&gt;

&lt;p&gt;All 16 were handoffs. Not one was a leak. Every single HIGH came from the test tree, and production code came back at zero.&lt;/p&gt;

&lt;p&gt;That is a useful result, but not the one the summary line implies. Here is the full accounting, the seven handoff shapes, and the bug my first fix introduced.&lt;/p&gt;

&lt;h2&gt;
  
  
  The run
&lt;/h2&gt;

&lt;p&gt;The tool is a single standard-library file. No install, no dependencies, AST only, never executes the code it scans:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 resource_leak_doctor.py scan C:/Python314/Lib --json &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; report.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Numbers on that corpus:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;.py&lt;/code&gt; files scanned&lt;/td&gt;
&lt;td&gt;1,851&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;of which under &lt;code&gt;Lib/test/&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;1,131&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;constructor call sites (&lt;code&gt;open&lt;/code&gt;, &lt;code&gt;io.open&lt;/code&gt;, &lt;code&gt;socket.socket&lt;/code&gt;, &lt;code&gt;sqlite3.connect&lt;/code&gt;, &lt;code&gt;Popen&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;2,417&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;findings total&lt;/td&gt;
&lt;td&gt;105&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HIGH&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MEDIUM&lt;/td&gt;
&lt;td&gt;16&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LOW&lt;/td&gt;
&lt;td&gt;73&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HIGH located in &lt;code&gt;Lib/test/&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;16 of 16&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HIGH located in production code&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;So the honest summary is not "there are 16 leaks in CPython". It is: &lt;strong&gt;my HIGH rule fires almost exclusively where handoff is the normal idiom&lt;/strong&gt; — test code.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 16, adjudicated
&lt;/h2&gt;

&lt;p&gt;Every finding was an assignment of the shape &lt;code&gt;name = &amp;lt;constructor&amp;gt;(...)&lt;/code&gt;, followed by no &lt;code&gt;close()&lt;/code&gt;, no &lt;code&gt;with&lt;/code&gt;, and no &lt;code&gt;return&lt;/code&gt; of that name within the same function. All true as stated. All misleading as conclusions.&lt;/p&gt;

&lt;p&gt;Grouping them by &lt;em&gt;what the handle was passed to&lt;/em&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Shape&lt;/th&gt;
&lt;th&gt;Count&lt;/th&gt;
&lt;th&gt;Example site&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;mocked constructor (no real handle exists)&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;&lt;code&gt;test_unittest/testmock/testwith.py&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;detach()&lt;/code&gt; — ownership explicitly pushed out&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;test_httplib.py:1502&lt;/code&gt;, &lt;code&gt;test_socket.py&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ownership-sink API (&lt;code&gt;loop.connect_read_pipe&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;&lt;code&gt;test_asyncio/test_events.py&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cleanup registry (&lt;code&gt;addCleanup(sock.detach)&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;code&gt;test_socket.py:6152&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;callee closes it (thread target)&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;code&gt;test_asyncio/utils.py:285&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;enclosing scope owns it (&lt;code&gt;nonlocal&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;code&gt;test_socket.py:5295&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;the failure &lt;em&gt;is&lt;/em&gt; the assertion (&lt;code&gt;assertEqual(e.errno, EPERM)&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;&lt;code&gt;test_posix.py:1138&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Take the one that looks most like a real bug:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Lib/test/test_asyncio/utils.py:285&lt;/span&gt;
&lt;span class="nd"&gt;@contextlib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;contextmanager&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;run_udp_echo_server&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'127.0.0.1'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;addr_info&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getaddrinfo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;SOCK_DGRAM&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;family&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;proto&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sockaddr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;addr_info&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;sock&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;family&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;proto&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;sock&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;sockname&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sock&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getsockname&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;thread&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;threading&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Thread&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;echo_datagrams&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sock&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;thread&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;start&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;sock&lt;/code&gt; is never closed in this function. It is closed in &lt;code&gt;echo_datagrams&lt;/code&gt; when the sentinel arrives:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;echo_datagrams&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sock&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;addr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sock&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;recvfrom&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4096&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="s1"&gt;'STOP'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;sock&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;break&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The handle crossed a function boundary, into a thread. A per-function ledger cannot see that. The finding is arithmetically correct and semantically useless.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;test_posix.py:1138&lt;/code&gt; is even worse in the other direction — &lt;code&gt;open()&lt;/code&gt; is &lt;em&gt;supposed&lt;/em&gt; to fail there, because the test asserts that an immutable file returns &lt;code&gt;EPERM&lt;/code&gt;. Flagging a guarded &lt;code&gt;open()&lt;/code&gt; as a leak is like flagging &lt;code&gt;assertRaises&lt;/code&gt; as an uncaught exception.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix #1: I made it worse
&lt;/h2&gt;

&lt;p&gt;My first fix was a post-filter over the JSON report. Ninety lines, text regex on the enclosing function: if the file contains &lt;code&gt;name.detach()&lt;/code&gt;, waive. If it contains &lt;code&gt;addCleanup(name.close)&lt;/code&gt;, waive. Ready in twenty minutes.&lt;/p&gt;

&lt;p&gt;I ran it against a regression corpus I built by hand — seven files, some real leaks, some handoff decoys:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HIGH=5  waived=3  kept=2
  WAIVED detach()              real_leak_comment.py:2   &amp;lt;-- wrong
  KEEP   expected_failure.py:5                          &amp;lt;-- wrong
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;real_leak_comment.py&lt;/code&gt; is a genuine leak: &lt;code&gt;f = open(p)&lt;/code&gt;, read, return, never closed. It got waived because it contains this comment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;read_all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;# later we could f.detach() but we never do&lt;/span&gt;
    &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A comment saying "we never detach" was read as evidence of detaching. And &lt;code&gt;expected_failure.py&lt;/code&gt; was &lt;em&gt;kept&lt;/em&gt; because my &lt;code&gt;assertRaises&lt;/code&gt;-and-&lt;code&gt;except OSError&lt;/code&gt; predicates both had to match in the same function body — they matched in CPython's version, not in mine.&lt;/p&gt;

&lt;p&gt;Two bugs, one corpus, twenty minutes. This is exactly how a "precision improvement" turns a noisy tool into a confidently wrong one: false negatives are silent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix #2: name the handoff with the AST
&lt;/h2&gt;

&lt;p&gt;The rewrite asks one question per finding — &lt;em&gt;was the handle handed off, and by which mechanism&lt;/em&gt; — and answers it on nodes, not text:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;detach()&lt;/code&gt; → a &lt;code&gt;Call&lt;/code&gt; whose &lt;code&gt;func&lt;/code&gt; is &lt;code&gt;Attribute(attr='detach')&lt;/code&gt; and whose receiver is that exact &lt;code&gt;Name&lt;/code&gt;. Comments cannot satisfy this.&lt;/li&gt;
&lt;li&gt;cleanup registry → &lt;code&gt;addCleanup(name.close)&lt;/code&gt; / &lt;code&gt;addCleanup(name.detach)&lt;/code&gt; / &lt;code&gt;atexit.register(name.close)&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;callee closes it → the name appears in an &lt;strong&gt;argument position&lt;/strong&gt; (including inside tuples, lists and lambdas: &lt;code&gt;threading.Thread(target=lambda: echo_datagrams(sock))&lt;/code&gt;), and the resolved callee's parameter is closed inside its own body.&lt;/li&gt;
&lt;li&gt;enclosing scope → &lt;code&gt;nonlocal name&lt;/code&gt; in the assignment's function; the outer scope closes it later.&lt;/li&gt;
&lt;li&gt;expected failure → the assignment sits inside a &lt;code&gt;Try&lt;/code&gt; whose handler catches &lt;code&gt;OSError&lt;/code&gt;/&lt;code&gt;PermissionError&lt;/code&gt; &lt;em&gt;and&lt;/em&gt; contains an assertion.&lt;/li&gt;
&lt;li&gt;ownership sink → passed to &lt;code&gt;connect_read_pipe&lt;/code&gt; / &lt;code&gt;connect_write_pipe&lt;/code&gt; / &lt;code&gt;fdopen&lt;/code&gt;, APIs that document taking the handle.&lt;/li&gt;
&lt;li&gt;mocked constructor → the file builds the call with &lt;code&gt;mock_open(...)&lt;/code&gt; or patches the called name.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Result on the same 1,851 files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HIGH=16  waived=16  kept=0
  WAIVED ownership-sink(connect_read_pipe) test/asyncio/test_events.py:1590
  WAIVED ownership-sink(connect_read_pipe) test/asyncio/test_events.py:1659
  WAIVED callee-closes(echo_datagrams)     test/asyncio/utils.py:285
  WAIVED detach()                          test/test_httplib.py:1502
  WAIVED expected-failure                  test/test_posix.py:1138
  WAIVED detach()                          test/test_socket.py:2046
  WAIVED enclosing-scope-owns              test/test_socket.py:5295
  WAIVED cleanup-registry                  test/test_socket.py:6152
  WAIVED detach()                          test/test_socket.py:7435
  WAIVED mocked-constructor                test/test_unittest/testmock/testwith.py:194
  ... (7 mocked-constructor total)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the part that matters more, the regression corpus, where two real leaks must survive:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HIGH=5  waived=3  kept=2
  WAIVED expected-failure        expected_failure.py:5
  WAIVED callee-closes(serve)    handoff_callee2.py:14
  WAIVED mocked-constructor      mocked.py:6
  KEEP   None                    real_leak.py:2
  KEEP   None                    real_leak_comment.py:2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The comment decoy now survives. That is the whole point: &lt;strong&gt;the AST version has fewer false positives and no new false negatives on the same corpus&lt;/strong&gt;, and both numbers are printed, not asserted.&lt;/p&gt;

&lt;h2&gt;
  
  
  Four rules I now ship with
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Every waiver carries a name.&lt;/strong&gt; The filter does not delete findings, it annotates them. &lt;code&gt;enclosing-scope-owns&lt;/code&gt; and &lt;code&gt;mocked-constructor&lt;/code&gt; are auditable claims; "waived: heuristic" is not. When a waiver is wrong you can see &lt;em&gt;which&lt;/em&gt; belief was wrong.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. "Unexplained" is not "clean".&lt;/strong&gt; The adjudicator exits 2 if anything survives, 0 if everything is explained, and it never conflates the two. The scanner itself already returns 3 when it finds zero &lt;code&gt;.py&lt;/code&gt; files — because a gate that only checks "exit code != 0" becomes decoration the day someone passes a wrong path.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. A HIGH severity is a claim about reviewer minutes, not about the defect.&lt;/strong&gt; Sixteen HIGH in a codebase means sixteen review minutes spent by someone who trusts the label. If the tool cannot distinguish "leak" from "handoff", the correct output is a &lt;em&gt;handoff candidate&lt;/em&gt; at the severity of a question, not a HIGH.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Precision is a property of the rule × the corpus, and the corpus moves.&lt;/strong&gt; My earlier calibration reported 1 HIGH on 736 files. Same rule, 1,851 files: 16. The rule did not get worse; the corpus grew a test tree full of deliberate ownership handoffs. Any "precision: 99%" claim that does not name its corpus and its file list is not a measurement — it is a vibe with a decimal point.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproduce it
&lt;/h2&gt;

&lt;p&gt;The scanner is one stdlib file: &lt;code&gt;scan&lt;/code&gt;, &lt;code&gt;rules&lt;/code&gt;, &lt;code&gt;selftest&lt;/code&gt; (40 assertions, exit code is the verdict), &lt;code&gt;--json&lt;/code&gt; for CI consumption. The adjudicator is two modules and only needs the report plus the source root.&lt;/p&gt;

&lt;p&gt;If you run a linter as a merge gate, the useful test is not "does it pass on my code" but: &lt;em&gt;take a corpus you did not write, run it, and read every HIGH by hand.&lt;/em&gt; I have not met a rule yet that survived that without learning a new handoff shape.&lt;/p&gt;

&lt;p&gt;The write-ups for this whole series of instrument-calibration experiments live in my repo: &lt;strong&gt;&lt;a href="https://github.com/Felixwang007/awesome-content-tools" rel="noopener noreferrer"&gt;github.com/Felixwang007/awesome-content-tools&lt;/a&gt;&lt;/strong&gt;. The scanner itself — with the calibration tables and an &lt;code&gt;evaluation_cases.md&lt;/code&gt; boundary statement — is packaged as a skill: &lt;a href="https://xiaping.coze.com/skill/a1931582-9a12-4a9d-bb14-c38720c1ae0d" rel="noopener noreferrer"&gt;资源泄漏与句柄清理体检助手&lt;/a&gt;. The seven adjudication predicates are spelled out above rather than pasted, because the shapes are the transferable part; each one is a dozen lines of &lt;code&gt;ast&lt;/code&gt; and you should be able to reimplement and re-measure them on your own corpus in an afternoon.&lt;/p&gt;

&lt;p&gt;If you have a scanner that reports zero on your codebase, I would like to know what its corpus was before it was your codebase.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>stocks</category>
    </item>
    <item>
      <title>I Tested 8 Stop-Loss Brackets on 32,485 A-Share Trades. The '1:2 Risk-Reward' Rule Needed 33% and Got 24%</title>
      <dc:creator>Felixwang007</dc:creator>
      <pubDate>Mon, 16 Nov 2026 11:50:57 +0000</pubDate>
      <link>https://dev.to/felixwang007/i-tested-8-stop-loss-brackets-on-32485-a-share-trades-the-12-risk-reward-rule-needed-33-and-3fh8</link>
      <guid>https://dev.to/felixwang007/i-tested-8-stop-loss-brackets-on-32485-a-share-trades-the-12-risk-reward-rule-needed-33-and-3fh8</guid>
      <description>&lt;p&gt;Every trading book hands you the same rule: risk 1 to make 2. Set the stop at -5%, the target at +10%, and you only need to be right one time in three.&lt;/p&gt;

&lt;p&gt;I had 32,485 A-share trades lying around, so I measured it. The rule got nowhere near one time in three. It hit 23.8% and only came out flat because of a bucket almost nobody budgets for.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;587 A-share names (538 Shanghai main board, 29 STAR, 6 ChiNext), 321 daily bars each, 2025-07-17 to 2026-11-12.&lt;/li&gt;
&lt;li&gt;Entry at the &lt;strong&gt;next day's open&lt;/strong&gt; after a signal day. No same-bar fill, no lookahead.&lt;/li&gt;
&lt;li&gt;Barriers measured from the entry price against intraday &lt;strong&gt;high/low&lt;/strong&gt;, horizon 20 trading days, sampled every 5 days. Because that overlaps, I re-ran everything at step 20 (8,131 non-overlapping entries) and flag any result that changes sign.&lt;/li&gt;
&lt;li&gt;When both barriers are touched on the same day I count it in its own bucket instead of silently picking a winner. Depending on width that bucket is 0.0%-1.7% of trades.&lt;/li&gt;
&lt;li&gt;Filling at the barrier is optimistic. I measured that separately instead of assuming it away.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The universe was flat over the sample: mean 20-day return -0.04%. Nothing here is beta.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 1: every "good" ratio missed its break-even rate
&lt;/h2&gt;

&lt;p&gt;"Needed" assumes zero timeouts and a barrier fill. Those assumptions favour the rule, and it still loses.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stop / Target&lt;/th&gt;
&lt;th&gt;Target hit first&lt;/th&gt;
&lt;th&gt;Stop hit first&lt;/th&gt;
&lt;th&gt;Timeout&lt;/th&gt;
&lt;th&gt;Mean per trade&lt;/th&gt;
&lt;th&gt;Hit rate needed&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;3% / 3%&lt;/td&gt;
&lt;td&gt;47.0%&lt;/td&gt;
&lt;td&gt;49.5%&lt;/td&gt;
&lt;td&gt;1.9%&lt;/td&gt;
&lt;td&gt;-0.08%&lt;/td&gt;
&lt;td&gt;50.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5% / 5%&lt;/td&gt;
&lt;td&gt;43.8%&lt;/td&gt;
&lt;td&gt;44.2%&lt;/td&gt;
&lt;td&gt;11.7%&lt;/td&gt;
&lt;td&gt;-0.08%&lt;/td&gt;
&lt;td&gt;50.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3% / 6%&lt;/td&gt;
&lt;td&gt;29.6%&lt;/td&gt;
&lt;td&gt;63.5%&lt;/td&gt;
&lt;td&gt;6.4%&lt;/td&gt;
&lt;td&gt;-0.07%&lt;/td&gt;
&lt;td&gt;33.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5% / 8%&lt;/td&gt;
&lt;td&gt;30.0%&lt;/td&gt;
&lt;td&gt;50.5%&lt;/td&gt;
&lt;td&gt;19.4%&lt;/td&gt;
&lt;td&gt;-0.03%&lt;/td&gt;
&lt;td&gt;38.5%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5% / 10%&lt;/td&gt;
&lt;td&gt;23.8%&lt;/td&gt;
&lt;td&gt;52.7%&lt;/td&gt;
&lt;td&gt;23.5%&lt;/td&gt;
&lt;td&gt;0.00%&lt;/td&gt;
&lt;td&gt;33.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8% / 16%&lt;/td&gt;
&lt;td&gt;14.7%&lt;/td&gt;
&lt;td&gt;35.6%&lt;/td&gt;
&lt;td&gt;49.6%&lt;/td&gt;
&lt;td&gt;+0.05%&lt;/td&gt;
&lt;td&gt;33.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10% / 10%&lt;/td&gt;
&lt;td&gt;29.2%&lt;/td&gt;
&lt;td&gt;24.5%&lt;/td&gt;
&lt;td&gt;46.3%&lt;/td&gt;
&lt;td&gt;0.00%&lt;/td&gt;
&lt;td&gt;50.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10% / 20%&lt;/td&gt;
&lt;td&gt;10.7%&lt;/td&gt;
&lt;td&gt;26.6%&lt;/td&gt;
&lt;td&gt;62.7%&lt;/td&gt;
&lt;td&gt;+0.04%&lt;/td&gt;
&lt;td&gt;33.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The only rows that didn't lose money are the ones where &lt;strong&gt;timeouts did all the work&lt;/strong&gt;. For 5%/10%, 23.5% of trades never touched either barrier, and those trades averaged +1.09% by day 20 — that bucket is what drags the mean to zero. The bracket itself is a 24%-hit-rate machine that needs 33%.&lt;/p&gt;

&lt;p&gt;The wider the target, the faster the hit rate collapses. That's not a tuning problem, it's arithmetic: a 10% target inside a 20-day window in a market whose 20-day mean is -0.04%.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 2: the tight bracket is a coin flip with a fee
&lt;/h2&gt;

&lt;p&gt;At ±3%, timeouts are 1.9%. You're not trading a trend anymore, you're trading intraday noise, and the noise costs 0.08% per trade. 49.5% against 47.0% is not a strategy, it's a coin that pays the house.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 3: the population matters more than the bracket
&lt;/h2&gt;

&lt;p&gt;Same ±5% bracket, split by whether the signal day closed above its 20-day moving average:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Population&lt;/th&gt;
&lt;th&gt;Target hit first&lt;/th&gt;
&lt;th&gt;Mean per trade&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Close &amp;gt; MA20&lt;/td&gt;
&lt;td&gt;46.0%&lt;/td&gt;
&lt;td&gt;+0.03%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Close &amp;lt; MA20&lt;/td&gt;
&lt;td&gt;41.8%&lt;/td&gt;
&lt;td&gt;-0.17%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The bracket didn't improve. The population did. Fix the population first, then tune the bracket — the reverse order just fits a rule to names you should not have been in.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 4: a stop's value is in the tail, not in the mean
&lt;/h2&gt;

&lt;p&gt;Drop the target and use the stop alone, holding to day 20 otherwise:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stop&lt;/th&gt;
&lt;th&gt;Mean&lt;/th&gt;
&lt;th&gt;Std dev&lt;/th&gt;
&lt;th&gt;5th pct&lt;/th&gt;
&lt;th&gt;1st pct&lt;/th&gt;
&lt;th&gt;Worst&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;none (hold)&lt;/td&gt;
&lt;td&gt;-0.04%&lt;/td&gt;
&lt;td&gt;12.38%&lt;/td&gt;
&lt;td&gt;-16.69%&lt;/td&gt;
&lt;td&gt;-27.55%&lt;/td&gt;
&lt;td&gt;-56.21%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-3%&lt;/td&gt;
&lt;td&gt;+0.01%&lt;/td&gt;
&lt;td&gt;7.85%&lt;/td&gt;
&lt;td&gt;-3.00%&lt;/td&gt;
&lt;td&gt;-3.00%&lt;/td&gt;
&lt;td&gt;-3.00%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-5%&lt;/td&gt;
&lt;td&gt;+0.05%&lt;/td&gt;
&lt;td&gt;9.38%&lt;/td&gt;
&lt;td&gt;-5.00%&lt;/td&gt;
&lt;td&gt;-5.00%&lt;/td&gt;
&lt;td&gt;-5.00%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-8%&lt;/td&gt;
&lt;td&gt;+0.06%&lt;/td&gt;
&lt;td&gt;10.66%&lt;/td&gt;
&lt;td&gt;-8.00%&lt;/td&gt;
&lt;td&gt;-8.00%&lt;/td&gt;
&lt;td&gt;-8.00%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-10%&lt;/td&gt;
&lt;td&gt;+0.05%&lt;/td&gt;
&lt;td&gt;11.16%&lt;/td&gt;
&lt;td&gt;-10.00%&lt;/td&gt;
&lt;td&gt;-10.00%&lt;/td&gt;
&lt;td&gt;-10.00%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-15%&lt;/td&gt;
&lt;td&gt;+0.02%&lt;/td&gt;
&lt;td&gt;11.82%&lt;/td&gt;
&lt;td&gt;-15.00%&lt;/td&gt;
&lt;td&gt;-15.00%&lt;/td&gt;
&lt;td&gt;-15.00%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The mean barely moves — and honestly, it isn't robust. The paired difference is +0.09pp in favour of the stop on the overlapping sample (t = -1.98), but on the non-overlapping sample it flips to +0.19pp in favour of holding. If your argument for a stop is "it improves the average", you don't have an argument.&lt;/p&gt;

&lt;p&gt;The tail, though, is mechanical, not statistical. The 5th percentile goes from -16.69% to -5.00%. The 1st percentile from -27.55% to -5.00%. The worst trade from -56.21% to -5.00%. Std dev from 12.38% to 9.38%. &lt;strong&gt;A stop doesn't buy you return, it buys you a bounded distribution&lt;/strong&gt; — and that's the thing that decides whether you get to keep trading.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 5: a third of your stops are wicks
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;56.83% of 20-day windows touched -5% intraday.&lt;/li&gt;
&lt;li&gt;49.02% closed below -5%.&lt;/li&gt;
&lt;li&gt;The difference, 7.8pp, is trades that went through your stop and finished the day above it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you can only act on the close, your stop gets hit 7.8 percentage points less often, on the same population. That's free information.&lt;/p&gt;

&lt;p&gt;Timing matters too: median day to touch is &lt;strong&gt;6 of 20&lt;/strong&gt;, and &lt;strong&gt;59.6% of all touches happen in the first 7 days&lt;/strong&gt;. The stop decision is a week-one decision. If a trade is going to shake you out, it usually does it before you've had time to build a story about it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 6: gaps get through, and you should price that in
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Bracket&lt;/th&gt;
&lt;th&gt;Stops filled through the barrier&lt;/th&gt;
&lt;th&gt;Median fill&lt;/th&gt;
&lt;th&gt;Mean fill&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;3% / 3%&lt;/td&gt;
&lt;td&gt;6.0% of all stops&lt;/td&gt;
&lt;td&gt;-3.47%&lt;/td&gt;
&lt;td&gt;-3.86%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5% / 5%&lt;/td&gt;
&lt;td&gt;7.8%&lt;/td&gt;
&lt;td&gt;-5.53%&lt;/td&gt;
&lt;td&gt;-6.00%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5% / 10%&lt;/td&gt;
&lt;td&gt;8.0%&lt;/td&gt;
&lt;td&gt;-5.58%&lt;/td&gt;
&lt;td&gt;-6.08%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10% / 20%&lt;/td&gt;
&lt;td&gt;9.9%&lt;/td&gt;
&lt;td&gt;-10.65%&lt;/td&gt;
&lt;td&gt;-11.14%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A -5% stop is really a -5.08% stop once you weight the 7.8% that opened below it. A -3% stop is worse in relative terms. Limit-down opens in A-shares don't ask permission.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result 7: the first week sorts trades into two different worlds
&lt;/h2&gt;

&lt;p&gt;Of the 18,461 trades that touched -5%:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;mean 20-day return: &lt;strong&gt;-5.16%&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;ended positive: 20.7%&lt;/li&gt;
&lt;li&gt;ended above +10%: 5.8%&lt;/li&gt;
&lt;li&gt;ended below -10%: 25.5%&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Of the 14,024 that never touched it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;mean 20-day return: &lt;strong&gt;+6.69%&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;ended positive: 74.6%&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is hindsight selection — you cannot trade "names that never touched -5%", and I'm not pretending otherwise. What it does show is that the stop isn't merely a loss limit. Being stopped out is a strong signal that you're in the other distribution, and the two distributions barely overlap in outcome.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I actually changed
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;8%+ stop distance for 20-day horizons.&lt;/strong&gt; Anything tighter than the noise band is a coin flip with a fee. The ±3% row is the cleanest evidence: 94% of trades resolve, and they resolve at chance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never pair a wide target with a narrow stop and expect width to fix the hit rate.&lt;/strong&gt; 5%/10% needs 33.3% and delivers 23.8%. The only reason people think it works is the timeout bucket.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Filter the population before the bracket.&lt;/strong&gt; Same ±5% is +0.03% above MA20 and -0.17% below it. One line of code beats any amount of stop tuning.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Close-based stops when you can't watch intraday.&lt;/strong&gt; 7.8pp fewer false stops on identical data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Size for the fill, not the barrier.&lt;/strong&gt; Budget ~0.1pp of slippage on a -5% stop; more on tighter ones.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Caveats, because this is one sample
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;587 names, mostly one exchange, one 16-month regime. Not a claim about A-shares in general.&lt;/li&gt;
&lt;li&gt;Barriers can be blown through; fills at the barrier are optimistic and I only corrected for gap-through, not intraday slippage or liquidity.&lt;/li&gt;
&lt;li&gt;5-day sampling overlaps; every result I quote here I also re-ran at step 20 and said so where the sign flipped.&lt;/li&gt;
&lt;li&gt;The MA20 split is in-sample. It's a filter direction, not a fitted parameter.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why this belongs in an agent's skill file
&lt;/h2&gt;

&lt;p&gt;These rules live in the A-share skill my coding agent loads before it screens anything. The reason isn't the numbers — it's that an LLM will happily write &lt;code&gt;stop_loss: 0.03, take_profit: 0.06&lt;/code&gt; into a config file and call it risk management, because it looks like risk management. The calibration gate is what stops that from shipping.&lt;/p&gt;

&lt;p&gt;The study scripts are plain stdlib Python against cached JSON — no pandas, no TA library, reproducible in about 1.4 seconds per run. The write-ups and tools I keep public are here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;strong&gt;&lt;a href="https://github.com/Felixwang007/awesome-content-tools" rel="noopener noreferrer"&gt;https://github.com/Felixwang007/awesome-content-tools&lt;/a&gt;&lt;/strong&gt; — the audit write-ups and the small verification tools (gate checks, idempotency probes, clock calibration) that come out of this habit.&lt;/li&gt;
&lt;li&gt;The A-share skill packages (screening, three-pillar scoring, and this stop calibration) are published on 虾评 / xiaping for anyone wiring an agent into Chinese market data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you take one thing: measure the barrier before you trust it. The bracket you were taught needs a hit rate the market doesn't hand out.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>stocks</category>
    </item>
    <item>
      <title>My 'Three-Pillar' Stock Scorer Had a Negative IC. The Only Pillar That Worked Was Mislabeled.</title>
      <dc:creator>Felixwang007</dc:creator>
      <pubDate>Thu, 12 Nov 2026 11:45:31 +0000</pubDate>
      <link>https://dev.to/felixwang007/my-three-pillar-stock-scorer-had-a-negative-ic-the-only-pillar-that-worked-was-mislabeled-58eg</link>
      <guid>https://dev.to/felixwang007/my-three-pillar-stock-scorer-had-a-negative-ic-the-only-pillar-that-worked-was-mislabeled-58eg</guid>
      <description>&lt;p&gt;I built a Chinese A-share stock scorer last year with a clean story: &lt;strong&gt;three independent pillars&lt;/strong&gt; — technical (24 indicators), "intel" (volume/price behavior), and "fundamental" (valuation). Sum the three scores, rank the universe, buy the top 50.&lt;/p&gt;

&lt;p&gt;On 2026-11-12 it printed this top five: 沪农商行, 华能国际, 济川药业, 张江高科, 永臻股份. A regional bank, a utility, a pharma, a property park, and a solar-frame maker. Plausible-looking output. So I did the thing I should have done a year ago: I measured whether the score predicts anything.&lt;/p&gt;

&lt;p&gt;It doesn't. Two of the three pillars have &lt;em&gt;negative&lt;/em&gt; information coefficient. The one pillar with a positive IC is the one whose name is a lie.&lt;/p&gt;

&lt;p&gt;Here's the audit, the numbers, and the three rules I now ship instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Universe:&lt;/strong&gt; 587 Shanghai/Shenzhen stocks from my own scanner cache, 180 forward-adjusted (qfq) daily bars each, pulled from Tencent's kline endpoint in 14 seconds with 8 threads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Method:&lt;/strong&gt; for each of the last 70 rebalance dates (2026-07-23 → 2026-11-05), compute all three pillar scores for every stock using only data available up to that day, then measure each pillar's &lt;strong&gt;cross-sectional Spearman correlation with the next 5-day return&lt;/strong&gt; (rank IC).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sample:&lt;/strong&gt; 70 dates × 587 stocks = &lt;strong&gt;41,090 stock-day observations&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Benchmark:&lt;/strong&gt; the average 5-day forward return across the whole sample was &lt;strong&gt;−0.175%&lt;/strong&gt;. That number matters for reading the decile table later.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Crucially, I did not rewrite the scorer for the audit. I imported &lt;code&gt;tech_analysis()&lt;/code&gt; and &lt;code&gt;intel_score()&lt;/code&gt; from the shipped module and fed them sliding windows, so the thing being measured is the thing that runs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;three_pillar_v2&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;tech_analysis&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;intel_score&lt;/span&gt;   &lt;span class="c1"&gt;# the real implementation&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;start_i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;slice_d&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d_full&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;              &lt;span class="c1"&gt;# sliding window, no future data&lt;/span&gt;
    &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;tech_analysis&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;it&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;intel_score&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;f&lt;/span&gt;     &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;fund_score_as_implemented&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;price_today&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;d_full&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'close'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;fwd&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;d_full&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'close'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;d_full&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'close'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="n"&gt;per_date&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;d_full&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'date'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;'t'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'i'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;it&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'f'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'fwd'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;fwd&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Result: the signs are wrong
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pillar&lt;/th&gt;
&lt;th&gt;Mean IC&lt;/th&gt;
&lt;th&gt;t-stat&lt;/th&gt;
&lt;th&gt;IR&lt;/th&gt;
&lt;th&gt;Dates with IC &amp;gt; 0&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Technical (24 indicators)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−0.0479&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;−2.72&lt;/td&gt;
&lt;td&gt;−0.33&lt;/td&gt;
&lt;td&gt;27.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Intel (volume/price)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−0.0552&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;−3.31&lt;/td&gt;
&lt;td&gt;−0.40&lt;/td&gt;
&lt;td&gt;32.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;"Fundamental"&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+0.0598&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;+2.12&lt;/td&gt;
&lt;td&gt;+0.25&lt;/td&gt;
&lt;td&gt;64.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Composite (as shipped)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−0.0402&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;−2.11&lt;/td&gt;
&lt;td&gt;−0.25&lt;/td&gt;
&lt;td&gt;32.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Read the last row first: the composite score, the thing I actually used to make decisions, has a &lt;strong&gt;negative&lt;/strong&gt; rank IC that is significant at t = −2.11. In this sample, higher score meant &lt;em&gt;lower&lt;/em&gt; next-5-day return. The technical pillar produced a positive IC on only 19 of 70 dates.&lt;/p&gt;

&lt;p&gt;This isn't a subtle "signal is weak" result. A weak signal centres on zero and gets lost in noise. This one centres on the wrong side of zero, and the t-stat is large enough that "it's just noise" is the less likely explanation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The decile table is the part that stings
&lt;/h2&gt;

&lt;p&gt;Ten equal buckets by composite score, each with 4,109 observations:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Decile&lt;/th&gt;
&lt;th&gt;Score range&lt;/th&gt;
&lt;th&gt;Mean 5-day return&lt;/th&gt;
&lt;th&gt;Win rate&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;D1 (worst score)&lt;/td&gt;
&lt;td&gt;−8 … 1&lt;/td&gt;
&lt;td&gt;−0.089%&lt;/td&gt;
&lt;td&gt;45.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D2&lt;/td&gt;
&lt;td&gt;1 … 3&lt;/td&gt;
&lt;td&gt;+0.145%&lt;/td&gt;
&lt;td&gt;48.8%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D3&lt;/td&gt;
&lt;td&gt;3 … 4&lt;/td&gt;
&lt;td&gt;+0.146%&lt;/td&gt;
&lt;td&gt;49.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D4&lt;/td&gt;
&lt;td&gt;4 … 5&lt;/td&gt;
&lt;td&gt;−0.040%&lt;/td&gt;
&lt;td&gt;45.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D5&lt;/td&gt;
&lt;td&gt;5 … 6&lt;/td&gt;
&lt;td&gt;−0.175%&lt;/td&gt;
&lt;td&gt;45.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D6&lt;/td&gt;
&lt;td&gt;6 … 7&lt;/td&gt;
&lt;td&gt;−0.243%&lt;/td&gt;
&lt;td&gt;44.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D7&lt;/td&gt;
&lt;td&gt;7 … 8&lt;/td&gt;
&lt;td&gt;−0.035%&lt;/td&gt;
&lt;td&gt;44.7%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D8&lt;/td&gt;
&lt;td&gt;8 … 9&lt;/td&gt;
&lt;td&gt;−0.447%&lt;/td&gt;
&lt;td&gt;42.5%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D9&lt;/td&gt;
&lt;td&gt;9 … 11&lt;/td&gt;
&lt;td&gt;−0.291%&lt;/td&gt;
&lt;td&gt;42.8%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;D10 (best score)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;11 … 24&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−0.717%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;39.9%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;D10 − D1 spread = &lt;strong&gt;−0.628 percentage points&lt;/strong&gt;. Top three deciles minus bottom three = &lt;strong&gt;−0.552 pp&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Two honest caveats on this table. It is &lt;strong&gt;not monotone&lt;/strong&gt; — D2 and D3 are the best buckets, and D7 sits oddly above D6. And every bucket is negative in absolute terms because the universe fell over this window. What the table does support is narrower and still damning: &lt;em&gt;the highest-scoring stocks underperformed the universe average by 0.54 pp over five days, and won less often (39.9% vs 45.9%).&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding 2: the pillars were independent, and that made it worse
&lt;/h2&gt;

&lt;p&gt;My original reasoning for "three pillars" was that independent evidence should be weighted together. So — are they independent?&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pair&lt;/th&gt;
&lt;th&gt;Mean daily cross-sectional correlation&lt;/th&gt;
&lt;th&gt;Top-50 overlap&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;technical ↔ intel&lt;/td&gt;
&lt;td&gt;+0.136&lt;/td&gt;
&lt;td&gt;24%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;technical ↔ "fundamental"&lt;/td&gt;
&lt;td&gt;+0.020&lt;/td&gt;
&lt;td&gt;10%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;intel ↔ "fundamental"&lt;/td&gt;
&lt;td&gt;−0.033&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;They are nearly orthogonal. The overlap between the technical top-50 and the "fundamental" top-50 is &lt;strong&gt;about 5 stocks&lt;/strong&gt;. So my independence assumption was correct — and it's exactly what made the composite bad. Averaging three nearly independent votes is a variance-reduction technique. It does not fix signs. Two confidently wrong, uncorrelated votes plus one right vote gives you a confidently wrong average with a tighter confidence interval.&lt;/p&gt;

&lt;p&gt;That's the design lesson I keep re-learning from both agent systems and factor models: &lt;strong&gt;independence buys you variance reduction, it does not buy you validity.&lt;/strong&gt; You must measure the sign of each vote before you let it into the sum. And a composite's IC is not the average of its components' ICs when their scales differ — mine sums raw points where, on today's cross-section, the technical channel ranges −4…+12 (17 distinct values) while "fundamental" ranges 0…3 (4 distinct values), so the composite is mostly the technical pillar wearing a trench coat.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding 3: the only pillar that worked isn't fundamentals
&lt;/h2&gt;

&lt;p&gt;Here is the entire "fundamental" scoring function as shipped:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;fund_score&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;      &lt;span class="c1"&gt;# cheap-looking price&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;closes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;vol&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;stdev&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;closes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;closes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;vol&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;  &lt;span class="c1"&gt;# "moderate volatility"&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No P/E, no P/B, no ROE, no revenue, no debt. The &lt;code&gt;fundamentals&lt;/code&gt; dict in my cache holds &lt;strong&gt;zero entries&lt;/strong&gt;. What the pillar actually encodes is &lt;em&gt;absolute share price level plus recent volatility&lt;/em&gt;. Its score takes exactly four distinct values {0, 1, 2, 3}, so it isn't even a real ranking — it's a coarse bucket.&lt;/p&gt;

&lt;p&gt;And it's the only positive one. Which raises the obvious objection: &lt;strong&gt;look-ahead bias.&lt;/strong&gt; The shipped function reads today's price from the live cache even when scoring a historical date, so a stock that fell below ¥30 gets ±2 points applied to its entire past. That's a genuine bug. So I re-ran it point-in-time, using the close on the evaluation date:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variant&lt;/th&gt;
&lt;th&gt;Mean IC&lt;/th&gt;
&lt;th&gt;t-stat&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;As shipped (today's price)&lt;/td&gt;
&lt;td&gt;+0.0598&lt;/td&gt;
&lt;td&gt;+2.12&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Point-in-time price&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+0.0674&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+2.48&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The look-ahead bug was &lt;em&gt;hurting&lt;/em&gt; it, not helping. The cheap-and-quiet-stock effect is real in this sample, survives the fix, and is the only thing in my three-pillar story that isn't noise or inverted.&lt;/p&gt;

&lt;p&gt;Stability check across the two halves of the window:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pillar&lt;/th&gt;
&lt;th&gt;2026-07-23 → 09-09&lt;/th&gt;
&lt;th&gt;2026-09-10 → 11-05&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Technical&lt;/td&gt;
&lt;td&gt;−0.073 (t=−2.57)&lt;/td&gt;
&lt;td&gt;−0.023 (t=−1.12)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Intel&lt;/td&gt;
&lt;td&gt;−0.035 (t=−1.72)&lt;/td&gt;
&lt;td&gt;−0.075 (t=−2.87)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;"Fundamental"&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;+0.0597&lt;/strong&gt; (t=1.48)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;+0.060&lt;/strong&gt; (t=1.51)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Composite&lt;/td&gt;
&lt;td&gt;−0.056 (t=−1.84)&lt;/td&gt;
&lt;td&gt;−0.025 (t=−1.06)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The price-level pillar is the only one whose magnitude is stable across halves (+0.0597 and +0.0600 — a coincidence, but a useful one). Neither half alone clears |t| &amp;gt; 2, which is exactly why pooling 70 dates matters and why I refuse to call this "validated." Monthly, it is positive in four of five months and −0.22 in November, which had only 4 evaluation dates.&lt;/p&gt;

&lt;p&gt;The technical pillar, by the way, flips monthly: +0.007 (Jul), −0.116 (Aug), −0.083 (Sep), +0.043 (Oct), +0.011 (Nov). It is not simply tracking market direction either — August was an up month and October was a down month, and the IC signs are the reverse of what a naive "momentum works in uptrends" story would predict. Five monthly observations cannot settle that question. I'm not going to pretend they do.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding 4: a pillar that emits zeros isn't a pillar
&lt;/h2&gt;

&lt;p&gt;On today's cross-section, the intel pillar assigns &lt;strong&gt;exactly 0 to 52.6% of the universe&lt;/strong&gt; and has only 11 distinct values. A scoring channel that abstains on half the sample is not ranking; it's a sparse flag that occasionally fires. Same for "fundamental": 4 distinct values, 9.4% zeros.&lt;/p&gt;

&lt;p&gt;If a component can't produce a spread, it contributes variance without information. Before adding a pillar, the cheapest useful test is: &lt;em&gt;how many distinct values does it emit, and what share is zero?&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The stale-cache bug I found on the way
&lt;/h2&gt;

&lt;p&gt;While loading data I noticed my cache claims &lt;strong&gt;587 stocks&lt;/strong&gt;, but only &lt;strong&gt;21&lt;/strong&gt; had a bar dated 2026-11-12. The other &lt;strong&gt;563 had their last bar on 2026-07-16&lt;/strong&gt; — 558 of them holding only 33 bars each, frozen for four months.&lt;/p&gt;

&lt;p&gt;The scanner never checks this. It builds "today's top 10" by iterating every symbol it knows, scoring whatever &lt;code&gt;[-1]&lt;/code&gt; happens to be. So a freshly-published ranking can contain stocks whose most recent data is a four-month-old close, with nothing in the output indicating it. That's the same failure class I've written about before: &lt;strong&gt;the pipeline reports success because it computed a number, not because it looked at a current one.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My fix is one assertion before any ranking ships:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="nb"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'date'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;market_date&lt;/span&gt;
           &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;universe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;values&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"stale rows in universe"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it fires, you get an error, not a ranking. A silent 96% staleness rate is worse than a crash.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I ship now instead of a three-pillar sum
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Every pillar must publish its IC and window before it can vote.&lt;/strong&gt; No IC, no weight — even if the pillar sounds sophisticated. "24 indicators" is not evidence; −0.0479 with t = −2.72 is evidence, and it says don't use it as a positive signal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Weight by sign as well as strength, and only when the sign holds in both halves.&lt;/strong&gt; In this audit only one pillar qualifies, so the current weighting isn't "three pillars averaged" — it's one factor at a measured weight, with the other two demoted to &lt;em&gt;veto&lt;/em&gt; roles (they can flag a name for review; they can no longer add points to a buy list).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Score scale must be normalised per pillar (z-score or percentile) before summation.&lt;/strong&gt; Raw point-sums let whichever pillar has the widest range silently become the whole model. Mine let a ±15-point technical pillar dominate a ±3-point valuation one.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And one thing I deliberately did &lt;strong&gt;not&lt;/strong&gt; do: invert the technical pillar and start trading its bottom decile. A negative IC measured on 70 dates of a falling tape is a hypothesis about a regime, not a strategy. My previous work on this market found that oversold-rebound setups did show a positive edge over a 640-day sample, which makes it quite likely that this window's negative technical IC is a regime artifact rather than a permanent property. Reversing a signal because it lost money for four months is how backtests get curve-fitted into ruin.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits of this audit, stated plainly
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;70 rebalance dates, ~3.5 months, one market, one falling regime. Not a cycle.&lt;/li&gt;
&lt;li&gt;587-stock liquid universe drawn from my own cache — not the full ~5,200-stock market, and subject to whatever selection my cache accumulated.&lt;/li&gt;
&lt;li&gt;5-day horizon only, close-to-close, &lt;strong&gt;no transaction costs, no slippage, no limit-up tradability filter&lt;/strong&gt;. Chinese A-shares have price limits and T+1 settlement; a 5-day backtest that ignores them overstates any edge.&lt;/li&gt;
&lt;li&gt;IC measures ranking, not returns. A negative IC does not mean "the inverse strategy prints money."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But none of those caveats rescue the composite. A scorer whose best idea is "prefer stocks with a low absolute share price" and whose other two channels point the wrong way should not be presented as a three-pillar system. It should be presented as one weak factor and two things I hadn't tested.&lt;/p&gt;




&lt;p&gt;Reproducibility: 587 stocks, 180 qfq bars, 41,090 observations, 70 IC dates, one script. The measurement tooling behind this (and behind my parallel-tool batching, timeout phase probes, and clock-calibration studies) lives in &lt;a href="https://github.com/Felixwang007/awesome-content-tools" rel="noopener noreferrer"&gt;my GitHub repo&lt;/a&gt; — the general principle in all of them is the same: don't trust the number, measure what the number predicts.&lt;/p&gt;

&lt;p&gt;If you want the packaged version with the scanner and the IC/half-split gate built in, it's listed on &lt;a href="https://xiaping.coze.com" rel="noopener noreferrer"&gt;虾评 (Xiaping)&lt;/a&gt; — the skill marketplace where I publish these tools with their self-tests attached.&lt;/p&gt;

&lt;p&gt;If you've audited a multi-factor scorer and the composite beat its best component, I'd like to see the methodology — that's the result I couldn't produce.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>stocks</category>
    </item>
    <item>
      <title>My 'Updated Every 6 Hours' Site Served 45-Day-Old Data. GitHub Never Failed Once.</title>
      <dc:creator>Felixwang007</dc:creator>
      <pubDate>Mon, 09 Nov 2026 10:45:56 +0000</pubDate>
      <link>https://dev.to/felixwang007/my-updated-every-6-hours-site-served-45-day-old-data-github-never-failed-once-3ebg</link>
      <guid>https://dev.to/felixwang007/my-updated-every-6-hours-site-served-45-day-old-data-github-never-failed-once-3ebg</guid>
      <description>&lt;p&gt;My site's header said &lt;strong&gt;"auto-collected · updated daily · zero API dependencies · fully automated on GitHub."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It was serving data from &lt;strong&gt;2026-09-25 17:02 UTC&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Today is 2026-11-09. That's 44.7 days of a page that renders perfectly, returns HTTP 200, and lies to every visitor — including me, because I was the one who built it and I never noticed.&lt;/p&gt;

&lt;p&gt;Here is the part that should bother you more than the staleness: &lt;strong&gt;GitHub never reported a single failure.&lt;/strong&gt; Not one red X. The 234-run history is 100% green.&lt;/p&gt;

&lt;h2&gt;
  
  
  The failure was an absence, not an error
&lt;/h2&gt;

&lt;p&gt;The project is &lt;a href="https://github.com/Felixwang007/github-daily-trending" rel="noopener noreferrer"&gt;github-daily-trending&lt;/a&gt;: a workflow that scrapes GitHub Trending every 6 hours, regenerates a static page, and deploys it to Pages. The workflow file is unremarkable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;schedule&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;cron&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;0&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*/6&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*'&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;main&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
  &lt;span class="na"&gt;workflow_dispatch&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

&lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;contents&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;read&lt;/span&gt;      &lt;span class="c1"&gt;# &amp;lt;-- read-only, this matters later&lt;/span&gt;
  &lt;span class="na"&gt;pages&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;
  &lt;span class="na"&gt;id-token&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I checked the repository API and got a number I did not expect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET /repos/Felixwang007/github-daily-trending/actions/workflows
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Daily Trending Deploy  | state = disabled_inactivity
pages-build-deployment | state = active
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;state: disabled_inactivity&lt;/code&gt;. Not &lt;code&gt;disabled_manually&lt;/code&gt;. Not a failed run. The scheduler had switched my workflow off and told exactly one API field about it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The timeline, to the hour
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Event&lt;/th&gt;
&lt;th&gt;UTC timestamp&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Only human commit (&lt;code&gt;init&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;2026-07-27 13:28:34&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;60-day inactivity mark&lt;/td&gt;
&lt;td&gt;2026-09-25 13:28:34&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Last successful run&lt;/td&gt;
&lt;td&gt;2026-09-25 17:01:50 (+3.6 h)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4 commits pushed&lt;/td&gt;
&lt;td&gt;2026-10-29 12:56 → &lt;strong&gt;0 runs&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Page served to visitors&lt;/td&gt;
&lt;td&gt;stale, 44.7 days&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;234 workflow runs at 4/day across 60.1 days lines up almost exactly (≈241 expected, minus the slots that never fired after the cutoff). Since the disable, roughly &lt;strong&gt;179 scheduled invocations were skipped&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;GitHub disables &lt;code&gt;schedule&lt;/code&gt; triggers in public repositories after 60 days without repository activity. My workflow had &lt;code&gt;contents: read&lt;/code&gt;, so it deployed an artifact and &lt;strong&gt;wrote nothing back to the repository&lt;/strong&gt;. Its own activity therefore never counted as activity. The automation was structurally incapable of keeping its own clock alive:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A pipeline that only reads from the repo can never prove the repo is alive.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is not a GitHub bug. That is a design defect on my side, and it took 45 days of silently wrong data to surface it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The detail that proves it isn't my code
&lt;/h2&gt;

&lt;p&gt;On 2026-10-29 I pushed four commits to &lt;code&gt;main&lt;/code&gt; while adding an unrelated probe script. The workflow has &lt;code&gt;push&lt;/code&gt; in its &lt;code&gt;on:&lt;/code&gt; block, so those commits should have produced four runs.&lt;/p&gt;

&lt;p&gt;They produced zero. Disabling by inactivity doesn't just kill the schedule — it detaches every trigger from the workflow. So the natural first hypothesis, "my scraper broke," was wrong, and I would have wasted hours reading Python tracebacks that never existed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why nothing alerted me
&lt;/h2&gt;

&lt;p&gt;Every check I had — and, I suspect, every check most people have — is defined over &lt;strong&gt;the set of runs&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Did the last run fail?" → there is no last run, so nothing to fail&lt;/li&gt;
&lt;li&gt;"Is the success rate dropping?" → 234/234, perfect score&lt;/li&gt;
&lt;li&gt;"Did the deploy step error?" → the deploy step didn't execute&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When the set of executions is empty, every predicate over that set is vacuously true. The green history was a record of &lt;em&gt;past invocations&lt;/em&gt;, and I had been reading it as evidence that the &lt;em&gt;trigger still existed&lt;/em&gt;. Those are different claims, and only one of them was still being tested.&lt;/p&gt;

&lt;h2&gt;
  
  
  The signal was there the whole time
&lt;/h2&gt;

&lt;p&gt;You don't need to scrape the UI banner. The state is a first-class API field. Here is the check I now run, ~90 lines, no dependencies beyond stdlib — it reads each workflow's &lt;code&gt;state&lt;/code&gt;, parses the cron cadence from the workflow file, and compares the last run's age against that cadence:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;wfs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;_get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;API&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/repos/&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;repo&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/actions/workflows&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;wf&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;wfs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;workflows&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
    &lt;span class="n"&gt;crons&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;_workflow_crons&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;repo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;wf&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;path&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# from the YAML body
&lt;/span&gt;    &lt;span class="n"&gt;interval&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_parse_cron_interval_minutes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;crons&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;runs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;_get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;API&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/repos/&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;repo&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/actions/workflows/&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;wf&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;id&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/runs?per_page=1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;age_h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;hours_since&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;runs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;workflow_runs&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;created_at&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;wf&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;state&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;disabled_inactivity&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;verdict&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;DISABLED_INACTIVITY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;        &lt;span class="c1"&gt;# platform stopped calling it
&lt;/span&gt;    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;wf&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;state&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;disabled_manually&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;verdict&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;DISABLED_MANUALLY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;age_h&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;interval&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;verdict&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;STALE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;                      &lt;span class="c1"&gt;# active, but not firing on time
&lt;/span&gt;    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;verdict&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;OK&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Real output from the broken repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"repo"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Felixwang007/github-daily-trending"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"workflow"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Daily Trending Deploy"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
 &lt;/span&gt;&lt;span class="nl"&gt;"state"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"disabled_inactivity"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"cron"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"0 */6 * * *"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"interval_min"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;360&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
 &lt;/span&gt;&lt;span class="nl"&gt;"last_run"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-09-25T17:01:50Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"age_hours"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;1073.6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
 &lt;/span&gt;&lt;span class="nl"&gt;"verdict"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"DISABLED_INACTIVITY"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And a positive control (&lt;code&gt;home-assistant/core&lt;/code&gt;) so the tool isn't just always shouting:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"workflow"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Build images"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"state"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"active"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"cron"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"0 2 * * *"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
 &lt;/span&gt;&lt;span class="nl"&gt;"interval_min"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1440&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"age_hours"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;8.4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"verdict"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"OK"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two design notes, because both matter for false-alarm hygiene:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The cron parser only interprets &lt;code&gt;*&lt;/code&gt;, &lt;code&gt;*/N&lt;/code&gt;, and hourly shapes. Expressions it cannot parse (weekly, or with trailing inline comments) degrade to &lt;em&gt;"cannot judge staleness"&lt;/em&gt; rather than &lt;em&gt;"alarm"&lt;/em&gt;. An unreadable schedule is not evidence of a broken one.&lt;/li&gt;
&lt;li&gt;Non-scheduled workflows (like the Pages build) have no cadence, so they are never reported as stale.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Exit code is 0 when every schedule is alive, 2 when anything isn't, 3 when it had no repo to check. "I had nothing to look at" is a distinct outcome from "everything is fine" — the same lesson as the 45 missing days, applied one level up.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fixes, ranked by how much I trust them
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Make the trigger external.&lt;/strong&gt; The 60-day clock is computed by GitHub, and GitHub is also the system that would need to tell me the clock expired. Judgement can't live inside the thing being judged. The durable fix is a trigger from outside: an external cron (a VPS, another platform, even a laptop &lt;code&gt;at&lt;/code&gt; job) calls &lt;code&gt;POST /repos/{o}/{r}/actions/workflows/{file}/dispatches&lt;/code&gt; once a week. Then the schedule's own health stops mattering.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Alarm on the artifact's age, not on CI colour.&lt;/strong&gt; The deployed page writes its own &lt;code&gt;updated_at&lt;/code&gt;. Comparing &lt;em&gt;that&lt;/em&gt; against wall-clock time is a measurement I control and it would have fired on day 1. CI status was a measurement that disappeared along with the thing it described.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Keepalive commits — treat as unproven.&lt;/strong&gt; Writing a timestamp file back into the repo is the popular trick. I'm not relying on it: the same "is this repo active?" heuristic that decided I was dormant is the one that would have to accept a bot commit as activity, and I can't verify that from the outside.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I did today, measured:&lt;/strong&gt; re-enabled the workflow (&lt;code&gt;PUT .../actions/workflows/321419158/enable&lt;/code&gt;, HTTP 204 → &lt;code&gt;state: active&lt;/code&gt;), dispatched it by hand, run completed successfully in about 2 minutes, and the page timestamp moved:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;before: 2026-09-25 17:02 UTC
after : 2026-11-09 10:43 UTC
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Re-enabling is &lt;strong&gt;not&lt;/strong&gt; the fix. The clock restarted; in 60 days it will stop again unless the trigger comes from outside. I'm writing that down here mostly so future me can't pretend he didn't know.&lt;/p&gt;

&lt;h2&gt;
  
  
  The shape of this bug is everywhere
&lt;/h2&gt;

&lt;p&gt;This isn't a GitHub quirk. It's what happens whenever a pipeline's health is inferred from its own executions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A market data feed that stops publishing doesn't throw — the last bar just sits there and your indicators keep computing on stale prices. This exact failure mode is why every A-share script I run now asserts the newest date present in the data, instead of asserting that the request returned 200.&lt;/li&gt;
&lt;li&gt;A cron job whose &lt;code&gt;last_status&lt;/code&gt; is &lt;code&gt;ok&lt;/code&gt; can be a job that produced zero rows for three weeks.&lt;/li&gt;
&lt;li&gt;A heartbeat written by the same process it monitors proves the process was alive at write time, not that it's alive now.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The general rule I've settled on: &lt;strong&gt;every "is it working?" check needs a claim about what should exist &lt;em&gt;now&lt;/em&gt;, verified from a vantage point the failing component doesn't control.&lt;/strong&gt; "No errors" is not that claim. It's the absence of evidence, dressed as evidence.&lt;/p&gt;

&lt;p&gt;If you run any scheduled automation, go paste this into a shell right now — it takes one call and it's free:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Authorization: Bearer &lt;/span&gt;&lt;span class="nv"&gt;$GITHUB_TOKEN&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"https://api.github.com/repos/OWNER/REPO/actions/workflows"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  | jq &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="s1"&gt;'.workflows[] | "\(.state)\t\(.name)"'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Anything that isn't &lt;code&gt;active&lt;/code&gt; has been quietly not running for some number of days you don't know yet.&lt;/p&gt;




&lt;p&gt;The aggregator (now actually updating) is at &lt;a href="https://github.com/Felixwang007/github-daily-trending" rel="noopener noreferrer"&gt;Felixwang007/github-daily-trending&lt;/a&gt;, and the reliability tooling from earlier posts lives in &lt;a href="https://github.com/Felixwang007/awesome-content-tools" rel="noopener noreferrer"&gt;awesome-content-tools&lt;/a&gt;. The audit scripts I use for CI gates, log checks, and cron hygiene are published on 虾评 (Xiaping) as standalone skill packages — search "cron-reliability-doctor" if you want the packaged version of the checks above.&lt;/p&gt;

&lt;p&gt;If you've had a monitor go green while the thing it watched was dead, I'd like to hear which signal you ended up trusting. That's the part I still don't have a general answer for.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>stocks</category>
    </item>
    <item>
      <title>5,191 A-Share Stocks, One Number: Breadth Went 13% to 42% in Four Sessions. My Backtest Says Do Not Trade That Pattern.</title>
      <dc:creator>Felixwang007</dc:creator>
      <pubDate>Thu, 05 Nov 2026 09:14:11 +0000</pubDate>
      <link>https://dev.to/felixwang007/5191-a-share-stocks-one-number-breadth-went-13-to-42-in-four-sessions-my-backtest-says-do-not-3a4a</link>
      <guid>https://dev.to/felixwang007/5191-a-share-stocks-one-number-breadth-went-13-to-42-in-four-sessions-my-backtest-says-do-not-3a4a</guid>
      <description>&lt;h1&gt;
  
  
  5,191 A-Share Stocks, One Number: Breadth Went 13% → 42% in Four Sessions. My Backtest Says Don't Trade That Pattern.
&lt;/h1&gt;

&lt;p&gt;There is a class of market indicator that is cheap to compute, widely quoted, and almost never counted correctly: market breadth.&lt;/p&gt;

&lt;p&gt;The version I use is boring on purpose. For every listed stock, take the 20-day moving average of closes. Breadth is the share of stocks trading above it. That is it — no weighting, no index constituents, no vendor.&lt;/p&gt;

&lt;p&gt;At the close on &lt;strong&gt;November 5, 2026&lt;/strong&gt; my gauge reads:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Session&lt;/th&gt;
&lt;th&gt;Stocks above MA20&lt;/th&gt;
&lt;th&gt;Universe&lt;/th&gt;
&lt;th&gt;Breadth&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2026-10-30&lt;/td&gt;
&lt;td&gt;692&lt;/td&gt;
&lt;td&gt;5,192&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;13.33%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2026-11-02&lt;/td&gt;
&lt;td&gt;1,070&lt;/td&gt;
&lt;td&gt;5,192&lt;/td&gt;
&lt;td&gt;20.61%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2026-11-03&lt;/td&gt;
&lt;td&gt;1,097&lt;/td&gt;
&lt;td&gt;5,190&lt;/td&gt;
&lt;td&gt;21.14%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2026-11-04&lt;/td&gt;
&lt;td&gt;1,534&lt;/td&gt;
&lt;td&gt;5,192&lt;/td&gt;
&lt;td&gt;29.55%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2026-11-05&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;2,190&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;5,191&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;42.19%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;493 stocks in one session crossing their own 20-day average is the kind of print that gets reposted with an arrow. So I did the obvious thing and asked my own data what happens next.&lt;/p&gt;

&lt;p&gt;The answer was uncomfortable, and it took two corrections to see it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The data
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;5,202 symbols&lt;/strong&gt; (all Shanghai + Shenzhen A-shares), 200 front-adjusted daily bars each, pulled from Tencent's public K-line endpoint (&lt;code&gt;web.ifzq.gtimg.cn/appstock/app/fqkline/get&lt;/code&gt;) — free, no key, ~67 seconds for the whole market at 16 threads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;943,843 stock-days&lt;/strong&gt; after the MA20 warm-up; &lt;strong&gt;277 sessions&lt;/strong&gt; from 2025-09-10 to 2026-11-05.&lt;/li&gt;
&lt;li&gt;Forward return = &lt;strong&gt;equal-weight&lt;/strong&gt; close-to-close over the next 5 sessions across all stocks present on that date. Not an index. An index would hide exactly the thing breadth is about.&lt;/li&gt;
&lt;li&gt;Suspended names (volume = 0) dropped from the cross-section each day.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before trusting any of it I checked the new build against a breadth series I had stored from a September study: &lt;strong&gt;154 overlapping sessions, correlation 0.971, mean absolute difference 3.85pp, worst day 12.8pp.&lt;/strong&gt; The gap is universe size (that study used ~3,046 names after filters, this one 5,191), and the two agree on direction every single day. Good enough to proceed — with the honest caveat that my breadth number is not anyone else's breadth number, and quoting it as "the market's breadth" would be sloppy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding 1: the bad place is not panic
&lt;/h2&gt;

&lt;p&gt;Day-level, bucketed by breadth, mean forward 5-session return:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Breadth&lt;/th&gt;
&lt;th&gt;Sessions&lt;/th&gt;
&lt;th&gt;Mean fwd 5d&lt;/th&gt;
&lt;th&gt;t&lt;/th&gt;
&lt;th&gt;Win rate&lt;/th&gt;
&lt;th&gt;Median&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&amp;lt; 20%&lt;/td&gt;
&lt;td&gt;29&lt;/td&gt;
&lt;td&gt;+0.10%&lt;/td&gt;
&lt;td&gt;+0.15&lt;/td&gt;
&lt;td&gt;51.7%&lt;/td&gt;
&lt;td&gt;+0.07%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;20–40%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;69&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−1.30%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−3.11&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;37.7%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−1.77%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;40–60%&lt;/td&gt;
&lt;td&gt;49&lt;/td&gt;
&lt;td&gt;+0.22%&lt;/td&gt;
&lt;td&gt;+0.48&lt;/td&gt;
&lt;td&gt;51.0%&lt;/td&gt;
&lt;td&gt;+0.14%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;60–80%&lt;/td&gt;
&lt;td&gt;21&lt;/td&gt;
&lt;td&gt;+0.20%&lt;/td&gt;
&lt;td&gt;+0.33&lt;/td&gt;
&lt;td&gt;42.9%&lt;/td&gt;
&lt;td&gt;−0.32%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;gt; 80%&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;−0.57%&lt;/td&gt;
&lt;td&gt;−0.69&lt;/td&gt;
&lt;td&gt;44.4%&lt;/td&gt;
&lt;td&gt;−1.03%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;all&lt;/td&gt;
&lt;td&gt;177&lt;/td&gt;
&lt;td&gt;−0.43%&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;44.6%&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The relationship is &lt;strong&gt;not monotonic&lt;/strong&gt;, and that is the interesting part. Deep panic breadth (under 20% of stocks above MA20) is not the worst forward environment in this sample — it is flat. The worst environment is &lt;strong&gt;20–40%&lt;/strong&gt;: a market that is neither washed out nor repaired, where three quarters of names have already lost their 20-day average but the selling has not exhausted itself. Median −1.77%, win rate 37.7%.&lt;/p&gt;

&lt;p&gt;Note the baseline: the whole sample averaged −0.43% per 5 sessions, so this window drifted down. Every number above should be read as &lt;em&gt;relative to that&lt;/em&gt;, and none of it is a claim about the next five years.&lt;/p&gt;

&lt;p&gt;t = −3.11 looks like a finding. It isn't — not yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding 2: days are not observations
&lt;/h2&gt;

&lt;p&gt;Consecutive sessions in the same bucket are the same regime. Counting 69 "dead zone days" as 69 independent samples is the same error as counting the same customer 69 times because they visited 69 times.&lt;/p&gt;

&lt;p&gt;So I counted &lt;strong&gt;runs&lt;/strong&gt;: maximal stretches of at least 3 consecutive sessions inside a bucket, one number per run.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Breadth&lt;/th&gt;
&lt;th&gt;Sessions&lt;/th&gt;
&lt;th&gt;Day-level&lt;/th&gt;
&lt;th&gt;Runs&lt;/th&gt;
&lt;th&gt;Run-mean&lt;/th&gt;
&lt;th&gt;Run t&lt;/th&gt;
&lt;th&gt;Run win rate&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&amp;lt; 20%&lt;/td&gt;
&lt;td&gt;29&lt;/td&gt;
&lt;td&gt;+0.10%&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−1.00%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;−0.97&lt;/td&gt;
&lt;td&gt;50.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;20–40%&lt;/td&gt;
&lt;td&gt;69&lt;/td&gt;
&lt;td&gt;−1.30%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;9&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−1.89%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;−1.89&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;22.2%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;40–60%&lt;/td&gt;
&lt;td&gt;49&lt;/td&gt;
&lt;td&gt;+0.22%&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;td&gt;+0.47%&lt;/td&gt;
&lt;td&gt;+0.37&lt;/td&gt;
&lt;td&gt;50.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;60–80%&lt;/td&gt;
&lt;td&gt;21&lt;/td&gt;
&lt;td&gt;+0.20%&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;+0.34%&lt;/td&gt;
&lt;td&gt;+0.19&lt;/td&gt;
&lt;td&gt;50.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;gt; 80%&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;td&gt;−0.57%&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two things changed shape:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The dead zone &lt;strong&gt;survived in direction and got stronger in effect size&lt;/strong&gt; (−1.89%, 7 of 9 runs negative) but &lt;strong&gt;lost its significance&lt;/strong&gt; (t = −3.11 → −1.89). The original t-stat was partly borrowed from autocorrelation. That is the honest reading: suggestive, unproven.&lt;/li&gt;
&lt;li&gt;The panic bucket &lt;strong&gt;flipped sign&lt;/strong&gt;: +0.10% at day level, −1.00% at run level. Four runs is not enough to establish either direction, which is precisely why I should have printed "4 runs" next to that +0.10% the first time.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The nine dead-zone runs, in full, so you can see how uneven it is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2026-03-03..03-05  len  3  avg breadth 29.4  fwd5  +3.12%
2026-03-13..03-18  len  4  avg breadth 32.0  fwd5  -6.38%
2026-05-21..05-28  len  6  avg breadth 30.9  fwd5  -2.91%
2026-06-15..07-02  len 13  avg breadth 29.8  fwd5  -1.49%
2026-07-06..07-10  len  5  avg breadth 27.4  fwd5  -3.89%
2026-07-14..07-23  len  8  avg breadth 29.0  fwd5  -1.95%
2026-09-11..09-18  len  6  avg breadth 29.0  fwd5  +2.48%
2026-09-28..10-08  len  4  avg breadth 31.7  fwd5  -2.97%
2026-10-12..10-14  len  3  avg breadth 29.7  fwd5  -3.06%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is a real pattern with a fat left tail and two of nine runs working anyway. It is a &lt;strong&gt;no-trade band&lt;/strong&gt;, not a short signal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding 3: today's pattern is the one that disappeared entirely
&lt;/h2&gt;

&lt;p&gt;Here is the test I actually wanted: what happens after a 4-session surge of +20pp or more in breadth?&lt;/p&gt;

&lt;p&gt;Day-level, it looks great:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;18 surge days&lt;/strong&gt;, mean forward 5-session return &lt;strong&gt;+1.45%&lt;/strong&gt;, t = +1.64, win rate &lt;strong&gt;66.7%&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then cluster them. Consecutive surge days inside a 10-session window are one episode — the same bounce being re-counted while breadth keeps climbing:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Episode&lt;/th&gt;
&lt;th&gt;Surge days&lt;/th&gt;
&lt;th&gt;Peak breadth&lt;/th&gt;
&lt;th&gt;Mean fwd 5d&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2026-02-27 .. 03-10&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;65.5%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−3.01%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2026-04-08 .. 04-17&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;76.4%&lt;/td&gt;
&lt;td&gt;+1.41%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2026-07-30 .. 08-07&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;86.4%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+4.79%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2026-09-21 .. 09-23&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;56.3%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−3.30%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Episode-level: n = 4, mean −0.03%, win rate 50%.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Eighteen observations became four, and the edge became zero. The +1.45% / t = 1.64 was manufactured by counting the July–August episode seven times. Any tool that prints a t-stat on overlapping forward windows without clustering is printing a number about its own sample size, not about the market.&lt;/p&gt;

&lt;p&gt;Same test, different framing (crossing back above 40% breadth after 10 sessions below 25%): 22 day-events, +1.45%, t = +1.91 — and, once clustered, the same four-ish episodes. Zero information.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where today sits
&lt;/h2&gt;

&lt;p&gt;Breadth went 13.33% → 42.19% in four sessions: a +28.9pp surge that lands today in the &lt;strong&gt;40–60% bucket&lt;/strong&gt;. In this sample that bucket is worth +0.22% per 5 sessions at day level and +0.47% over 8 runs — indistinguishable from noise, and the surge that delivered us here is the pattern whose episode-level mean is −0.03%.&lt;/p&gt;

&lt;p&gt;So my gauge's honest output tonight is: &lt;strong&gt;the worst regime of the last three months just ended, and the event that ended it has no measured edge.&lt;/strong&gt; That is a much less satisfying sentence than "breadth is confirming the reversal," and it is the only one the data supports.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rules I now apply to any breadth claim (mine included)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Cluster before you quote a t-stat.&lt;/strong&gt; Overlapping forward windows inflate t by roughly √(overlap). Count episodes, and print the episode count next to every mean.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Report win rate at run level, not day level.&lt;/strong&gt; A 37.7% day-level win rate and a 22.2% run-level win rate are the same data making two different claims.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Write the sample's baseline down.&lt;/strong&gt; All-days mean was −0.43% here. A bucket at +0.22% is not "bullish", it is 0.65pp above a falling baseline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A bucket that flips sign under clustering is not a signal, it is an artifact&lt;/strong&gt; — and finding that out is cheaper than trading it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;State your universe.&lt;/strong&gt; 3,046 filtered names and 5,191 raw names give breadth numbers that differ by up to 12.8pp on the same day. Correlation 0.971 is agreement on direction, not agreement on level.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The reproduce-the-number code is short enough to paste:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# breadth for one session, given {symbol: [(date, close, volume), ...]} sorted
&lt;/span&gt;&lt;span class="n"&gt;above&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;sym&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bars&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;universe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;items&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bars&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;bars&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;      &lt;span class="c1"&gt;# need MA20, drop suspended
&lt;/span&gt;        &lt;span class="k"&gt;continue&lt;/span&gt;
    &lt;span class="n"&gt;ma20&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;bars&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;:])&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;
    &lt;span class="n"&gt;total&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="n"&gt;above&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;bars&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;ma20&lt;/span&gt;
&lt;span class="n"&gt;breadth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;above&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, per day, the forward number and the run grouping:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;fwd5&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;close_at&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;close_at&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;every&lt;/span&gt; &lt;span class="n"&gt;stock&lt;/span&gt; &lt;span class="n"&gt;present&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;day&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;runs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;group_consecutive_days_by_bucket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;days&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;min_len&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;t_stat&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;run_means&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;stdev&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;run_means&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nf"&gt;sqrt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;run_means&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;The measurement scripts for this (breadth gauge, run-level clustering, and the earlier signal studies) live in &lt;strong&gt;github.com/Felixwang007/awesome-content-tools&lt;/strong&gt; under &lt;code&gt;tools/&lt;/code&gt;, each with a &lt;code&gt;selftest&lt;/code&gt; subcommand so you can check the counting before you check the market.&lt;/p&gt;

&lt;p&gt;The packaged version of the A-share screening logic — three-pillar scoring plus the refusal rules that make it return "no signal" — is on &lt;strong&gt;xiaping.coze.com&lt;/strong&gt; under my handle, free to run.&lt;/p&gt;

&lt;p&gt;If you run a breadth gauge of your own: how many &lt;strong&gt;runs&lt;/strong&gt; does your worst bucket contain? That number, not the return, is what tells you whether you have a finding.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>stocks</category>
    </item>
    <item>
      <title>My Linter Scored 26% on Its Home Corpus and 0% on Docs — the Calibration Rule I Ship With Now</title>
      <dc:creator>Felixwang007</dc:creator>
      <pubDate>Mon, 02 Nov 2026 04:02:20 +0000</pubDate>
      <link>https://dev.to/felixwang007/my-linter-scored-26-on-its-home-corpus-and-0-on-docs-the-calibration-rule-i-ship-with-now-2m64</link>
      <guid>https://dev.to/felixwang007/my-linter-scored-26-on-its-home-corpus-and-0-on-docs-the-calibration-rule-i-ship-with-now-2m64</guid>
      <description>&lt;p&gt;I ship small validators to my own coding agent. Nothing fancy: each one takes a path, reads config or tests or license files, and returns findings with a rule id, a severity, and a one-line fix.&lt;/p&gt;

&lt;p&gt;The catalogue is now 30 packages with 271 rules. Four of them, re-run this morning:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;package&lt;/th&gt;
&lt;th&gt;assertion count (today)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tool-schema-doctor&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;42/42&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cron-reliability-doctor&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;76/76&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;license-compliance-doctor&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;54/54&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;i18n-doctor&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;53/53&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;225 assertions, all green. &lt;strong&gt;That number means almost nothing.&lt;/strong&gt; A green selftest proves the code does what I wrote down. It says nothing about what happens when the thing runs against code I did not write.&lt;/p&gt;

&lt;p&gt;This post is about the part I got wrong for weeks: calibration.&lt;/p&gt;

&lt;h2&gt;
  
  
  The experiment that killed my confidence
&lt;/h2&gt;

&lt;p&gt;My cron validator parses schedules out of five different formats: crontab, GitHub Actions &lt;code&gt;schedule&lt;/code&gt;, systemd &lt;code&gt;.service&lt;/code&gt;/&lt;code&gt;.timer&lt;/code&gt;, and a JSON job file. Before I built the real parser, my first draft was the obvious one:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;a line whose first five whitespace-separated tokens are mostly numeric-ish is a cron expression.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I re-implemented exactly that, as a ~15-line probe, and pointed it at the 17-file corpus I use for the validator's own fixtures.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;files_scanned      17
naive_hits         97
parses_as_schedule 25
false_positives    72
precision          0.258
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;74% of hits were wrong. Then I classified the 72 false positives, expecting the classic "English prose matched the pattern" story. It never showed up:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;false positives by cause&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="s"&gt;schedule string split at the wrong boundary (quotes / JSON / YAML)   &lt;/span&gt;&lt;span class="m"&gt;72&lt;/span&gt;
  &lt;span class="s"&gt;exotic schedule dialect I don't support                               &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every single one was a string-boundary error. &lt;code&gt;"expr": "15 8 * *&lt;/code&gt; — the naive splitter cut the value mid-string, then happily parsed the fragment &lt;code&gt;15 8 * *&lt;/code&gt; + &lt;code&gt;*",&lt;/code&gt; as a schedule. The rule did not have a dialect problem. It had a &lt;em&gt;lexing&lt;/em&gt; problem, and I had been about to fix it in the wrong place.&lt;/p&gt;

&lt;p&gt;So I ran the same rule somewhere it had no business being: 182 markdown docs from a knowledge base.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;md_files           182
naive_hits         328
parses_as_schedule 0
precision          0.000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;328 hits. Zero real schedules. The rule is not "26% accurate with room to improve" — on any corpus that isn't the one it was tuned on, it is pure noise.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule I ship with now: precision belongs to a corpus, not to a rule
&lt;/h2&gt;

&lt;p&gt;The mistake was reporting precision as a property of the rule. It is a property of the rule &lt;em&gt;and the corpus you measured it on&lt;/em&gt;. My naive rule's real spec is "26% on cron fixtures, 0% on prose," and only the second number predicts what a user will see.&lt;/p&gt;

&lt;p&gt;So the shipping gate stopped being "selftests pass." It became three checks, and a package that fails any of them does not get published:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Real corpus, &lt;code&gt;HIGH = 0&lt;/code&gt;.&lt;/strong&gt;&lt;br&gt;
Not fixtures — files I did not author. If my scanner's top severity fires on code that a maintainer would call fine, the scanner is wrong, full stop. Here's this morning's reading on the 17-file cron corpus (63 schedule entries across crontab, GHA, systemd, JSON):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;扫描: 17 文件 / 63 条目
      (crontab=27, gha_schedule=3, json_job=23, systemd_service=6, systemd_timer=4)
问题: HIGH=0 MEDIUM=28 LOW=19
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;HIGH=0&lt;/code&gt; is the gate. The 28 MEDIUMs are acceptable &lt;em&gt;only&lt;/em&gt; because check #2 passes:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Every &lt;code&gt;MEDIUM&lt;/code&gt; collapses into one explainable rule class.&lt;/strong&gt;&lt;br&gt;
MEDIUMs are threshold judgements, and thresholds are where noise lives. If MEDIUMs smear across six rule ids, the thresholds are wrong even though nothing is "failing." Here's the histogram from the same run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CRN005  fires &amp;gt;=48x/day with no mutual exclusion      11   MEDIUM
CRN006  `cd dir; cmd` — semicolon, not &amp;amp;&amp;amp;               10   MEDIUM
CRN007  "* * * * *" / "*/1" almost always a typo         4   MEDIUM
CRN010  schedule still runs, command is commented out    3   MEDIUM
CRN013  no output redirection                       17   LOW
CRN015  timer without Persistent=true                2   LOW
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;11 + 10 + 4 + 3 = 28. Four rule classes, and they share one theme: &lt;strong&gt;the line says one thing and does another.&lt;/strong&gt; It fires too often to finish, it runs in the wrong directory, its frequency is a typo, its command is commented out. The 19 LOWs are a second theme — failure that nobody sees (no redirect, no catch-up after a missed window).&lt;/p&gt;

&lt;p&gt;That is a calibrated scanner: it says one thing per severity band, consistently, and a user can decide in one read whether that thing applies to them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Zero input gets its own exit code.&lt;/strong&gt;&lt;br&gt;
I had a real bug where a review tool, handed a path that did not exist, printed &lt;code&gt;files scanned: 0&lt;/code&gt; / &lt;code&gt;health: 100/100&lt;/code&gt; / &lt;code&gt;exit 0&lt;/code&gt;. Green light for never having looked. Now: no input is &lt;code&gt;NO_INPUT&lt;/code&gt;, exit code 3, and it is not a pass.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"No input" is not "clean input." If your gate cannot fail, it is not a gate.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The cron validator says it plainly on an empty path:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;verdict=NO_INPUT
结论: 这些路径里没有任何可识别的调度条目。"没输入"不等于"输入干净"，退出码 3。
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Three more false positives I had to buy back
&lt;/h2&gt;

&lt;p&gt;These all landed as HIGH on real code before I fixed them, and all three are the same species of error: &lt;strong&gt;the scanner mistaking "I don't recognize this" for "you did this wrong."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Unknown licenses are unknown, not violations.&lt;/strong&gt; Scanning ~1.9k dependency entries, valid SPDX identifiers I simply had not put in my table — &lt;code&gt;OFL-1.1&lt;/code&gt;, &lt;code&gt;BlueOak-1.0.0&lt;/code&gt; — came back as license violations. Fix: unknown IDs pass silently and increment a separate &lt;code&gt;unknown_id&lt;/code&gt; counter. A counter that goes up is a signal to add data; a HIGH is a signal that someone's build is broken. They must not share a channel.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GPLv3 §13 mentions "Affero," so GPLv3 was flagged as AGPL.&lt;/strong&gt; Two different licenses with very different obligations. Fix: classify on the first heading line only, not on a substring window over the whole text. Corollary: the standard Apache/GPL appendices contain &lt;code&gt;&amp;lt;year&amp;gt;&lt;/code&gt; and &lt;code&gt;[yyyy]&lt;/code&gt; placeholders — stop scanning past the first ~1200 characters or every second repo is "an unfilled template."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;all.json&lt;/code&gt;, &lt;code&gt;pdf.json&lt;/code&gt; and &lt;code&gt;res.json&lt;/code&gt; are not language packs.&lt;/strong&gt; My i18n validator identified locale files by "filename looks like a language tag," so every generic JSON file in a &lt;code&gt;locales/&lt;/code&gt;-adjacent folder qualified. On a real repository that produced 50 fake HIGH findings. Fix: validate the code itself against the ISO 639-1 list (184 codes) plus 639-2, and only then decide the file is a language pack. Filename shape is a hint; the standard is the oracle.&lt;/p&gt;

&lt;h2&gt;
  
  
  The same disease, non-code edition
&lt;/h2&gt;

&lt;p&gt;I once shipped a "shape gate": reject a post if it is too short or too templated. On a 600-post corpus it fired 7 times. Hand-auditing those 7, one was a legitimate post whose title carried the content, five were tests, one was genuinely malformed.&lt;/p&gt;

&lt;p&gt;Precision: 1/7 ≈ 14%. Ninety percent of the tax landed on cold-start users who had done nothing wrong, and the only thing the gate reliably caught was people testing the gate.&lt;/p&gt;

&lt;p&gt;Gate on &lt;strong&gt;recomputability&lt;/strong&gt;, not on shape. "Can a second party reproduce this claim from the sources provided" is checkable and cheap to argue about. "This is shorter than 40 characters" is a proxy that mostly measures who arrived five minutes ago.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checklist for anyone building validators that an agent will run
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Gate on a corpus you didn't author.&lt;/strong&gt; Fixture precision is not a measurement; it is a rehearsal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;HIGH = 0&lt;/code&gt; on real code, or don't ship.&lt;/strong&gt; If it cries wolf on r/real, the fix is the rule, never the user.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One MEDIUM class, max.&lt;/strong&gt; Threshold noise that scatters across rules is unactionable even when every individual finding is defensible.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unknown ≠ invalid.&lt;/strong&gt; Separate counters for "I don't recognize this" and "this is wrong." Never the same severity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No input gets its own exit code.&lt;/strong&gt; A validator that cannot fail is decoration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ship &lt;code&gt;selftest&lt;/code&gt; in the package&lt;/strong&gt;, and make the gate require &lt;code&gt;selftest&lt;/code&gt; to exit non-zero &lt;em&gt;and&lt;/em&gt; require a "work was actually done" assertion (&lt;code&gt;files_scanned &amp;gt; 0&lt;/code&gt;), not just a green exit.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Restated in one line: a rule's precision is a property of the corpus you measured it on, and the corpus that matters is the one belonging to someone who will uninstall you if you're wrong.&lt;/p&gt;




&lt;p&gt;The probes and the fuller write-ups (clock calibration, partial-batch safety, publish-path fallbacks, dead-gate audits) live in &lt;strong&gt;github.com/Felixwang007/awesome-content-tools&lt;/strong&gt; — &lt;code&gt;tools/&lt;/code&gt; has the runnable versions with &lt;code&gt;selftest&lt;/code&gt; subcommands.&lt;/p&gt;

&lt;p&gt;The packaged versions of the validators themselves (cron reliability, license compliance, i18n, tool schemas, and ~26 more) are on &lt;strong&gt;xiaping.coze.com&lt;/strong&gt; under my handle, free to run.&lt;/p&gt;

&lt;p&gt;If you've shipped a linter that turned out to be 0% accurate off its home turf, I'd like to hear what class of false positive you had to buy back — that taxonomy is the useful artifact, not the rule count.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>stocks</category>
    </item>
    <item>
      <title>My Star-Farm Detector Flagged 7 of 40 Trending Repos. All 7 Matched the Word "confirm".</title>
      <dc:creator>Felixwang007</dc:creator>
      <pubDate>Thu, 29 Oct 2026 12:57:41 +0000</pubDate>
      <link>https://dev.to/felixwang007/my-star-farm-detector-flagged-7-of-40-trending-repos-all-7-matched-the-word-confirm-1n3o</link>
      <guid>https://dev.to/felixwang007/my-star-farm-detector-flagged-7-of-40-trending-repos-all-7-matched-the-word-confirm-1n3o</guid>
      <description>&lt;p&gt;I run a small weekly audit over the newest, fastest-starred repos on GitHub. This week the README probe came back with 7 hits out of 40: repos whose README, according to my own pattern, told you to pipe a remote PowerShell script into memory.&lt;/p&gt;

&lt;p&gt;All seven were the word &lt;strong&gt;"confirm"&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That is the most useful result the probe has produced in a month, and it is worth writing down properly, because the failure has two layers: a broken regex, and a detection signature that rotted in three weeks.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pipeline, in one paragraph
&lt;/h2&gt;

&lt;p&gt;Three independent probes over the same sample:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;metadata&lt;/strong&gt; — stars, forks, repo size, &lt;code&gt;created_at&lt;/code&gt; → &lt;code&gt;pushed_at&lt;/code&gt; lag, license, root tree entry count.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;readme&lt;/strong&gt; — fetch &lt;code&gt;/repos/{r}/readme&lt;/code&gt;, decode base64, match against installer-pattern regexes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;events&lt;/strong&gt; — pull &lt;code&gt;/repos/{r}/events&lt;/code&gt;, keep &lt;code&gt;WatchEvent&lt;/code&gt; timestamps, bucket them at 1 and 5 minutes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;They are supposed to disagree. When they all agree on a repo, that repo is either obviously farmed or obviously fine. When only one fires, the probe is usually the thing that is broken.&lt;/p&gt;

&lt;p&gt;Sample for today: &lt;code&gt;q=created:&amp;gt;2026-10-21, sort=stars, per_page=40&lt;/code&gt;. Forty repos created in the last eight days, smallest one in the set at 440 stars.&lt;/p&gt;

&lt;h2&gt;
  
  
  Layer 1: the bug — &lt;code&gt;irm\s+&lt;/code&gt; matches "conf*&lt;em&gt;irm *&lt;/em&gt;"
&lt;/h2&gt;

&lt;p&gt;The pattern was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;NAIVE_PS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;compile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;irm\s+|iex\s*\(|Invoke-Expression|Invoke-WebRequest&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;I&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;irm&lt;/code&gt; is the PowerShell alias for &lt;code&gt;Invoke-RestMethod&lt;/code&gt;, and &lt;code&gt;irm &amp;lt;url&amp;gt; | iex&lt;/code&gt; is the canonical ClickFix-style loader. So &lt;code&gt;irm\s+&lt;/code&gt; looks right. It is not: there is no left word boundary, so every occurrence of &lt;em&gt;confirm&lt;/em&gt;, &lt;em&gt;affirm&lt;/em&gt;, &lt;em&gt;firm&lt;/em&gt; followed by a space registers as a download-and-execute.&lt;/p&gt;

&lt;p&gt;Here is what the seven hits actually were, verbatim from the READMEs:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;repo&lt;/th&gt;
&lt;th&gt;text the regex matched&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;interplains/Zero-Breach-Toolkit&lt;/td&gt;
&lt;td&gt;"On the phone, &lt;strong&gt;confirm&lt;/strong&gt; the backup with…"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;andyhuo520/digital-human-koubo&lt;/td&gt;
&lt;td&gt;"Always &lt;strong&gt;confirm&lt;/strong&gt; with the agent's live quote"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;yaojingang/GEOInflow&lt;/td&gt;
&lt;td&gt;"insufficient to &lt;strong&gt;confirm&lt;/strong&gt; a source"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;anonnerdfrenzy/survival-llm&lt;/td&gt;
&lt;td&gt;"Open Anyway, and &lt;strong&gt;confirm&lt;/strong&gt; with your password"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;man15h/tellyscope&lt;/td&gt;
&lt;td&gt;"the &lt;strong&gt;confirm&lt;/strong&gt; says Google TV Home"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;deepopen-com/deepopen-3d-webs&lt;/td&gt;
&lt;td&gt;"&lt;strong&gt;confirm&lt;/strong&gt; the run mode and free disk space"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;huaxialucaicaizi/ai-startup-skills&lt;/td&gt;
&lt;td&gt;"open the original to &lt;strong&gt;confirm&lt;/strong&gt; the latest version"&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Seven false positives, zero true positives: a 100% error rate dressed up as a 17.5% detection rate. A README telling a user to &lt;em&gt;confirm&lt;/em&gt; something is the most common sentence in software.&lt;/p&gt;

&lt;p&gt;The fix is word boundaries on both sides, not just the right:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;PS_DOWNLOAD_EXEC&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;compile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;(?&amp;lt;![\w-])(irm|iex|Invoke-Expression|Invoke-WebRequest)(?![\w-])&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;I&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;CURL_PIPE_SHELL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;compile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;(?&amp;lt;![\w-])curl\b[^\n|]{0,120}\|\s*(?:sudo\s+)?(?:bash|sh|zsh)\b&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;I&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Corrected counts on the same 40 repos:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PowerShell download-and-execute: &lt;strong&gt;0&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;curl … | bash&lt;/code&gt;/&lt;code&gt;sh&lt;/code&gt;/&lt;code&gt;zsh&lt;/code&gt;: &lt;strong&gt;1&lt;/strong&gt; (&lt;code&gt;mizorewww/gdirect&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;wget … | sh&lt;/code&gt;: &lt;strong&gt;0&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;"disable real-time protection" instructions (EN or 中文): &lt;strong&gt;0&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One line of the report flipped from "7 repos want to run remote code" to "1 repo documents a pipe-to-shell install". Same data, same repo list, honest answer.&lt;/p&gt;

&lt;p&gt;The lesson generalizes past regexes: &lt;strong&gt;a detector that has never fired on a control case is untested, not clean.&lt;/strong&gt; My own selftest suite now carries the prose-&lt;code&gt;confirm&lt;/code&gt; sentence as a permanent regression case, alongside &lt;code&gt;affirm&lt;/code&gt;, &lt;code&gt;a firm handshake&lt;/code&gt;, a real &lt;code&gt;powershell -w h irm … | iex&lt;/code&gt;, and a real &lt;code&gt;Invoke-WebRequest&lt;/code&gt;. Ten assertions, and the naive pattern is kept in the file on purpose so the test proves the bug still exists.&lt;/p&gt;

&lt;h2&gt;
  
  
  Layer 2: the signature I published three weeks ago is gone
&lt;/h2&gt;

&lt;p&gt;On 2026-10-05 I wrote up a cluster of repos that were being farmed into the trending list. The fingerprint then was structural and crude:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;0 forks on a repo with hundreds of stars&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;created_at&lt;/code&gt; → &lt;code&gt;pushed_at&lt;/code&gt; under 5 seconds&lt;/li&gt;
&lt;li&gt;a single &lt;code&gt;README.md&lt;/code&gt; and nothing else, no license, no releases&lt;/li&gt;
&lt;li&gt;a README ending in &lt;code&gt;irm | iex&lt;/code&gt; plus instructions to turn off real-time protection&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is that same fingerprint re-measured today over 40 repos:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;flag (on repos with ≥300 stars)&lt;/th&gt;
&lt;th&gt;2026-10-05&lt;/th&gt;
&lt;th&gt;2026-10-29&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;forks == 0&lt;/td&gt;
&lt;td&gt;4 of top 10&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0 of 40&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;created → pushed ≤ 10s&lt;/td&gt;
&lt;td&gt;several&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;created → pushed ≤ 60s&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;root tree entries ≤ 2&lt;/td&gt;
&lt;td&gt;several&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;irm&lt;/code&gt;/&lt;code&gt;iex&lt;/code&gt; in README&lt;/td&gt;
&lt;td&gt;multiple&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;(The two ≤2-entry repos today are &lt;code&gt;unclebob/ub-mode&lt;/code&gt;, ★4,255 with a 2.1 KB README and 233 forks — a well-known author writing a manifesto in a text file — and &lt;code&gt;KillaBoi/StealMyBitcoin-PoC&lt;/code&gt;, ★991, 146 forks, a security PoC. Neither looks farmed; small tree + big stars is not sufficient on its own.)&lt;/p&gt;

&lt;p&gt;So: a signature that was 40% of the top ten three weeks ago produces &lt;strong&gt;zero&lt;/strong&gt; hits in a 4x larger sample today. Either the campaign stopped, or it learned the shape of the fingerprint and started producing repos that look structurally normal. I cannot distinguish those two from outside, and it would be dishonest to claim I can. What I &lt;em&gt;can&lt;/em&gt; say is that any trending list ranked by star totals, filtered by a published metadata heuristic, is one adaptation cycle away from showing nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  What replaced it, in today's sample
&lt;/h2&gt;

&lt;p&gt;Two shapes did show up, and neither is a payload signature:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Forks outrunning stars.&lt;/strong&gt; &lt;code&gt;zgx949/ai-pojia&lt;/code&gt;: ★440, &lt;strong&gt;587 forks&lt;/strong&gt;. Normally forks are 3–20% of stars; ratio 0.75 is the copy outrunning the original — the pattern you see when a repo gets re-uploaded or mirrored and traffic lands on the mirror. It is not proof of malice (it can also be a fork-and-translate, or a repo people fork to configure), but it is a structure worth opening.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Self-referential domain density.&lt;/strong&gt; One README (&lt;code&gt;smithjohn78390/tongjiang-lab&lt;/code&gt;) repeats the single host &lt;code&gt;lab.tongjiang.app&lt;/code&gt; &lt;strong&gt;112 times&lt;/strong&gt;. For comparison, across all 40 READMEs &lt;code&gt;github.com&lt;/code&gt; appears 204 times — i.e. one project writes its own domain more than half as often as all 40 write GitHub's. That is a README built as a traffic funnel, not as documentation. Counting per-host link density is cheap and it does not care whether the stars are real.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Star arrival shape&lt;/strong&gt; — the only signal here that costs the attacker real time, because it needs aged accounts acting out of pattern:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;repo&lt;/th&gt;
&lt;th&gt;WatchEvents&lt;/th&gt;
&lt;th&gt;span&lt;/th&gt;
&lt;th&gt;peak/min&lt;/th&gt;
&lt;th&gt;peak 5-min share&lt;/th&gt;
&lt;th&gt;gaps &amp;gt;1h&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;deepopen-com/deepopen-3d-webs&lt;/td&gt;
&lt;td&gt;290&lt;/td&gt;
&lt;td&gt;44.9h&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;td&gt;7.6%&lt;/td&gt;
&lt;td&gt;7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;unclebob/ub-mode&lt;/td&gt;
&lt;td&gt;283&lt;/td&gt;
&lt;td&gt;6.5h&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;4.2%&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ZiChuanLan/agent-purge&lt;/td&gt;
&lt;td&gt;168&lt;/td&gt;
&lt;td&gt;25.8h&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;3.0%&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;songjianyang/xss-audit&lt;/td&gt;
&lt;td&gt;233&lt;/td&gt;
&lt;td&gt;97.9h&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;2.6%&lt;/td&gt;
&lt;td&gt;25&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;zgx949/ai-pojia&lt;/td&gt;
&lt;td&gt;130&lt;/td&gt;
&lt;td&gt;46.3h&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;2.3%&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Motionsites-AI/claude-skill&lt;/td&gt;
&lt;td&gt;270&lt;/td&gt;
&lt;td&gt;22.3h&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;1.9%&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;assetnote/php2shell-scanner&lt;/td&gt;
&lt;td&gt;272&lt;/td&gt;
&lt;td&gt;107.1h&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;1.8%&lt;/td&gt;
&lt;td&gt;34&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;KillaBoi/StealMyBitcoin-PoC&lt;/td&gt;
&lt;td&gt;249&lt;/td&gt;
&lt;td&gt;66.6h&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;1.6%&lt;/td&gt;
&lt;td&gt;11&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;t3dotgg/tstack&lt;/td&gt;
&lt;td&gt;271&lt;/td&gt;
&lt;td&gt;30.8h&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;1.5%&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For scale: on 2026-10-14 one repo took &lt;strong&gt;22 + 20 + 4 stars inside three consecutive minutes&lt;/strong&gt;. Today the densest 5-minute bucket in this sample is 7.6% of a repo's sampled stars, and even the outlier still has 7 one-hour gaps in 45 hours. Nothing today is injected in bursts; the sample looks like ordinary spread-out growth. That is a real reading, and it is also the reason the article is about a false positive instead of a takedown.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I changed in the pipeline
&lt;/h2&gt;

&lt;p&gt;Concretely, four edits — the kind that keep working after the signature you published stops working:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Rank by shape, not by totals.&lt;/strong&gt; The list is sorted by stars; the &lt;em&gt;flag&lt;/em&gt; is &lt;code&gt;peak_5min_share&lt;/code&gt; and &lt;code&gt;gaps &amp;gt; 1h&lt;/code&gt;. Totals are the thing being farmed; the distribution of arrivals is not free to fake.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ship both regexes.&lt;/strong&gt; Keep the naive one next to the corrected one and assert that it still produces the known false positive. A pattern whose failure mode is not in your test suite will eventually be your report.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Store a baseline every run.&lt;/strong&gt; Today's "0 hits" only means something against a written "4 of 10" from three weeks ago. Numbers without a previous number are decoration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prefer rules that describe intent over rules that describe syntax.&lt;/strong&gt; "Does the README ask the user to execute something fetched at runtime?" survives rephrasing. "Does the README contain &lt;code&gt;irm&lt;/code&gt;?" does not survive the next alias.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The tool and the raw numbers
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;scripts/star_farm_probe.py&lt;/code&gt; in my trending aggregator repo — three modes (&lt;code&gt;metadata&lt;/code&gt;, &lt;code&gt;readme&lt;/code&gt;, &lt;code&gt;events&lt;/code&gt;) plus &lt;code&gt;selftest&lt;/code&gt;, no dependencies beyond an authenticated &lt;code&gt;gh&lt;/code&gt; CLI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python star_farm_probe.py selftest                       &lt;span class="c"&gt;# 10/10, includes the 'confirm' regression&lt;/span&gt;
python star_farm_probe.py readme &lt;span class="nt"&gt;--days&lt;/span&gt; 8 &lt;span class="nt"&gt;--top&lt;/span&gt; 40       &lt;span class="c"&gt;# naive vs corrected, side by side&lt;/span&gt;
python star_farm_probe.py events &lt;span class="nt"&gt;--repos&lt;/span&gt; a/b c/d         &lt;span class="c"&gt;# arrival shape&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every number in this post is in &lt;code&gt;scripts/results/star_farm_2026-10-29.json&lt;/code&gt; next to it, including the caveats:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;/events&lt;/code&gt; only exposes the last ~300 events, so arrival shape is a rolling window, not full history.&lt;/li&gt;
&lt;li&gt;Forks are as fakeable as stars; &lt;code&gt;forks &amp;gt; stars&lt;/code&gt; is a lead, not a verdict.&lt;/li&gt;
&lt;li&gt;Stars can be bought slowly with real accounts, and no shape probe above catches that.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Absence of a signature is not evidence of legitimacy.&lt;/strong&gt; Today's zero is the weakest kind of reading.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you maintain a trending/digest pipeline, the one thing I would take from this: publish the sample size and one control false positive along with any "N suspicious repos" claim. Otherwise you are shipping a number nobody — including you — can audit.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Probe + readings: &lt;a href="https://github.com/Felixwang007/github-daily-trending" rel="noopener noreferrer"&gt;github.com/Felixwang007/github-daily-trending&lt;/a&gt; (&lt;code&gt;scripts/star_farm_probe.py&lt;/code&gt;, &lt;code&gt;scripts/results/star_farm_2026-10-29.json&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;The aggregator that runs it: zero-API GitHub Actions + Pages pipeline, rebuilds every 6 hours&lt;/li&gt;
&lt;li&gt;Skills I publish for this kind of audit work: &lt;a href="https://xiaping.coze.com" rel="noopener noreferrer"&gt;虾评 / xiaping&lt;/a&gt; and &lt;a href="https://github.com/Felixwang007/awesome-content-tools" rel="noopener noreferrer"&gt;github.com/Felixwang007/awesome-content-tools&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>stocks</category>
    </item>
    <item>
      <title>My A-Share Screener Fired 6,548 Times. 85% Came From 11 Months — and My New Filter Was Noise</title>
      <dc:creator>Felixwang007</dc:creator>
      <pubDate>Mon, 26 Oct 2026 12:17:40 +0000</pubDate>
      <link>https://dev.to/felixwang007/my-a-share-screener-fired-6548-times-85-came-from-11-months-and-my-new-filter-was-noise-3j33</link>
      <guid>https://dev.to/felixwang007/my-a-share-screener-fired-6548-times-85-came-from-11-months-and-my-new-filter-was-noise-3j33</guid>
      <description>&lt;p&gt;I maintain a three-pillar A-share screener: &lt;strong&gt;technical structure&lt;/strong&gt;, &lt;strong&gt;fundamentals&lt;/strong&gt;, and &lt;strong&gt;flow/intel&lt;/strong&gt;. Two of those pillars I refuse to backtest with the data I have, because I only hold &lt;em&gt;today's&lt;/em&gt; PE/PB snapshot and applying it to 2024 bars is textbook look-ahead. So the measurable pillar is the technical one, and this week I tried to "improve" it by adding a liquidity floor.&lt;/p&gt;

&lt;p&gt;It took 892,992 classified bars to learn that the floor moves the result by &lt;strong&gt;0.006 percentage points&lt;/strong&gt; — and to learn something more useful: why I nearly shipped it anyway.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Universe&lt;/strong&gt;: 3,184 A-shares whose last bar equals the market's last bar (2026-10-26). My local store had 3,487 files; 303 were stale tickers whose last bar was dated anywhere from 1994 to 2026-09. Excluded, not patched.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bars&lt;/strong&gt;: 641 daily qfq bars per stock from Tencent's &lt;code&gt;fqkline&lt;/code&gt; endpoint, sample window 2024-01-01 → 2026-10-26, 0.2 s per stock with 16 threads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Target&lt;/strong&gt;: forward 5-day close-to-close return, in percent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Liquidity proxy&lt;/strong&gt;: 20-day mean traded value = &lt;code&gt;mean(volume_lots * 100 * close)&lt;/code&gt;, computed only from bars up to the signal day.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each bar earns at most one of six patterns, in a fixed precedence order, so "oversold" never double-counts a breakout:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;breakout&lt;/span&gt;        &lt;span class="n"&gt;close&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;high&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;vr&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mf"&gt;1.5&lt;/span&gt;
&lt;span class="n"&gt;high_vol_drop&lt;/span&gt;   &lt;span class="n"&gt;pos20&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.70&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;chg&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;3.0&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;vr&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mf"&gt;1.3&lt;/span&gt;
&lt;span class="n"&gt;oversold_bounce&lt;/span&gt; &lt;span class="n"&gt;ma5&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ma20&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;c20&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;chg&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mf"&gt;2.0&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;vr&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mf"&gt;1.2&lt;/span&gt;
&lt;span class="n"&gt;quiet_pullback&lt;/span&gt;  &lt;span class="n"&gt;ma5&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;ma20&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;chg&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;vr&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mf"&gt;0.85&lt;/span&gt;
&lt;span class="n"&gt;uptrend&lt;/span&gt;         &lt;span class="n"&gt;ma5&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;ma10&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;ma20&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;close&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;ma20&lt;/span&gt;
&lt;span class="nf"&gt;flat            &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hi20&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;lo20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;lo20&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;chg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mf"&gt;1.5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;vr&lt;/code&gt; = today's volume / mean volume of the previous 5 bars. &lt;code&gt;pos20&lt;/code&gt; = where close sits inside the 20-day close range. &lt;code&gt;c20&lt;/code&gt; = 20-day return.&lt;/p&gt;

&lt;h2&gt;
  
  
  All six patterns on the same window
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;pattern&lt;/th&gt;
&lt;th&gt;n&lt;/th&gt;
&lt;th&gt;mean fwd5&lt;/th&gt;
&lt;th&gt;median&lt;/th&gt;
&lt;th&gt;win rate&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;oversold_bounce&lt;/td&gt;
&lt;td&gt;6,548&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+1.372%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;+0.814%&lt;/td&gt;
&lt;td&gt;54.8%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;flat&lt;/td&gt;
&lt;td&gt;184,618&lt;/td&gt;
&lt;td&gt;+0.421%&lt;/td&gt;
&lt;td&gt;+0.167%&lt;/td&gt;
&lt;td&gt;51.2%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;quiet_pullback&lt;/td&gt;
&lt;td&gt;233,645&lt;/td&gt;
&lt;td&gt;+0.362%&lt;/td&gt;
&lt;td&gt;−0.169%&lt;/td&gt;
&lt;td&gt;47.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;uptrend&lt;/td&gt;
&lt;td&gt;400,049&lt;/td&gt;
&lt;td&gt;+0.282%&lt;/td&gt;
&lt;td&gt;−0.336%&lt;/td&gt;
&lt;td&gt;46.5%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;breakout&lt;/td&gt;
&lt;td&gt;60,759&lt;/td&gt;
&lt;td&gt;−0.353%&lt;/td&gt;
&lt;td&gt;−1.379%&lt;/td&gt;
&lt;td&gt;40.8%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;high_vol_drop&lt;/td&gt;
&lt;td&gt;7,373&lt;/td&gt;
&lt;td&gt;−1.352%&lt;/td&gt;
&lt;td&gt;−2.234%&lt;/td&gt;
&lt;td&gt;38.7%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Market baseline (all 592k bars with a 5-day forward window) was +0.320% in 2024, +0.794% in 2025, and &lt;strong&gt;−0.239% in 2026&lt;/strong&gt;. The oversold pattern is rare — 6,548 hits out of 892,992 bars, 0.73% — and it is the only one with a mean meaningfully above drift.&lt;/p&gt;

&lt;h2&gt;
  
  
  The filter I was about to ship
&lt;/h2&gt;

&lt;p&gt;My reasoning was the usual one: tiny, illiquid names have fat slippage and fat spreads, so a liquidity floor should sharpen the mean. Floor = &lt;code&gt;amt20 &amp;gt;= 50M CNY&lt;/code&gt; &lt;strong&gt;and&lt;/strong&gt; &lt;code&gt;close &amp;gt;= 3 CNY&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Then I split by year:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;window&lt;/th&gt;
&lt;th&gt;base mean&lt;/th&gt;
&lt;th&gt;floored mean&lt;/th&gt;
&lt;th&gt;delta&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2024&lt;/td&gt;
&lt;td&gt;+0.992% (n=1,432)&lt;/td&gt;
&lt;td&gt;+0.456% (n=873)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−0.536 pp&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2025&lt;/td&gt;
&lt;td&gt;+2.417% (n=2,042)&lt;/td&gt;
&lt;td&gt;+2.329% (n=1,789)&lt;/td&gt;
&lt;td&gt;−0.088 pp&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2026&lt;/td&gt;
&lt;td&gt;+0.864% (n=3,078)&lt;/td&gt;
&lt;td&gt;+1.046% (n=2,773)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+0.182 pp&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;all&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;+1.372% (n=6,548)&lt;/td&gt;
&lt;td&gt;+1.378% (n=5,433)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+0.006 pp&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If I had only looked at 2026 — the year I actually care about right now — the floor would have looked like a clean +0.18 pp improvement with a small sample cost. It flips sign in 2024. A rule that flips sign by year isn't a filter, it's a bet on what kind of tape comes next.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why individual signals lie: 6,548 samples, 11 months
&lt;/h2&gt;

&lt;p&gt;Here is the part that mattered more than any mean.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The window has &lt;strong&gt;32 months&lt;/strong&gt;. &lt;strong&gt;11&lt;/strong&gt; of them hold &lt;strong&gt;84.7%&lt;/strong&gt; of all signals.&lt;/li&gt;
&lt;li&gt;The top 10 months = 83.1% of samples. The two biggest — 2026-07 (n=1,203) and 2025-04 (n=1,075) — are &lt;strong&gt;34.8%&lt;/strong&gt; of the entire sample.&lt;/li&gt;
&lt;li&gt;The median month has ~65 signals. Months noisily cluster around V-shaped rebounds, because that is precisely when &lt;code&gt;ma5 &amp;lt; ma20 and c20 &amp;lt;= -15&lt;/code&gt; plus a 2% up day plus volume appears.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So when I compute "mean return of the oversold pattern", I am not averaging 6,548 independent trades. I am averaging roughly a dozen macro episodes with a couple of thousand correlated siblings each. Any filter comparison inherits that structure.&lt;/p&gt;

&lt;p&gt;I resampled &lt;strong&gt;months&lt;/strong&gt;, not samples — 10,000 block bootstrap draws, seed 20261026:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;floor vs. all-signals mean difference
  point estimate          +0.006 pp
  95% CI (month blocks)   [-0.223, +0.172]
  floor was worse in      50.9% of draws
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is a coin flip, and I should say so instead of shipping a rule and calling it an edge. The honest statement the screener now emits is not "the floor improves returns" but "the floor is unmeasurable on this sample."&lt;/p&gt;

&lt;h2&gt;
  
  
  What actually did change
&lt;/h2&gt;

&lt;p&gt;Signal frequency, which nobody puts in the headline:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;year&lt;/th&gt;
&lt;th&gt;oversold signals&lt;/th&gt;
&lt;th&gt;trading days&lt;/th&gt;
&lt;th&gt;signals/day&lt;/th&gt;
&lt;th&gt;excess over baseline&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2024&lt;/td&gt;
&lt;td&gt;1,432&lt;/td&gt;
&lt;td&gt;205&lt;/td&gt;
&lt;td&gt;6.99&lt;/td&gt;
&lt;td&gt;+0.672 pp&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2025&lt;/td&gt;
&lt;td&gt;2,042&lt;/td&gt;
&lt;td&gt;243&lt;/td&gt;
&lt;td&gt;8.40&lt;/td&gt;
&lt;td&gt;+1.623 pp&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2026 (to 10-26)&lt;/td&gt;
&lt;td&gt;3,078&lt;/td&gt;
&lt;td&gt;194&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;15.87&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;+1.103 pp&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Frequency per day more than doubled while the raw mean fell from +2.417% to +0.864%. Some of that drop is just a market that stopped drifting up (baseline −0.239% in 2026), which is why I compute excess over baseline at all — excess only fell from 1.62 to 1.10. But a pattern that fires 16 times a day instead of 7 is a different instrument, and it deserves a crowding check before a filter check. October 2026 so far: n=92, mean &lt;strong&gt;−4.98%&lt;/strong&gt;, win rate &lt;strong&gt;19.6%&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  A data-hygiene bug that produced a fake +200% signal count
&lt;/h2&gt;

&lt;p&gt;My first live scan of the day printed &lt;strong&gt;50&lt;/strong&gt; oversold signals. It looked like a rich tape. Then I gated the universe on &lt;code&gt;last_bar_date == market_last_date&lt;/code&gt; and the count fell to &lt;strong&gt;16&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;34 of those 50 "today" signals came from files whose last bar was months or years old — suspended, delisted, or long-halted tickers still sitting in my store. Nothing errored. Every number was internally consistent. The scan was just classifying the past and labelling it today.&lt;/p&gt;

&lt;p&gt;Two rules from that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Gate the universe on the market's own last bar before classifying anything.&lt;/li&gt;
&lt;li&gt;Check the price level as part of hygiene, not as a strategy tweak. Of today's 16 raw triggers, 4 trade under 2 CNY — delisting-adjacent names where "oversold" describes an accounting event, not a bounce candidate.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What the screener does now
&lt;/h2&gt;

&lt;p&gt;Not more filters. More refusals:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every pattern report carries the &lt;strong&gt;cluster count&lt;/strong&gt; (how many months hold the samples) next to the sample count.&lt;/li&gt;
&lt;li&gt;Any filter claim must clear a &lt;strong&gt;month-block bootstrap&lt;/strong&gt; CI that excludes zero, otherwise it is reported as &lt;code&gt;unmeasured&lt;/code&gt;, not as an improvement.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Baseline drift&lt;/strong&gt; is always printed beside the pattern mean, so 2026's lower raw numbers don't get misread as decay caused by the pattern.&lt;/li&gt;
&lt;li&gt;Signal frequency per trading day is tracked as a first-class output, since it's the cheapest available crowding proxy.&lt;/li&gt;
&lt;li&gt;Universe is gated on the market's last bar, and a price floor is applied as &lt;strong&gt;hygiene&lt;/strong&gt; (it removes delisting-adjacent rows), not as alpha.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Today's scan of the 3,184 live names: flat 335, uptrend 174, quiet_pullback 87, breakout 66, oversold_bounce 16, high_vol_drop 4. Twelve of the sixteen oversold names survive &lt;code&gt;amt20 &amp;gt;= 50M and close &amp;gt;= 3&lt;/code&gt; — and per the bootstrap above, that floor's contribution to my returns is, honestly, unknown.&lt;/p&gt;

&lt;h2&gt;
  
  
  The code
&lt;/h2&gt;

&lt;p&gt;Both scripts and the full result tables are in the repo — &lt;code&gt;liquidity_study_20261026.py&lt;/code&gt; builds the sample and the bucket table, &lt;code&gt;episode_block_bootstrap.py&lt;/code&gt; runs the month-level resampling:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repo: &lt;a href="https://github.com/Felixwang007/a-share-signal-lab" rel="noopener noreferrer"&gt;https://github.com/Felixwang007/a-share-signal-lab&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Data source: Tencent &lt;code&gt;web.ifzq.gtimg.cn/appstock/app/fqkline/get&lt;/code&gt; (free, no key), 641 qfq bars/stock in ~55 s for 3,487 tickers with 16 threads.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you build screeners on Chinese equities, the transferable part isn't my thresholds — it's that a signal which looks strong in one year and weak in another, on a few thousand clustered samples, is not a measurable improvement. Count your clusters before you count your hits.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Not investment advice. Nothing here is a recommendation to buy any ticker listed; the measured claim is about the screener, not the stocks.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>opensource</category>
      <category>stocks</category>
    </item>
  </channel>
</rss>
