<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Prateek on Medium]]></title>
        <description><![CDATA[Stories by Prateek on Medium]]></description>
        <link>https://medium.com/@prateek23022004?source=rss-e00069e83d38------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*hTYS27nfprOwN-0l</url>
            <title>Stories by Prateek on Medium</title>
            <link>https://medium.com/@prateek23022004?source=rss-e00069e83d38------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 05:08:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@prateek23022004/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Librarian (Smart Content Mapping): My GSoC 2026 with OWASP OpenCRE (Module C)]]></title>
            <link>https://medium.com/@prateek23022004/the-librarian-smart-content-mapping-my-gsoc-2026-with-owasp-opencre-module-c-8db874d46bab?source=rss-e00069e83d38------2</link>
            <guid isPermaLink="false">https://medium.com/p/8db874d46bab</guid>
            <category><![CDATA[ongoing-adventure]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[opencre]]></category>
            <category><![CDATA[gsoc-2026]]></category>
            <category><![CDATA[owasp]]></category>
            <dc:creator><![CDATA[Prateek]]></dc:creator>
            <pubDate>Sat, 22 Aug 2026 19:46:52 GMT</pubDate>
            <atom:updated>2026-08-22T19:46:52.611Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How OpenCRE’s decision layer got built, measured, and shipped, and why the most valuable number in it is the one that says “I don’t know.”</em></p><p>Security knowledge is only useful if you can trust it. <a href="https://github.com/OWASP/OpenCRE">OpenCRE</a> is OWASP’s answer to one of the most tedious problems in security engineering: cross-standard traceability. If you need to know how an ASVS requirement maps to NIST 800–53, or how a PCI-DSS control connects to a WSTG test case, OpenCRE does that work in seconds instead of hours. It is a knowledge graph that links dozens of security standards into one navigable structure.</p><p>But knowledge graphs go stale. Cheat sheets get updated, new standard versions land, guidance evolves. And when the mappings fall behind, something subtle and serious happens: a practitioner follows one outdated link, gets one wrong answer, and loses confidence in the entire graph. Not that one entry. The whole thing.</p><p>This is the story of my Google Summer of Code 2026, where I built Module C of the OWASP Integrated Ecosystem: <strong>The Librarian</strong>, the component that decides what every incoming piece of security content means, and, more importantly, decides when it should not decide at all.</p><h3>How it started</h3><p>I did not arrive at this project with a plan. I arrived with a pull request.</p><p>I had been contributing to OpenCRE since November 2025, across Gap Analysis, MyOpenCRE, parsers, the API, chatbot reliability, and CI. By the time I raised <a href="https://github.com/OWASP/OpenCRE/pull/718">#718</a> and <a href="https://github.com/OWASP/OpenCRE/pull/719">#719</a> against <a href="https://github.com/OWASP/OpenCRE/issues/471">issue #471</a>, I had 42 merged PRs and a decent mental model of how everything connected.</p><p>I thought #471 was a scoped fix. Then I got on a call with my mentors, Spyros Gasteratos, founder of Smithy Security and primary maintainer of OpenCRE, and Rob van der Veer from Software Improvement Group. They are the kind of mentors who do not just review your code. They ask why you made the decisions you made, and then they ask why again. What started as a discussion about two stacked PRs became a conversation about what OpenCRE actually needed. Not a fix for one issue. A decision layer: a component that could sit between incoming content and the knowledge graph and make a judgment call on every single section. Is this safe to auto-link, or does a human need to see it first?</p><p>That is what good mentorship looks like. Not direction. Expansion.</p><h3>The problem with a simple lookup</h3><p>Before the Librarian, OpenCRE mapped incoming content with a function that found the closest CRE node by vector similarity and returned an ID or nothing. Useful as a lookup. Not enough for a living graph.</p><p>It could not tell you how confident it was. It could not catch a negation, so it scored “DO NOT use MD5” and “use MD5” as nearly identical, because the surrounding words are the same. And it could not route uncertain cases to a human. It either mapped or it did not, with no middle ground.</p><p>That middle ground is exactly where trust lives. The Librarian was built to own it.</p><h3>The shape of the machine</h3><p>The OWASP Integrated Ecosystem is a pipeline of four modules, each built by a different contributor. Module A harvests new and changed content from OWASP repositories. Module B filters the noise and keeps security knowledge. Module C, my module, decides what each surviving chunk means. Module D puts a human in front of whatever C could not decide alone.</p><p>C’s whole job is deciding when not to decide. A wrong link pollutes a graph that practitioners read as truth. Sending everything to a human defeats the automation. All of the value lives in the boundary between those two, and that boundary is where I spent my summer.</p><p>The most important design decision in the Librarian is not the threshold value. It is the direction of the default. When the system is uncertain, it routes to human review. Always. A low-confidence case never auto-links, and a risky mapping never reaches the graph without a person seeing it first, along with the score, the reasoning, and the evidence that explains what the system was thinking when it asked for help.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eiYF-NWjQpnF7qvsOCeWTA.png" /><figcaption>The Librarian inside the OWASP Integrated Ecosystem: the four-module pipeline, and Module C’s shipped internals with the numbers behind each stage.</figcaption></figure><h3>Proving it before building it</h3><p>Before writing a single line of production code, I ran a pre-coding experiment on real OpenCRE data with production Gemini embeddings. The question was simple: does the architecture actually work on this corpus, or does it only work in a diagram?</p><p>Two findings shaped everything after. First, retrieval was strong enough to build on. Second, adding a cross-encoder dropped overall top-1 accuracy slightly, from 0.920 to 0.820 on that early 50-item run, while handling the hard cases, negations especially, dramatically better. That trade was expected and intentional: the cross-encoder is more conservative, and for a system that should never silently make a wrong mapping, conservative is correct. It also planted a flag I would come back to in week 8, when the same tension between overall accuracy and hard-case handling returned at full scale.</p><p>The experiment felt like confirmation that the main technical risk was already reduced, and that the remaining work was engineering, testing, and integration. Which is exactly the right place to be before you start building.</p><h3>Eight weeks, eight merges</h3><p>Every stage of the Librarian landed as its own reviewed and merged pull request into OpenCRE’s main branch. The contracts, config, and a 319-row hand-labelled golden dataset came first (<a href="https://github.com/OWASP/OpenCRE/pull/922">#922</a>), because you cannot claim a decision system works without something to measure it against. Then the input boundary (<a href="https://github.com/OWASP/OpenCRE/pull/925">#925</a>), candidate retrieval over the existing pgvector embeddings (<a href="https://github.com/OWASP/OpenCRE/pull/937">#937</a>), the cross-encoder reranker (<a href="https://github.com/OWASP/OpenCRE/pull/957">#957</a>), confidence calibration with an ECE gate (<a href="https://github.com/OWASP/OpenCRE/pull/974">#974</a>), the decision engine and the pipeline glue (<a href="https://github.com/OWASP/OpenCRE/pull/990">#990</a>, <a href="https://github.com/OWASP/OpenCRE/pull/991">#991</a>), and finally the live integration that made all of it real (<a href="https://github.com/OWASP/OpenCRE/pull/1011">#1011</a>). A companion PR carried the package docs, the final metrics, and the CI regression gate (<a href="https://github.com/OWASP/OpenCRE/pull/1012">#1012</a>); its content landed through <a href="https://github.com/OWASP/OpenCRE/pull/1011">#1011</a>, and that regression gate now runs on every pull request touching the Librarian.</p><p>The flow through those stages is simple to state. A chunk that explicitly cites a CRE id resolves deterministically, with no ML in the path at all. Everything else goes through retrieval, which pulls the top candidates from the graph, then reranking, which reads the chunk and each candidate together rather than separately, then calibration, which turns raw scores into confidence numbers that mean what they say. The decision engine applies one threshold: score at least 0.80 and the chunk auto-links, anything less goes to the human review queue with its candidates and its full audit trail attached.</p><p>Behind those merges sit 247 tests, and every one of them is hermetic. The whole suite runs in under four seconds with no database, no API key, and no model download, because every ML component sits behind a seam. The retriever takes an embedding function, the reranker takes a scoring function, the engine takes a guard. Live components and test stubs are interchangeable. That one early decision paid for itself every single week, because it meant every reviewer could run everything.</p><h3>The week with no code</h3><p>Week 7 shipped zero lines and might have been the most useful week of the summer. I swept the auto-link threshold across all 319 golden chunks to see what each setting actually buys.</p><p>At the shipped threshold of 0.80, the system auto-links 172 chunks at 96.5 percent precision, with six wrong. Drop the bar to 0.70 and you automate thirty more chunks, and wrong links go from six to fourteen. A bad link committed into a graph that other tools consume as ground truth costs far more than one extra human glance. We held at 0.80.</p><p>The sweep also exposed a ceiling. No threshold setting can be more accurate than the ranking sitting underneath it. The review queue could not be shrunk from the threshold side at all. That finding set up the hardest part of the summer.</p><h3>The number I missed</h3><p>The plan targeted 90 percent top-1 ranking accuracy. The shipped number is 75. I want to be precise about why, because the honest answer turned out to be more useful than any of my attempts to fix it.</p><p>I tried thirteen separate reranker levers: model swaps, prompt shapes, score fusion, candidate-pool changes. All thirteen regressed. The cross-encoder as shipped actually scores net minus seven against plain cosine similarity on the same shortlist. The root cause is not the model. It is the corpus: 427 of the 428 CREs have empty description fields. A cross-encoder scores a query against a document, and when the document side is effectively a bare title, there is nothing to cross-attend to. Retrieval still reaches 98 percent recall over that same thin corpus, which localises the problem exactly. The information needed to rank within a shortlist is simply not there to be read. The path to 90 percent runs through populating CRE descriptions, not through a better reranker.</p><p>There is a version that gets closer. Gating the reranker to fire only where it helps reached 250 of 319 against the shipped 238. It is deliberately unshipped. It needs held-out validation there was no time to do honestly, and shipping it on in-sample numbers would be exactly the kind of quiet dishonesty this project spent three separate fixes eliminating elsewhere.</p><p>Meanwhile, the number I trust most: review recall is five out of five. Every chunk that should reach a human does. The engine never once wrongly auto-linked something that needed review. For a gate whose failure mode is polluting shared truth, that is the number that matters. Failing safe is not a slogan you put in a design doc. It is a measurement, and this one held.</p><h3>Going live</h3><p>Week 8 made the handoff real. C now drains Module B’s knowledge_queue, decides every row, writes each decision to decision_queue, the table Module D will read, and only then marks the source rows consumed. Consumption is gated on persistence, so a crash can never silently destroy a chunk. B will not re-offer a row C claimed to have finished, so C is not allowed to claim it finished anything until the decision is durably somewhere.</p><p>Integration found real bugs, the way integration always does. C originally read only B’s KNOWLEDGE label and stranded the UNCERTAIN rows. Those are chunks B was unsure about classifying, not chunks it judged worthless. Module B’s owner caught it, and C now reads both labels and records which one each decision came from.</p><p>The reviewing did not stop at the merge. Manshu, who built Module B, later <a href="https://github.com/OWASP/OpenCRE/issues/1025">filed an issue</a> pointing out that C read the shared queue without row locking. Harmless with today’s single consumer, unsafe the day anyone runs two. I verified his claim against the code. He was right. <a href="https://github.com/OWASP/OpenCRE/pull/1030">The fix</a>, in review as I write this, adds opt-in row claiming that refuses to run on a database that cannot honour the lock, rather than degrading silently. SQLite drops the locking clause without an error, and an unlocked batch handed to a caller who asked for a locked one is the kind of failure that surfaces weeks later, far from its cause. Then the automated reviewer caught a genuine transaction leak in my fix: dry runs were taking locks they never released. Two modules reviewing each other’s assumptions, and a bot reviewing mine. That loop of claim, verify, counter-example, fix was the closest thing to real-world engineering this whole program offered.</p><h3>What I am handing over</h3><p>Module C is complete as scoped, and its gaps are declared rather than hidden. The graph writer is deliberately blocked until a safety detector exists, because retiring a queue row is recoverable and committing a wrong edge into a trusted graph is not. The SafetyGuard seam is wired into the engine; the detection behind it is future work. The selective reranker is measured and waiting for held-out validation. Module D has a written contract and a populated decision queue waiting for it.</p><p>Everything is on main and reproducible from one command: the final report and full metrics live in <a href="https://github.com/OWASP/OpenCRE/tree/main/docs/gsoc_2026_module_c">docs/gsoc_2026_module_c/</a> in the OpenCRE repository, and my complete contribution history is at <a href="https://github.com/OWASP/OpenCRE/pulls?q=is%3Apr+author%3APRAteek-singHWY">github.com/OWASP/OpenCRE</a>. The pull requests tell the story better than I can. Even this post lives there, committed alongside Module B’s final blog in <a href="https://github.com/OWASP/OpenCRE/pull/1040">#1040</a>.</p><h3>What the summer actually taught me</h3><p>Negative results are deliverables. Thirteen failed experiments plus one root cause is worth more to the next contributor than a lucky two-point gain. The most-cited artifact from my summer will probably be the finding that the corpus, not the model, is the bottleneck.</p><p>Contracts beat conversations. Every cross-module bug we hit lived in the gap between what someone assumed and what someone else wrote. Every fix shipped its documentation in the same pull request, because a contract that lags its code is just a rumor with a filename.</p><p>And the safe direction is a design choice you make once, early, and then defend. One hundred percent review recall at the cost of fifty-six percent auto-link recall is not a compromise. It is the point. Systems that guard shared truth should be able to say “I don’t know” cheaply, and should say it by default.</p><h3>The people</h3><p>None of this happens alone. Spyros Gasteratos mentored this project with questions rather than directions, and the bar he holds for what counts as verified changed how I work. Rob van der Veer’s early questions shaped what the Librarian became before a line of it existed. Paola Garcia Cardenas and Parth Sohaney kept the reviews and the coordination moving through a busy final stretch. And Manshu made both our modules better by refusing to take either one’s assumptions on faith. <a href="https://manshusainishab.medium.com/">His Module B writeups</a> are worth your time, and his final chapter tells the other side of the <a href="https://github.com/OWASP/OpenCRE/issues/1025">#1025</a> story.</p><p>GSoC ends this week. The pipeline does not. Module D needs building, the corpus needs descriptions, and I intend to be around for both.</p><p>Full contribution history: <a href="https://github.com/OWASP/OpenCRE/commits?author=PRAteek-singHWY">github.com/OWASP/OpenCRE/commits?author=PRAteek-singHWY</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8db874d46bab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Juni]]></title>
            <link>https://medium.com/@prateek23022004/juni-2c6816e8af0a?source=rss-e00069e83d38------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c6816e8af0a</guid>
            <category><![CDATA[safe-relationship]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[safety]]></category>
            <category><![CDATA[product-engineering]]></category>
            <category><![CDATA[dating-app]]></category>
            <dc:creator><![CDATA[Prateek]]></dc:creator>
            <pubDate>Sun, 28 Jun 2026 04:02:22 GMT</pubDate>
            <atom:updated>2026-06-28T04:02:22.553Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Building Safety Into a Dating App When You’re the Only Engineer</strong></p><p>I build Juni alone. It is a dating app for Indian college students, and the pitch is the opposite of every app you have used. No swiping, no browsing, no chatting inside the app. You sign up with your college email, have one honest conversation with an AI, and every Wednesday you get exactly one match: a real person from your campus, a real venue, a real time. You just show up.</p><p>That only works if people trust it. A woman is not going to meet a stranger at a cafe because an algorithm told her to, unless she believes he is who he claims to be and that someone has her back if it goes wrong. So before I wrote any matching logic, I had to decide who I was defending against.</p><p><strong>Who I Was Actually Afraid Of</strong></p><p>Three bad actors kept me up at night. The catfish, who is not a student at all or not the person in the photo. The predator who gets reported, gets banned, and signs up again with a fresh email. And anyone under eighteen, because the moral and legal floor under this whole thing collapses if a minor ends up on a date arranged by my code. Each one shaped a specific decision, and none of them are clever. They are just deliberate.</p><p><strong>Verification, and Why It Is Boring on Purpose</strong></p><p>Identity starts at the door. You cannot request a login code unless your email matches a college domain we recognize, which in practice means an .ac.in address tied to a college in our registry. If your college is not on Juni yet, you get a soft message that says so, and that message is intentionally identical whether the college is missing or just deactivated. I did not want the signup screen to become a tool for mapping which campuses are live.</p><p>Email proves you are a student today. It does not prove you are the human in the profile, so verification has a second layer: a selfie plus a photo of your student ID, run through OCR for name, roll number, and college, then queued for a human to approve. I chose manual review over trusting a face-match score, because a wrong automated approval here is not a bug, it is a safety incident. The submission and ban-evasion logic lives in <a href="https://github.com/PRAteek-singHWY/juni/blob/main/juni-backend/src/features/safety/safety.service.ts">safety.service.ts</a>.</p><p>Ban evasion got the answer I am quietest about. When someone is banned and later deletes their account, I do not erase everything. I keep a pseudonymous tombstone holding a hash of their email and a second hash of their college plus roll number. When a new signup or ID submission matches one of those, the account is re-banned automatically before it reaches a person. They can change their email easily. Changing the roll number on their actual college ID is much harder.</p><p>Age is the one place I refused to bend. Date of birth is captured explicitly, validated against impossible and overflow dates, and anyone under eighteen is turned away with no path forward. The matching query then re-checks age at the database level, so even a profile that somehow skipped the gate can never enter a candidate pool.</p><p><strong>Consent Is the Product, Not a Feature</strong></p><p>Because there is no swiping, consent is structural. The algorithm scores every possible pair in both directions independently and combines the two with a harmonic mean, which punishes one-sided interest hard. A pairing where one person is thrilled and the other is lukewarm collapses to a low number and never gets made. A match also has to land in both people’s top candidates before it is created, so it is mutual by construction, not by a later swipe. After that, both people still have to accept before the date confirms.</p><p>When consent is withdrawn, the system treats it as permanent. A block, in either direction, bars that pair from ever matching again. I store it order-independently, so one block row excludes both directions forever, and there is a comment in <a href="https://github.com/PRAteek-singHWY/juni/blob/main/juni-backend/src/features/matching/matching.service.ts">matching.service.ts</a> reminding future-me to never soften this into a mere scoring penalty. Reporting someone blocks them by default in the same action, and if you were in an active match, that match is cancelled on the spot.</p><p><strong>What Happens When Moderation Misses</strong></p><p>It will miss. I do not run automated content classifiers, because the real risk on Juni happens at an offline cafe, not in a chat log that does not exist. Reports go into a human review queue with categories like harassment, fake profile, and safety threat, and I can ban from there with the reason logged.</p><p>The harder question is the gap between something bad happening and me seeing the report. That gap is why Safe Date mode exists, on by default for women, with venue approval, emergency contacts, and an SOS button that pings those contacts with a location. Parts of that dispatch are still stubbed, and I will not pretend otherwise. After every date, the AI debrief asks quietly about red flags, which turns a missed incident into a signal I can act on later.</p><p><strong>Where Friction Won</strong></p><p>I chose one match a week over endless matches, a hard eighteen gate over growth, and manual ID review over instant onboarding. Every one of those costs me users. The honest gap I would close next is appeals, because right now a wrong ban has no clean way back, and that asymmetry bothers me. But if I have to err, I would rather a real student wait an extra day than a fake one get a date.</p><p>The same principle runs through everything I have built, here and in my security work at OWASP OpenCRE. When a system makes consequential decisions about real people, the direction of the default matters more than the sophistication of the algorithm. Fail safe, not open. Route to a human before writing to the graph. Turn away the uncertain signup rather than waving it through.</p><p>That is not a technical insight. It is just taking the consequences seriously.</p><p><em>Juni is built in the open. The backend, matching algorithm, and safety code are on GitHub at </em><a href="https://github.com/PRAteek-singHWY/juni"><em>github.com/PRAteek-singHWY/juni</em></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qxcO6BfibXac3G6ByHcP6Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c6816e8af0a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Librarian]]></title>
            <link>https://medium.com/@prateek23022004/the-librarian-499ffba43c5f?source=rss-e00069e83d38------2</link>
            <guid isPermaLink="false">https://medium.com/p/499ffba43c5f</guid>
            <category><![CDATA[google-summer-of-code]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai-safety]]></category>
            <dc:creator><![CDATA[Prateek]]></dc:creator>
            <pubDate>Sun, 28 Jun 2026 03:55:08 GMT</pubDate>
            <atom:updated>2026-06-28T03:55:08.333Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>The Librarian: Building a System That Fails Safe, Not Open</strong></p><p>Security knowledge is only useful if you can trust it. OpenCRE is OWASP’s attempt to solve one of the most tedious problems in security engineering: cross-standard traceability. If you need to know how ASVS requirement 4.1.1 maps to NIST 800–53, or how a PCI-DSS control connects to a WSTG test case, OpenCRE does that work in seconds instead of hours. It is a knowledge graph that links dozens of security standards into one navigable structure.</p><p>But knowledge graphs go stale. OWASP cheat sheets get updated. New ASVS versions land. Guidance evolves. And when the mappings inside OpenCRE fall behind the ecosystem, something subtle but serious happens. A practitioner follows one outdated link, gets a wrong answer, and loses confidence in the entire graph. Not just that one entry. The whole thing. That is the cost of a stale mapping, and it is why I spent my GSoC 2026 building Module C: The Librarian.</p><p><strong>How It Actually Started</strong></p><p>I did not arrive at this project with a plan. I arrived with a pull request.</p><p>I had been contributing to OpenCRE since November 2025, working across Gap Analysis, MyOpenCRE, parsers, API, chatbot reliability, and CI. Some of the contributions that shaped my understanding most directly: <a href="https://github.com/OWASP/OpenCRE/pull/748">#748</a> repaired a dead optimization toggle and added a benchmark harness in Gap Analysis. <a href="https://github.com/OWASP/OpenCRE/pull/716">#716</a> was a real performance optimization using tiered Neo4j queries. <a href="https://github.com/OWASP/OpenCRE/pull/685">#685</a> added CSV import preview and UX safeguards in MyOpenCRE, which taught me how rollout discipline works in a tool real practitioners depend on. <a href="https://github.com/OWASP/OpenCRE/pull/721">#721</a> was a direct parser correctness fix that made me understand exactly where Module C would need to integrate. <a href="https://github.com/OWASP/OpenCRE/pull/762">#762</a> added source-query support for CRE integration metrics, and <a href="https://github.com/OWASP/OpenCRE/pull/709">#709</a> exposed the OpenAPI specification for the REST API.</p><p>By the time I raised <a href="https://github.com/OWASP/OpenCRE/pull/718">#718</a> and <a href="https://github.com/OWASP/OpenCRE/pull/719">#719</a> against Issue <a href="https://github.com/OWASP/OpenCRE/issues/471">#471</a>, I had 42 merged PRs across the codebase and a decent mental model of how everything connected.</p><p>Issue <a href="https://github.com/OWASP/OpenCRE/issues/471">#471</a> carried important tags. I initially thought it was a scoped fix. I raised two stacked PRs and felt reasonably good about them. Then I got on a call with my mentors <a href="https://github.com/northdpole">Spyros Gasteratos</a>, founder of <a href="https://smithy.security/">Smithy Security</a> and primary maintainer of OpenCRE, and <a href="https://github.com/robvanderveer">Rob van der Veer</a> from Software Improvement Group, who contributes to OWASP, NEN, and ISO/IEC standards.</p><p>That conversation changed everything.</p><p>Spyros and Rob are the kind of mentors who do not just review your code. They ask you why you made the decisions you made, and then they ask why again. What started as a discussion about two PRs became a much longer conversation about what OpenCRE actually needed. Not a fix for one issue. A decision layer. A component that could sit between incoming content and the knowledge graph and make a judgment call on every single section: is this safe to auto-link, or does a human need to see it first?</p><p>By the end of that meeting, the architecture for four GSoC modules had taken shape. Module A would harvest changes nightly. Module B would filter noise. Module C, The Librarian, would make the mapping decision. Module D would give maintainers a review interface. I walked away from that call with a much bigger project than I had walked in with, and I felt the weight of that in the best possible way.</p><p>That is what good mentorship looks like. Not direction. Expansion.</p><p><strong>The Problem With a Simple Lookup</strong></p><p>Before The Librarian, OpenCRE used a function called get_id_of_most_similar_cre. It takes an incoming section, finds the closest CRE node using vector similarity, and returns an ID or nothing. That is useful as a basic lookup. It is not enough for a living knowledge graph.</p><p>It cannot tell you how confident it is. It cannot detect when an incoming section contradicts something already mapped. It cannot catch a negation, meaning it scores “DO NOT use MD5” and “use MD5” as nearly identical because the surrounding words are the same. And critically it cannot route uncertain cases to a human. It either maps or it does not, with no middle ground.</p><p>That middle ground is exactly where trust lives. Module C is built to own it.</p><p><strong>What The Librarian Actually Does</strong></p><p>Every incoming OWASP section passes through Module C before anything is written to the graph. The pipeline has two paths.</p><p>If the section already contains a valid explicit OpenCRE link, the ExplicitLinkResolver handles it deterministically. No machine learning, no thresholds, no ambiguity. If the link is valid it maps directly. If it is invalid, deprecated, or conflicting, it goes to human review.</p><p>If there is no explicit link, the semantic path kicks in. CandidateRetriever pulls the top 20 candidate CRE nodes using pgvector against existing embeddings in db.py, meaning no new vector store is introduced. CrossEncoderRanker then reranks those candidates using ms-marco-MiniLM-L-6-v2, reading the query and candidate together rather than independently. This matters because a bi-encoder scores negations poorly. A cross-encoder does not.</p><p>Then SafetyGuard runs. It checks for negation-sensitive phrasing, mapping flips, and contradictions against prior mapped content. Finally DecisionEngine applies the routing threshold. Score of 0.80 or above means the section auto-links to the graph. Below 0.80 means it goes to the pending_mappings review queue for a human to inspect before anything is written.</p><p><strong>What the Numbers Showed</strong></p><p>Before writing a single line of production code I ran the pre-coding experiment on real OpenCRE data with production Gemini embeddings. The question was simple: does cross-encoder reranking actually improve negative case handling enough to justify the added complexity?</p><p>On a 50-item ASVS sample, the cosine-only baseline got 0.750 negative top-1 accuracy. The cross-encoder got 1.000. On a 100-item stability check, the baseline got 0.778. The cross-encoder got 1.000 again. Both runs cleared the RFC criterion of greater than 20% improvement on negatives, with relative improvements of 33.3% and 28.6% respectively.</p><p>Seeing 1.000 on both runs did not feel like a victory. It felt like confirmation that the main technical risk was already reduced and that the remaining work was engineering, testing, and integration. Which is exactly the right place to be before you start building.</p><p>Overall top-1 accuracy dropped slightly with the cross-encoder, from 0.920 to 0.820 on the 50-item run. That is expected and intentional. The cross-encoder is more conservative. It trades some overall precision for dramatically better handling of the hard cases. For a system that should never silently make a wrong mapping, that tradeoff is correct.</p><p><strong>Failing Safe, Not Open</strong></p><p>The most important design decision in Module C is not the threshold value. It is the direction of the default.</p><p>When the system is uncertain it routes to human review. Always. A low-confidence case never auto-links. A risky mapping flip never reaches the graph without a human seeing it first. The review queue stores the full DecisionResult payload, including the score, the reason, the evidence, and the routing decision, so the maintainer has everything they need to make a real judgment call.</p><p>This is what failing safe means in practice. Not failing loudly, not failing with an error message. Failing by stopping and asking a human. The system is designed so that the worst outcome of an uncertain decision is a slightly longer review queue, not a corrupted knowledge graph.</p><p>That principle generalised for me during this project. I was building a security tool but the underlying question was the same one that comes up in any automated system making consequential decisions at scale. How do you know when the machine should stop and wait? How do you make that the default rather than the exception? How do you build the instrumentation so a human can actually understand what the system was thinking when it asked for help?</p><p>Those questions do not have clean answers. But building a system that asks them seriously is a different thing from building one that does not ask them at all. That is what The Librarian is trying to be.</p><p>A lot of that clarity came from two people who looked at two stacked PRs on a routine issue and saw something much larger hiding underneath. I am glad they did.</p><p><strong>Full contribution history:</strong> <a href="https://github.com/OWASP/OpenCRE/commits?author=PRAteek-singHWY">github.com/OWASP/OpenCRE/commits?author=PRAteek-singHWY</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v2boowrWpz74TRVoBJe6-w.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=499ffba43c5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>