<?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: 刘天赫</title>
    <description>The latest articles on DEV Community by 刘天赫 (@lennonhaha).</description>
    <link>https://dev.to/lennonhaha</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%2F4221458%2F0fe0471b-2b85-427f-85c2-69c02934c924.jpeg</url>
      <title>DEV Community: 刘天赫</title>
      <link>https://dev.to/lennonhaha</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lennonhaha"/>
    <language>en</language>
    <item>
      <title>The Silent Field Loss: Why a Green CI Pipeline is Lying to You</title>
      <dc:creator>刘天赫</dc:creator>
      <pubDate>Mon, 02 Nov 2026 04:08:54 +0000</pubDate>
      <link>https://dev.to/lennonhaha/the-silent-field-loss-why-a-green-ci-pipeline-is-lying-to-you-2elo</link>
      <guid>https://dev.to/lennonhaha/the-silent-field-loss-why-a-green-ci-pipeline-is-lying-to-you-2elo</guid>
      <description>&lt;p&gt;As an independent security researcher, I spend a lot of time auditing open-source cryptographic implementations and supply chain toolings.&lt;/p&gt;

&lt;p&gt;During a recent audit, I stumbled upon a terrifying realization: &lt;strong&gt;Your CI is green, your schema validation passes, but the data might be silently disappearing.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here is the story of how we caught a silent field loss in a standard cryptographic data format, and why "structural validity" does not equal "semantic completeness."&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem: Structural Validity vs. Semantic Loss
&lt;/h2&gt;

&lt;p&gt;When migrating to Post-Quantum Cryptography (PQC), organizations rely on standardized formats like CycloneDX CBOM (Cryptographic Bill of Materials) to track algorithms. &lt;/p&gt;

&lt;p&gt;During our audit, we used a popular open-source Python library to parse and re-emit a CBOM document. The document carried several optional fields.&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;# The schema-valid 1.7 JSON input
&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;algorithmProperties&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;algorithmFamily&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ECDH&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ellipticCurve&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;P-256&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;parameterSetIdentifier&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;256&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;primitive&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;key-agree&lt;/span&gt;&lt;span class="sh"&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;After a simple &lt;code&gt;parse -&amp;gt; emit&lt;/code&gt; round-trip, we validated the output against the official schema. &lt;strong&gt;It passed.&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;But when we printed the output, it looked like this:&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="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"algorithmProperties"&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="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"curve"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"P-256"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"parameterSetIdentifier"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"256"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"primitive"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"key-agree"&lt;/span&gt;&lt;span class="w"&gt;
  &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="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;algorithmFamily&lt;/code&gt; was gone.&lt;/strong&gt; No exceptions, no warnings. The document is still valid, but the data is lost. &lt;/p&gt;

&lt;p&gt;Why? Because the underlying Python library simply hasn't modeled that specific field yet. Schema validation only checks if the structural format is legal; it doesn't check if the parser actually consumed and retained the semantic content.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution: Negative Control Testing
&lt;/h2&gt;

&lt;p&gt;To catch this "silent field loss," traditional unit tests are useless because they test your &lt;em&gt;own&lt;/em&gt; assumptions. You need &lt;strong&gt;Negative Control Testing&lt;/strong&gt; and an &lt;strong&gt;Independent Oracle&lt;/strong&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The Negative Control:&lt;/strong&gt; We wrote a script that explicitly constructs a document with these fields, parses it, and asserts their survival. If the field is dropped, the test deliberately fails. This catches the defect.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Independent Oracle:&lt;/strong&gt; For cryptographic implementations, we don't just test against ourselves. We cross-verify byte-by-byte (public keys, ciphertexts, shared secrets) against an independent reference implementation.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Delivery Gate: Bytes over Trees
&lt;/h2&gt;

&lt;p&gt;The same principle applies to deployment. A while ago, &lt;code&gt;git reset --hard&lt;/code&gt; returned 0, and our CI checks were all green. But the public server was serving a file that was slightly shorter than what was in the commit. Why? The &lt;code&gt;.gitattributes&lt;/code&gt; normalized line endings (CRLF to LF), silently destroying the cryptographic hashes.&lt;/p&gt;

&lt;p&gt;We fixed this by building a black-box delivery gate that fetches the public URL and compares the raw bytes against the &lt;code&gt;git cat-file&lt;/code&gt; object. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A green pipeline is a statement about the tree; only a request to the wire is a statement about the wire.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I Built This
&lt;/h2&gt;

&lt;p&gt;I am a 16-year-old independent researcher. I built this open-source auditing toolchain because the PQC migration is facing a 2030/2035 deadline. If the underlying evidence chain is broken, the cryptography is worthless. &lt;/p&gt;

&lt;p&gt;We published a technical preprint on Zenodo documenting this (DOI: &lt;a href="https://doi.org/10.5281/zenodo.23808518" rel="noopener noreferrer"&gt;10.5281/zenodo.23808518&lt;/a&gt;), and the entire toolchain is open-sourced.&lt;/p&gt;

&lt;p&gt;If you are working on PQC migration or supply chain security, I would love to hear your thoughts. How do you handle semantic validation in your CI pipelines?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check out the open-source repo: &lt;a href="https://github.com/Lennonhaha/fibemate" rel="noopener noreferrer"&gt;github.com/Lennonhaha/fibemate&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Read the academic preprint (DOI): &lt;a href="https://doi.org/10.5281/zenodo.23808518" rel="noopener noreferrer"&gt;10.5281/zenodo.23808518&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's make our evidence chains verifiable.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>security</category>
      <category>devops</category>
      <category>cryptography</category>
    </item>
  </channel>
</rss>
