<?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: David</title>
    <description>The latest articles on DEV Community by David (@shllm).</description>
    <link>https://dev.to/shllm</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%2F4227832%2Fc38f045e-316a-453f-9036-488d561b24a2.png</url>
      <title>DEV Community: David</title>
      <link>https://dev.to/shllm</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shllm"/>
    <language>en</language>
    <item>
      <title>Plotting a Cost-vs-Correctness Pareto Frontier for Coding LLMs Without Version Leaks or Layout Shift</title>
      <dc:creator>David</dc:creator>
      <pubDate>Sat, 28 Nov 2026 12:22:34 +0000</pubDate>
      <link>https://dev.to/shllm/plotting-a-cost-vs-correctness-pareto-frontier-for-coding-llms-without-version-leaks-or-layout-shift-2p9h</link>
      <guid>https://dev.to/shllm/plotting-a-cost-vs-correctness-pareto-frontier-for-coding-llms-without-version-leaks-or-layout-shift-2p9h</guid>
      <description>&lt;p&gt;Most LLM leaderboards collapse a model family into a single row and ignore how much reasoning-effort settings shift both accuracy and cost. On real coding tasks, cranking effort from &lt;code&gt;High&lt;/code&gt; to &lt;code&gt;Max&lt;/code&gt; can double or triple your token bill for one or two percentage points.&lt;/p&gt;

&lt;p&gt;At FollowAgents, we built a static, zero-dependency Python + inline SVG scatter plot for our November 24, 2026 coding-model snapshot so developers can inspect the efficiency frontier directly—without shipping a charting bundle or risking Cumulative Layout Shift (CLS).&lt;/p&gt;

&lt;h2&gt;
  
  
  Why model-level rankings hide effort-tier token taxes
&lt;/h2&gt;

&lt;p&gt;In the CursorBench 4.1 runs from our November 2026 snapshot, the same base weights behave like completely different products depending on reasoning effort:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Gemini 4 Neon&lt;/strong&gt;: &lt;code&gt;High&lt;/code&gt; reaches &lt;strong&gt;63.7%&lt;/strong&gt; at &lt;strong&gt;$6.54/task&lt;/strong&gt; (&lt;code&gt;88,596&lt;/code&gt; tokens). Pushing to &lt;code&gt;Extra High&lt;/code&gt; reaches &lt;strong&gt;65.4%&lt;/strong&gt; (+1.7 points) at &lt;strong&gt;$10.67/task&lt;/strong&gt; (&lt;code&gt;136,273&lt;/code&gt; tokens, +63% cost).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude Opus 5.5&lt;/strong&gt;: &lt;code&gt;High&lt;/code&gt; scores &lt;strong&gt;54.5%&lt;/strong&gt; at &lt;strong&gt;$3.87/task&lt;/strong&gt; (&lt;code&gt;56,162&lt;/code&gt; tokens), compared with &lt;strong&gt;58.1%&lt;/strong&gt; at &lt;strong&gt;$11.88/task&lt;/strong&gt; (&lt;code&gt;213,070&lt;/code&gt; tokens) on &lt;code&gt;Max&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude Fable 5.2&lt;/strong&gt;: &lt;code&gt;Extra High&lt;/code&gt; scores &lt;strong&gt;58.8%&lt;/strong&gt; at &lt;strong&gt;$17.84/task&lt;/strong&gt; (&lt;code&gt;194,918&lt;/code&gt; tokens), whereas &lt;code&gt;Max&lt;/code&gt; rises to &lt;strong&gt;61.3%&lt;/strong&gt; while jumping to &lt;strong&gt;$48.11/task&lt;/strong&gt; (&lt;code&gt;541,003&lt;/code&gt; tokens).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When all effort tiers sit in one ranked table, teams end up either defaulting to expensive &lt;code&gt;Max&lt;/code&gt; settings or picking a model without seeing the cheaper tier right below it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Computing a version-isolated Pareto frontier in Python
&lt;/h2&gt;

&lt;p&gt;A configuration belongs on the cost-vs-correctness Pareto frontier when no cheaper run achieves equal or higher correctness. In &lt;code&gt;models_eval.py&lt;/code&gt;, sorting by &lt;code&gt;(cost_usd, -score)&lt;/code&gt; reduces the computation to a single linear sweep:&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;compute_pareto_frontier&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;models&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="kt"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;strict_v41_only&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;bool&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="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;set&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="s2"&gt;"""Return IDs of models on the cost-vs-correctness Pareto frontier."""&lt;/span&gt;
    &lt;span class="n"&gt;candidates&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="kt"&gt;tuple&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;str&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="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;for&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;models&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;cb&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="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"cursorbench"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;or&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="n"&gt;cb&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;"score"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;cost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cb&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;"cost_usd"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;version&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cb&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;"version"&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;score&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;cost&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;cost&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="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;continue&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;strict_v41_only&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;version&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="s2"&gt;"4.1"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;continue&lt;/span&gt;
        &lt;span class="n"&gt;candidates&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="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cost&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="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;score&lt;/span&gt;&lt;span class="p"&gt;)&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="s2"&gt;"id"&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;candidates&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;lambda&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&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="n"&gt;row&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="n"&gt;frontier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;set&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;best_score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"-inf"&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;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;neg_score&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;model_id&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;candidates&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="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;neg_score&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;best_score&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;frontier&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;best_score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;frontier&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One easy mistake when aggregating public benchmarks is letting older dataset revisions quietly join the same frontier line. In our snapshot, &lt;strong&gt;DeepSeek V4.1 Flash&lt;/strong&gt; had a CursorBench &lt;strong&gt;v4.0&lt;/strong&gt; measurement (&lt;code&gt;47.7%&lt;/code&gt; at &lt;code&gt;$0.98/task&lt;/code&gt;, &lt;code&gt;537,000&lt;/code&gt; tokens), while &lt;strong&gt;GPT-6.2 Astra&lt;/strong&gt; had no CursorBench 4.1 entry yet.&lt;/p&gt;

&lt;p&gt;By gating frontier membership with &lt;code&gt;strict_v41_only=True&lt;/code&gt;, the connecting polyline includes only the five &lt;strong&gt;CursorBench 4.1&lt;/strong&gt; Pareto-optimal configurations:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Claude Haiku 5.5 (Extra High)&lt;/strong&gt;: &lt;code&gt;44.3%&lt;/code&gt; · &lt;code&gt;$0.56/task&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude Haiku 5.5 (Max)&lt;/strong&gt;: &lt;code&gt;48.4%&lt;/code&gt; · &lt;code&gt;$1.12/task&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemini 4 Neon (Medium)&lt;/strong&gt;: &lt;code&gt;57.7%&lt;/code&gt; · &lt;code&gt;$3.07/task&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemini 4 Neon (High)&lt;/strong&gt;: &lt;code&gt;63.7%&lt;/code&gt; · &lt;code&gt;$6.54/task&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gemini 4 Neon (Extra High)&lt;/strong&gt;: &lt;code&gt;65.4%&lt;/code&gt; · &lt;code&gt;$10.67/task&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Prior-version runs can still be plotted as reference points with an explicit &lt;code&gt;v4.0&lt;/code&gt; badge without distorting the &lt;code&gt;4.1&lt;/code&gt; curve, and missing benchmark cells remain &lt;code&gt;—&lt;/code&gt; instead of being interpolated.&lt;/p&gt;

&lt;h2&gt;
  
  
  Precomputing dual Log and Linear SVG coordinates for zero-CLS axis toggling
&lt;/h2&gt;

&lt;p&gt;Cost spans nearly two orders of magnitude (&lt;code&gt;$0.56&lt;/code&gt; to &lt;code&gt;$48.11&lt;/code&gt;). On a linear axis, everything under &lt;code&gt;$2&lt;/code&gt; collapses into a vertical stack; on a logarithmic axis, the &lt;code&gt;$48&lt;/code&gt; tail stops dominating the visual scale, so you lose the shock of how steep the &lt;code&gt;Max&lt;/code&gt;-tier outlier is. Both views are useful.&lt;/p&gt;

&lt;p&gt;Instead of pulling in a client-side charting library that measures the DOM after load, the server renders a fixed &lt;code&gt;viewBox="0 0 860 420"&lt;/code&gt; inline SVG with both coordinate sets precomputed in Python:&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;_x_log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cost&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;lo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log10&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.45&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log10&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;55.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;clamped&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.45&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;55.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mf"&gt;68.0&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;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log10&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;clamped&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;lo&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;hi&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;lo&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="mf"&gt;760.0&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_x_linear&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cost&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;clamped&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;50.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mf"&gt;68.0&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;clamped&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mf"&gt;50.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;760.0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every plotted &lt;code&gt;&amp;lt;circle&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;text&amp;gt;&lt;/code&gt; label carries &lt;code&gt;data-cx-log&lt;/code&gt; / &lt;code&gt;data-cx-lin&lt;/code&gt; (or &lt;code&gt;data-x-log&lt;/code&gt; / &lt;code&gt;data-x-lin&lt;/code&gt;), and the Pareto &lt;code&gt;&amp;lt;polyline&amp;gt;&lt;/code&gt; carries &lt;code&gt;data-points-log&lt;/code&gt; / &lt;code&gt;data-points-lin&lt;/code&gt;. Toggling between scales on the client only swaps those attributes—keeping layout dimensions locked at &lt;code&gt;0&lt;/code&gt; CLS and costing a few lines of plain JavaScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cross-checking with harness-coupled and production-volume signals
&lt;/h2&gt;

&lt;p&gt;A single IDE cost curve still has blind spots. Real terminal workflows depend heavily on the &lt;strong&gt;agent harness&lt;/strong&gt; around the model: in Terminal-Bench 4.1, &lt;strong&gt;Claude Opus 5.5&lt;/strong&gt; and &lt;strong&gt;Claude Fable 5.2&lt;/strong&gt; inside &lt;strong&gt;Claude Code&lt;/strong&gt; score &lt;strong&gt;65.76%&lt;/strong&gt;, while &lt;strong&gt;Gemini 4 Carbon (High)&lt;/strong&gt; inside &lt;strong&gt;Antigravity CLI&lt;/strong&gt; scores &lt;strong&gt;64.5%&lt;/strong&gt; and &lt;strong&gt;GPT-6.2 Astra&lt;/strong&gt; inside &lt;strong&gt;Codex&lt;/strong&gt; reaches &lt;strong&gt;62.1%&lt;/strong&gt; (paired with &lt;strong&gt;91.5%&lt;/strong&gt; on LiveCodeBench). Combining Pareto cost tiers with harness-level CLI scores and weekly production token volume (such as OpenRouter rankings) helps separate low-cost routing tiers from high-effort escalation tiers.&lt;/p&gt;

&lt;p&gt;You can explore the live chart, compare all 19 configurations across 7 independent evaluation sources, and check linked coding agent hosts on the &lt;a href="https://followagents.com/en/models?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=models_pareto_2026_11" rel="noopener noreferrer"&gt;FollowAgents Model capability &amp;amp; cost explorer&lt;/a&gt; (public, no login, ad-free).&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Note: This article was drafted with AI assistance and fact-checked against our Python SVG renderer (&lt;code&gt;models_eval.py&lt;/code&gt;) and November 24, 2026 benchmark snapshot.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclosure: I work on FollowAgents.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to Review an AI Agent Before Giving It Repository Access</title>
      <dc:creator>David</dc:creator>
      <pubDate>Mon, 23 Nov 2026 14:58:05 +0000</pubDate>
      <link>https://dev.to/shllm/how-to-review-an-ai-agent-before-giving-it-repository-access-cfp</link>
      <guid>https://dev.to/shllm/how-to-review-an-ai-agent-before-giving-it-repository-access-cfp</guid>
      <description>&lt;p&gt;When an AI agent asks for repository access, feature lists are only part of the decision. A safer review starts with a smaller question: what evidence can you find about the agent’s permissions, approval gates, and recovery path?&lt;/p&gt;

&lt;p&gt;This is a practical source-and-documentation review. It helps you decide what to verify before a trial. It does not prove how the agent behaves at runtime.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Map the authority the agent receives
&lt;/h2&gt;

&lt;p&gt;Start with the actual integration path: a local CLI, IDE extension, hosted service, GitHub App, or MCP server can each expose a different set of capabilities.&lt;/p&gt;

&lt;p&gt;Look for evidence about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which repositories, directories, and files it can read or change&lt;/li&gt;
&lt;li&gt;Whether shell commands, network access, secrets, or deployment credentials are available&lt;/li&gt;
&lt;li&gt;Whether permissions can be narrowed by repository, branch, path, or task&lt;/li&gt;
&lt;li&gt;Which party holds the credentials, and how access can be revoked&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Record what the docs and code say. A broad claim such as “works with your repo” is not enough to establish the permission boundary.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Find the approval gates
&lt;/h2&gt;

&lt;p&gt;Next, trace what happens before consequential actions. Does the agent ask before writing files, running commands, opening a pull request, or deploying? Can an operator inspect the proposed action and its scope before approving it?&lt;/p&gt;

&lt;p&gt;Treat each action separately. A confirmation prompt for one workflow does not show that every tool call or integration has the same gate. Look for the gate in the documented flow and, where possible, the implementation.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Look for a recovery path
&lt;/h2&gt;

&lt;p&gt;Failures are easier to handle when the project explains how to return to a known state. Check for documented backups, checkpoints, branches, undo operations, restore steps, or a way to stop and revoke access.&lt;/p&gt;

&lt;p&gt;Ask practical questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What state may have changed?&lt;/li&gt;
&lt;li&gt;Which changes can be reversed, and by whom?&lt;/li&gt;
&lt;li&gt;Are there steps to recover if a command stops halfway through?&lt;/li&gt;
&lt;li&gt;Does the documented process preserve the user’s unrelated work?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A button labeled “undo” is a clue to investigate, not proof that every side effect can be reversed.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Separate evidence from inference
&lt;/h2&gt;

&lt;p&gt;For every finding, save the source location and classify the result:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Documented or visible:&lt;/strong&gt; a specific source or doc describes the control.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not found in the reviewed material:&lt;/strong&gt; the reviewed sources did not explain it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Needs runtime verification:&lt;/strong&gt; the claim depends on behavior that static review cannot establish.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That wording matters. “No recovery procedure was documented in these sources” is narrower and more useful than “the agent cannot recover.” Missing documentation does not prove a control is absent; a visible code path does not prove it works in every environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Make the review repeatable
&lt;/h2&gt;

&lt;p&gt;A compact review record can include the project version or commit, sources checked, a small set of criteria, evidence links, and the date of review. Keep the observations separate from the score so another person can inspect the reasoning. Revisit the record when permissions, integrations, or recovery behavior change.&lt;/p&gt;

&lt;p&gt;Before a real trial, still use least privilege, a disposable branch or sandbox, and credentials scoped to the task. A source review is a screening step, not a substitute for testing the exact setup you plan to run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits of this method
&lt;/h2&gt;

&lt;p&gt;Reading source code and documentation cannot establish runtime behavior, deployment configuration, or how a third-party service handles data. LLM assistance can help organize evidence, but each important claim should remain traceable to its source and be checked by a person.&lt;/p&gt;

&lt;p&gt;At FollowAgents, we use a published rubric to review public AI-agent repositories this way. The methodology and its limits are available at &lt;a href="https://followagents.com/en/methodology?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=agent_repo_review_2026_11" rel="noopener noreferrer"&gt;FollowAgents methodology&lt;/a&gt;. The reviews describe evidence in public materials; they are not runtime tests.&lt;/p&gt;

&lt;p&gt;Disclosure: I work on FollowAgents.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>security</category>
    </item>
    <item>
      <title>Why I split tower-defense campaigns from their mini-challenges</title>
      <dc:creator>David</dc:creator>
      <pubDate>Mon, 23 Nov 2026 14:16:26 +0000</pubDate>
      <link>https://dev.to/shllm/why-i-split-tower-defense-campaigns-from-their-mini-challenges-1o22</link>
      <guid>https://dev.to/shllm/why-i-split-tower-defense-campaigns-from-their-mini-challenges-1o22</guid>
      <description>&lt;p&gt;While building a browser tower-defense game, I ran into a design mismatch: the campaign and special challenges look like parts of the same game, but they ask the player to do different things.&lt;/p&gt;

&lt;p&gt;The campaign is about placing defenders, choosing upgrades, and surviving waves. One challenge asks you to route trains through two switches before scheduled arrivals. Treating that activity as another tower-defense level would add rail-specific state to systems that do not need to know about it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Give the challenge its own small model
&lt;/h2&gt;

&lt;p&gt;I keep the campaign engine and challenge rules separate. Each challenge has a type and a small configuration. Its model has three jobs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;init creates the starting state.&lt;/li&gt;
&lt;li&gt;view turns the current state into data the shared interface can render: a forecast, status values, a board, and available actions.&lt;/li&gt;
&lt;li&gt;act applies one player choice, including the scenario-specific rule and win/loss condition.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The model does not need the DOM, canvas, or browser storage. The challenge page owns input and rendering; the model owns the rules. This gives different challenge types one shared interface without pretending they all have the same board or objective.&lt;/p&gt;

&lt;h2&gt;
  
  
  One concrete example
&lt;/h2&gt;

&lt;p&gt;In the Steam Junction timetable, switch A can handle every arrival, while switch B can only handle light cargo. Each successful interception puts that switch on cooldown. The arrival forecast is visible before you dispatch, so the puzzle is about planning ahead rather than reacting to hidden information.&lt;/p&gt;

&lt;p&gt;This split makes it easier to inspect the important parts: a rule is a small transition over state, and the interface can display the forecast and action choices that transition expects. When I add another challenge, I can change its model and scenario data without threading special cases through tower placement, enemy movement, or combat.&lt;/p&gt;

&lt;p&gt;The game has nine campaign modes and a separate set of 25 challenge rule types. Keeping those responsibilities apart matters more than it would in a single-screen prototype.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disclosure:&lt;/strong&gt; I built the linked game. AI helped draft and edit this article; the implementation details describe my project. The Steam Junction timetable is playable in the browser here: &lt;a href="https://iooigame.net/games/steam-junction/?mode=mission&amp;amp;lang=en&amp;amp;utm_source=devto&amp;amp;utm_medium=social&amp;amp;utm_campaign=hundred_realms_launch" rel="noopener noreferrer"&gt;https://iooigame.net/games/steam-junction/?mode=mission&amp;amp;lang=en&amp;amp;utm_source=devto&amp;amp;utm_medium=social&amp;amp;utm_campaign=hundred_realms_launch&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>architecture</category>
    </item>
    <item>
      <title>One flood-fill for both the preview and the turn in a browser puzzle</title>
      <dc:creator>David</dc:creator>
      <pubDate>Fri, 20 Nov 2026 07:08:03 +0000</pubDate>
      <link>https://dev.to/shllm/one-flood-fill-for-both-the-preview-and-the-turn-in-a-browser-puzzle-mgj</link>
      <guid>https://dev.to/shllm/one-flood-fill-for-both-the-preview-and-the-turn-in-a-browser-puzzle-mgj</guid>
      <description>&lt;p&gt;When a grid puzzle previews a move, players use that preview to make a decision. If a shelter looks dry after placing a barrier, it should stay dry when the turn runs. Jade Canal, a 5×5 puzzle from Hundred-Realm Tower Defense, uses a single bounded flood-fill for both jobs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Model the tide as a distance limit
&lt;/h2&gt;

&lt;p&gt;Each surge supplies several inlets and a maximum reach. Start a breadth-first traversal with all the inlets at distance zero. From each cell, visit its orthogonal land neighbors and skip rocks, barriers, and cells already visited. Stop expanding a cell once it reaches the distance limit. Mark each cell as visited when you enqueue it so two inlets can converge without queuing the same cell twice.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wet = set(inlets)
queue = [(inlet, 0) for inlet in inlets]
for (cell, distance) in queue:
    if distance == reach: continue
    for next in land_neighbors(cell):
        if next in wet or next in rocks or next in barriers: continue
        wet.add(next)
        queue.append((next, distance + 1))
return wet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Starting with all inlets makes the distance to a cell the shortest unblocked route from any inlet. Blocking the obvious path can still leave an open route around a barrier or from a second inlet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use the same result in both places
&lt;/h2&gt;

&lt;p&gt;Placing or removing a barrier recomputes the wet cells. The board shows those cells with a dashed treatment and includes the forecast in their accessible labels. Releasing the surge runs the same computation against the current layout, then records newly flooded shelters. Jade Canal clears barriers between surges and keeps destroyed shelters lost. Keeping those turn effects outside the flood-fill lets the preview run without changing the round or the shelters.&lt;/p&gt;

&lt;p&gt;Try this in &lt;a href="https://iooigame.net/games/jade-canal/?mode=mission&amp;amp;lang=en" rel="noopener noreferrer"&gt;the playable Jade Canal mission&lt;/a&gt;. At the start, the shelter at row 4, column 1 is marked as forecast to flood. Place a barrier at row 2, column 1 and the warning disappears. Remove the barrier and the warning comes back. For a regression test, resolve the first surge from each layout and assert that the shelter outcome agrees with the preview.&lt;/p&gt;

&lt;p&gt;Published on behalf of the Hundred-Realm Tower Defense team. An AI agent generated this write-up from the game implementation and a check of the live board.&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>gamedev</category>
      <category>programming</category>
    </item>
    <item>
      <title>A Stock Gainers List Is a Filter, Not a Buy Signal: A Small JavaScript Example</title>
      <dc:creator>David</dc:creator>
      <pubDate>Wed, 18 Nov 2026 03:26:58 +0000</pubDate>
      <link>https://dev.to/shllm/a-stock-gainers-list-is-a-filter-not-a-buy-signal-a-small-javascript-example-4l59</link>
      <guid>https://dev.to/shllm/a-stock-gainers-list-is-a-filter-not-a-buy-signal-a-small-javascript-example-4l59</guid>
      <description>&lt;p&gt;I build Stockinsky, a site that turns public market data into stock pages, market screens, and financial explainers. One small feature I work on is a daily list of US stocks with the largest moves. It looks simple: sort by percentage change and show the leaders. The useful engineering lesson is that the sort is the easy part. Defining the input set, keeping the fields attached to the right security, and explaining the limits of the result take more care.&lt;/p&gt;

&lt;p&gt;Here is a compact version of that screen using a real, dated snapshot. On Nov. 17, 2026, Stockinsky’s US gainers page showed CG Oncology (CGON) at $84.78, up 13.95%, with a market capitalization of $7.57 billion. The screen’s stated rules were a share price of at least $5, a market capitalization of roughly $2 billion or more, and a daily gain above 3%; it displayed the 30 largest qualifying moves among larger, actively traded stocks. The page labeled the data as the Nov. 17 close.&lt;/p&gt;

&lt;p&gt;Those rules describe a filter. They do not describe a valuation model, and they do not establish why a stock moved.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with explicit fields
&lt;/h2&gt;

&lt;p&gt;For a small example, make the input shape visible. The values below are transcribed from the same dated leaderboard. A production feed would provide more rows and stronger identifiers, but this is enough to show the transformation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;rows&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;ticker&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"CGON"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"CG Oncology"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;84.78&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;changePct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;13.95&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;marketCapB&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;7.57&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;ticker&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"TU"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Telus Corporation"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;9.58&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;changePct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;12.31&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;marketCapB&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;15.25&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;ticker&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"MOH"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Molina Healthcare"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;233.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;changePct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;11.34&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;marketCapB&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;12.18&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;ticker&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"HTHT"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"H World Group"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;54.88&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;changePct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;8.91&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;marketCapB&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;16.88&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;ticker&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"TSN"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Tyson Foods"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;63.96&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;changePct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;8.74&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;marketCapB&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;22.50&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;marketCapB&lt;/code&gt; field means billions of US dollars. Naming the unit in the field avoids a common data bug: comparing a value expressed in dollars with a threshold expressed in billions. In a larger system, I would also carry the currency, exchange, observation time, and source with every row rather than keeping that context only in a page title.&lt;/p&gt;

&lt;h2&gt;
  
  
  Filter, then rank
&lt;/h2&gt;

&lt;p&gt;The screen can be expressed as two pure steps. The first asks whether each row satisfies the published conditions. The second sorts the survivors by the daily percentage move:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;qualifies&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&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;row&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;marketCapB&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;changePct&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;rankMovers&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="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;qualifies&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sort&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;b&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;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;changePct&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="n"&gt;changePct&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="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;table&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;rankMovers&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="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&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;ticker&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;changePct&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;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;ticker&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`$${price.toFixed(2)}`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;change&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`${changePct.toFixed(2)}%`&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="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it with Node.js and the five rows remain in the same order as the observed leaderboard: CGON, TU, MOH, HTHT, then TSN. The threshold values in this small function mirror the page’s stated screen. The example does not try to recreate the full production universe or its activity checks, so it should not be mistaken for a complete replica.&lt;/p&gt;

&lt;p&gt;Keeping &lt;code&gt;qualifies&lt;/code&gt; separate from &lt;code&gt;rankMovers&lt;/code&gt; makes the behavior easier to review. A threshold change can be tested without changing the ordering logic. A unit test can check boundary cases: a price exactly at the floor passes, a gain exactly at 3% does not pass because the rule says “above 3%,” and a market cap below the floor is excluded. Those details matter more than a clever sort expression.&lt;/p&gt;

&lt;p&gt;There are a few other useful checks before this runs on a daily schedule. Reject a row if price, market cap, or percentage change is missing; JavaScript comparisons with &lt;code&gt;undefined&lt;/code&gt; can otherwise produce confusing results. Check for duplicate security identifiers so a feed retry does not put the same company into the list twice. Finally, assert that the output never exceeds the configured maximum after sorting. These checks do not make the ranking more predictive. They make it less likely that a data-quality problem is presented as a market fact.&lt;/p&gt;

&lt;p&gt;I would also keep a small fixture for the last successful run. When a provider changes a field name or starts returning percentages as decimals instead of percentage points, comparing the parsed output against that fixture makes the break visible. A 0.1395 value and a 13.95 value can both look plausible in a log, but they produce very different ranks. Logging the source timestamp and a count of accepted and rejected rows helps diagnose that kind of change without exposing a secret or a user's data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preserve the observation, not just the number
&lt;/h2&gt;

&lt;p&gt;A daily change is meaningful only with a time window. “Up 13.95%” is incomplete unless a reader knows the comparison is against the prior close and which session produced the observation. The page therefore labels the date and says “close.” If the same page is refreshed during a trading session, its data should be labeled intraday instead. Mixing an intraday value with a previous close creates a plausible-looking but incorrect comparison.&lt;/p&gt;

&lt;p&gt;The same principle applies to market capitalization and price. They are snapshots, not timeless attributes. If rows are joined from separate feeds, the application should avoid silently combining a current price with a stale company size. At minimum, retain each source timestamp and reject records outside a chosen freshness window.&lt;/p&gt;

&lt;p&gt;For a production ranking, a stable security identifier is safer than a ticker alone. Tickers can change or be reused, and the same company may have multiple listings. The displayed ticker is useful for people; the internal join key should identify the listing and market.&lt;/p&gt;

&lt;h2&gt;
  
  
  A ranking is not an explanation
&lt;/h2&gt;

&lt;p&gt;The leaderboard answers a narrow question: which eligible securities had the largest measured percentage moves in the selected session? It does not answer why they moved. A price move can coincide with an earnings release, a filing, a transaction, an analyst note, low liquidity, or a broad market event. A rank alone cannot distinguish among those possibilities.&lt;/p&gt;

&lt;p&gt;That separation should show up in both code and copy. The ranking pipeline should label its universe, thresholds, date, and source. A separate research step can gather evidence about a possible catalyst and state what remains uncertain. Do not turn “largest move” into “best stock,” and do not infer a cause from the row’s position in the table.&lt;/p&gt;

&lt;p&gt;For the Nov. 17 example, the source page reports CGON’s closing price and daily change, and names the data sources used for the screen and 52-week range. This article makes no claim about the cause of that move. The practical takeaway is about measurement: a reproducible screen is a transparent set of inclusion rules plus a dated snapshot. It is a starting point for investigation, not the investigation itself.&lt;/p&gt;

&lt;p&gt;You can inspect the &lt;a href="https://stockinsky.com/en/us-gainers?utm_source=devto&amp;amp;utm_medium=social&amp;amp;utm_campaign=gainer_screen_js_1118" rel="noopener noreferrer"&gt;dated US gainers screen&lt;/a&gt; and compare its labels with the code above.&lt;/p&gt;

&lt;p&gt;Not investment advice. Numbers as of Nov. 17, 2026.&lt;/p&gt;

</description>
      <category>finance</category>
      <category>javascript</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Reverse-engineering a P/E ratio in 10 lines of JavaScript (with Alphabet as a worked example)</title>
      <dc:creator>David</dc:creator>
      <pubDate>Wed, 11 Nov 2026 03:34:43 +0000</pubDate>
      <link>https://dev.to/shllm/reverse-engineering-a-pe-ratio-in-10-lines-of-javascript-with-alphabet-as-a-worked-example-d7g</link>
      <guid>https://dev.to/shllm/reverse-engineering-a-pe-ratio-in-10-lines-of-javascript-with-alphabet-as-a-worked-example-d7g</guid>
      <description>&lt;p&gt;I build &lt;a href="https://stockinsky.com/en/?utm_source=devto&amp;amp;utm_medium=social&amp;amp;utm_campaign=reverse_pe_1111" rel="noopener noreferrer"&gt;Stockinsky&lt;/a&gt;, a side project that generates research pages for US and Hong Kong stocks. Every report has a short section called "market-implied expectations". It is the cheapest piece of the whole pipeline (one line of math, no API calls, no model), and it ended up being the part I trust most. This post walks through the formula, the code, a real example, and the guardrail we had to add.&lt;/p&gt;

&lt;h2&gt;
  
  
  The question flips
&lt;/h2&gt;

&lt;p&gt;Most valuation methods start from your forecasts and end at a price: guess growth, margins and a discount rate, then compute what the company is "worth". The problem is that every input is a guess, and the output inherits all of them.&lt;/p&gt;

&lt;p&gt;A reverse approach starts from the price, which is the one number you don't have to guess, and asks:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If I pay today's P/E and want a given annual return, how fast do earnings per share have to grow for that to work out?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You then compare that required growth rate with what the business has actually been doing. That is a much easier judgment than producing a fair value from scratch. It is the same idea behind Michael Mauboussin's reverse DCF, which we describe on our &lt;a href="https://stockinsky.com/en/valuation-models/mauboussin_reverse_dcf?utm_source=devto&amp;amp;utm_medium=social&amp;amp;utm_campaign=reverse_pe_1111" rel="noopener noreferrer"&gt;reverse DCF page&lt;/a&gt;, stripped down to a single multiple.&lt;/p&gt;

&lt;h2&gt;
  
  
  The model in one equation
&lt;/h2&gt;

&lt;p&gt;Assume three things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You buy at today's P/E, call it &lt;code&gt;pe0&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;You hold for &lt;code&gt;n&lt;/code&gt; years and want an annual return &lt;code&gt;r&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;At the end you sell at a "normal" multiple &lt;code&gt;exitPe&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ignoring dividends, the price grows only if EPS grows or the multiple changes. Your return target says the price must grow by &lt;code&gt;(1 + r)^n&lt;/code&gt;. The price at exit is &lt;code&gt;exitPe × EPS_n&lt;/code&gt;, and the price today is &lt;code&gt;pe0 × EPS_0&lt;/code&gt;. So:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;exitPe × EPS_0 × (1 + g)^n = pe0 × EPS_0 × (1 + r)^n
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;EPS_0 cancels out, which is the nice part: &lt;strong&gt;you don't need the earnings number at all, only the multiple.&lt;/strong&gt; Solving for &lt;code&gt;g&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;g = (pe0 × (1 + r)^n / exitPe)^(1/n) − 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;This is close to the function our report generator calls, minus some rounding helpers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;IMPLIED&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;years&lt;/span&gt;&lt;span class="p"&gt;:&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;exitPe&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lowBaseGrowth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.25&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;impliedGrowth&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pe&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;requiredReturn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.08&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="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;pe&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="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// negative or missing earnings: the question has no answer&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;years&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;exitPe&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lowBaseGrowth&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;IMPLIED&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;g&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;pe&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;requiredReturn&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="n"&gt;years&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;exitPe&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="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;years&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;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;requiredEpsCagr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;lowBase&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;lowBaseGrowth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// see "the guardrail" below&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="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;impliedGrowth&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;26.26&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="c1"&gt;// { requiredEpsCagr: 0.1422..., lowBase: false }&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few deliberate choices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;10 years and an exit P/E of 15.&lt;/strong&gt; Ten years is long enough that a single great or terrible year doesn't dominate. Fifteen is roughly where a mature, still-profitable large company tends to trade. Both are assumptions, and the report prints them next to the result.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;8% required return for US stocks.&lt;/strong&gt; We use 9% for Hong Kong. It is a hurdle rate, not a forecast.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No dividends.&lt;/strong&gt; Ignoring them means the formula slightly &lt;em&gt;overstates&lt;/em&gt; the growth required, so the output errs on the demanding side. For Alphabet, with a 0.28% dividend yield, counting dividends would move the answer below from about 14.2% to about 13.9%; for a utility it is not, which is one reason this tool is a screen and not a verdict.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A real example: Alphabet on October 29, 2026
&lt;/h2&gt;

&lt;p&gt;Alphabet (GOOGL) fell 12.64% on October 29, 2026, closing at USD 283.82, as the market digested its Q3 2026 numbers. The research report on our site, dated October 30, records a P/E of 26.26x on the most recent full fiscal year at that close.&lt;/p&gt;

&lt;p&gt;Plug that in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;impliedGrowth&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;26.26&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// requiredEpsCagr ≈ 0.142&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So at that price, an investor who wants 8% a year and expects the stock to trade at 15x in ten years needs EPS to compound at about &lt;strong&gt;14.2% a year for a decade&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Is that a lot? The same report gives the context. In FY2025 revenue grew 15.1% and net profit attributable to shareholders grew 32.0%. But in Q3 2026 revenue grew 24.7% while net profit fell 24.3%. The report attributes much of that to "net other income" swinging from +USD 12.759 billion to −USD 8.221 billion, and notes that free cash flow for the quarter was −USD 9.07 billion. Search, the cash engine that was 55.7% of FY2025 revenue, grew 13.4% that year.&lt;/p&gt;

&lt;p&gt;That is exactly the kind of comparison the number is for. It doesn't tell you whether 14.2% will happen. It tells you that the price asks EPS to compound at roughly the pace search &lt;em&gt;revenue&lt;/em&gt; grew in FY2025 (13.4%), sustained for ten years, before you even get to the capex question. Whether that is easy or hard is a judgment about the business, and now it is a much narrower one.&lt;/p&gt;

&lt;p&gt;One more lesson from the same report: it lists two consensus 2026E EPS figures from different sources (USD 20.59 and USD 16.26) and refuses to average them because the bases conflict. A reverse multiple doesn't need either number, which is part of why it's robust when the forward estimates are messy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sensitivity: the assumptions matter more than the decimals
&lt;/h2&gt;

&lt;p&gt;Because the inputs are assumptions, never show one number without showing how it moves. Here is the grid for a 26.26x P/E:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;pe&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;26.26&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;0.07&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.08&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.09&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exitPe&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;g&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;pe&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&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="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="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;exitPe&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="mi"&gt;1&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="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;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toFixed&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="nf"&gt;padStart&lt;/span&gt;&lt;span class="p"&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="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`r=${(r * 100).toFixed(0)}%`&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;padEnd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output (columns are exit P/E 10, 15, 20, 25):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;r=7%   17.8   13.2   10.0    7.5
r=8%   18.9   14.2   11.0    8.5
r=9%   20.0   15.3   12.0    9.5
r=10%  21.1   16.3   13.0   10.5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two takeaways. First, the exit multiple moves the answer far more than the required return does: going from 15x to 20x knocks about 3 points off the required growth, while going from 8% to 9% adds about 1. Second, the base case sits in the middle of a range from roughly 7.5% to 21%. Anyone quoting "the market expects 14.2%" without the grid is overselling the precision.&lt;/p&gt;

&lt;h2&gt;
  
  
  The guardrail: when the arithmetic stops meaning anything
&lt;/h2&gt;

&lt;p&gt;Run the formula across a range of P/E ratios at 8% and an exit of 15x:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;P/E 10   -&amp;gt;  3.7%
P/E 15   -&amp;gt;  8.0%
P/E 20   -&amp;gt; 11.2%
P/E 40   -&amp;gt; 19.1%
P/E 60   -&amp;gt; 24.1%
P/E 120  -&amp;gt; 33.0%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first version of our reports printed all of these with the same confidence. The problem shows up at the bottom of the list. A P/E of 120 usually doesn't mean the market expects 33% compounding for ten years. It usually means earnings are temporarily tiny: a bad year, a one-off charge, a company just turning profitable. The ratio is large because the denominator is near zero, and the "required growth" is just the formula amplifying that.&lt;/p&gt;

&lt;p&gt;So we added a flag. If the required growth is above 25% a year (at 8% and an exit of 15x, that happens above a P/E of about 65), the result is still shown, but marked as a low-earnings-base artifact, and the report's written conclusion is no longer required to cite it. In code that is the single &lt;code&gt;lowBase&lt;/code&gt; line above. It's a small thing, but it removed a whole class of confident-sounding nonsense from the output.&lt;/p&gt;

&lt;p&gt;The same logic explains the &lt;code&gt;pe &amp;gt; 0&lt;/code&gt; check at the top: with negative earnings there is no growth rate that solves the equation, and returning &lt;code&gt;NaN&lt;/code&gt; or a negative number would be worse than returning nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this is and isn't
&lt;/h2&gt;

&lt;p&gt;It is a way to turn a multiple into a sentence a person can argue with: "at this price, earnings need to grow about X% a year for ten years." It is not a fair value, not a price target, and not a prediction. It ignores dividends and balance sheets, treats buybacks only through their effect on EPS, and ignores the path of growth (front-loaded growth and back-loaded growth give the same answer here, and they are not the same investment).&lt;/p&gt;

&lt;p&gt;If you want to try it on a company you follow, the &lt;a href="https://stockinsky.com/en/stock/US/GOOGL?utm_source=devto&amp;amp;utm_medium=social&amp;amp;utm_campaign=reverse_pe_1111" rel="noopener noreferrer"&gt;Alphabet report&lt;/a&gt; shows the full section with the peer multiples next to it. The page header refreshes daily, so its P/E will differ from the 26.26x in the October 30 report section. Or just copy the ten lines above and feed it any P/E you like. The interesting part isn't the output; it's arguing with the assumptions.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Not investment advice. Numbers as of October 29-30, 2026 (Alphabet close and report date); the sensitivity tables are outputs of the code shown.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>finance</category>
      <category>node</category>
      <category>beginners</category>
    </item>
    <item>
      <title>3,000+ stock pages that never call an API at request time</title>
      <dc:creator>David</dc:creator>
      <pubDate>Fri, 06 Nov 2026 16:50:09 +0000</pubDate>
      <link>https://dev.to/shllm/3000-stock-pages-that-never-call-an-api-at-request-time-4hoe</link>
      <guid>https://dev.to/shllm/3000-stock-pages-that-never-call-an-api-at-request-time-4hoe</guid>
      <description>&lt;p&gt;I run &lt;a href="https://stockinsky.com/en/?utm_source=devto&amp;amp;utm_medium=social&amp;amp;utm_campaign=static_stock_pages" rel="noopener noreferrer"&gt;Stockinsky&lt;/a&gt;, a small site that writes paid AI research reports on listed companies. Most companies will never get a paid report, but people still search for them by name. So I added a free page for every stock: ten years of financials, a red-flag checklist, dividend history and the latest close.&lt;/p&gt;

&lt;p&gt;There are now about 2,000 China A-share pages, plus around 530 Hong Kong and 530 U.S. ones. Here is how they are built, and the one incident that shaped the design.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rule: a page view never touches an upstream API
&lt;/h2&gt;

&lt;p&gt;The first version fetched data when someone opened a page and cached the result. That works fine for people. It does not work for crawlers. A search engine bot can open hundreds of stock pages in a few minutes, and every cache miss turns into several requests to free market-data endpoints.&lt;/p&gt;

&lt;p&gt;Then I made it worse myself. I ran a bulk measurement script &lt;strong&gt;on the production server&lt;/strong&gt;, and the quote provider started rate-limiting the server's IP. Live quotes on the site broke for real users. The site and my batch job shared one IP, so the batch job took the site down with it.&lt;/p&gt;

&lt;p&gt;After that I set one rule: &lt;strong&gt;the server only reads files&lt;/strong&gt;. All fetching happens on my own machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Snapshots, one JSON file per stock
&lt;/h2&gt;

&lt;p&gt;A local script builds one JSON file per stock:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;data/stock-snapshot/A/688981.json
data/stock-snapshot/HK/...
data/stock-snapshot/US/...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each file holds:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;finance&lt;/strong&gt;: ten years of revenue, net profit, ROE, gross margin, operating cash flow;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;risk&lt;/strong&gt;: a slimmed-down red-flag checklist (goodwill, cash and debt both high, share pledges, audit opinion, regulator inquiries...), each with the value, the rule and the source;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;dividends&lt;/strong&gt;: cash dividend per share for the last ten years;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;quote&lt;/strong&gt;: the close, change and market cap &lt;strong&gt;on the day the snapshot was built&lt;/strong&gt;, with that date shown on the page.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The script then syncs the files to the server, which renders pages from disk. A crawler can open every page on the site and not a single upstream request goes out.&lt;/p&gt;

&lt;h2&gt;
  
  
  Being polite to free endpoints
&lt;/h2&gt;

&lt;p&gt;The data sources are free public endpoints, so the build is deliberately slow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Concurrency 2 by default, capped at 3.&lt;/strong&gt; Each stock needs about 8–10 requests and takes roughly 12 seconds, so 1,000 stocks take about an hour and a half.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shared data is fetched once per run.&lt;/strong&gt; Quotes for the whole market come from about 100 batch requests, and the dividend table from about 20, instead of one call per stock.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resumable.&lt;/strong&gt; Snapshots newer than 7 days are skipped, so an interrupted run just starts again. One stock failing is logged and does not stop the others.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Slow is fine here. These numbers change once a quarter, not once a minute.&lt;/p&gt;

&lt;h2&gt;
  
  
  Thin pages get &lt;code&gt;noindex&lt;/code&gt;, not a 404
&lt;/h2&gt;

&lt;p&gt;Free endpoints time out, and some stocks come back with gaps. Some are suspended for months. Instead of hiding those pages, I gate what goes into the sitemap:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// a page enters the sitemap only if it passes indexable():&lt;/span&gt;
&lt;span class="c1"&gt;// enough data, not long suspended, snapshot not too old.&lt;/span&gt;
&lt;span class="c1"&gt;// Pages that fail still open normally, but carry noindex.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Visitors who land on any stock still get whatever data exists. Search engines are only asked to index the pages that are actually useful.&lt;/p&gt;

&lt;h2&gt;
  
  
  A timezone bug worth sharing
&lt;/h2&gt;

&lt;p&gt;Snapshot dates were cut from &lt;code&gt;toISOString()&lt;/code&gt;, which is UTC. The market data is in Beijing time (UTC+8), so a snapshot built before 8 a.m. local time was labelled with the previous day. Nothing crashed. The page just showed the wrong "as of" date. Format dates in the market's own timezone, not UTC.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why no LLM on these pages
&lt;/h2&gt;

&lt;p&gt;The site already uses LLMs for paid reports, so this was a deliberate choice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cost.&lt;/strong&gt; Generating text for 3,000 stocks every week would be paid by the site, for pages that earn nothing directly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trust.&lt;/strong&gt; Numbers that come straight from filings, with the source next to them, beat a fluent paragraph that is &lt;em&gt;probably&lt;/em&gt; right.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the free pages are purely mechanical: the same inputs always give the same page. The model only runs when a user asks for a full report.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would do again
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Separate the machine that fetches data from the machine that serves pages, even for a tiny site.&lt;/li&gt;
&lt;li&gt;Treat crawlers as a load pattern you design for, not an afterthought.&lt;/li&gt;
&lt;li&gt;Let missing data lower indexability instead of breaking the page.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is an example page: &lt;a href="https://stockinsky.com/stock/A/688981?utm_source=devto&amp;amp;utm_medium=social&amp;amp;utm_campaign=static_stock_pages" rel="noopener noreferrer"&gt;SMIC (688981)&lt;/a&gt;. The free pages for China A-shares are in Chinese for now; the &lt;a href="https://stockinsky.com/en/?utm_source=devto&amp;amp;utm_medium=social&amp;amp;utm_campaign=static_stock_pages" rel="noopener noreferrer"&gt;English site&lt;/a&gt; covers U.S. and Hong Kong stocks.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I built Stockinsky. The data comes from public disclosures and may lag or contain errors; company filings are the final word. Nothing here is investment advice.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>webdev</category>
      <category>seo</category>
      <category>sideprojects</category>
    </item>
  </channel>
</rss>
