Fabrication-Pattern Regression-Guard Automation: A Script That Hunts the Exact Shape of Nine Real Defects

Why finding nine instances of the same bug once is not the same as preventing a tenth
Fixing nine real occurrences of the same underlying defect pattern is real, valuable work — but a fix applied nine times by hand says nothing about whether a tenth instance, written by someone unaware of the previous nine, would ever be caught before it ships. A pattern that recurred nine times independently across one codebase clearly reflects something structural about how that pattern gets introduced, not nine unrelated coincidences — and the only way to genuinely close that gap is a mechanism that keeps checking for the pattern itself, automatically, rather than relying on everyone who touches the code afterward to remember nine specific historical incidents.
How the underlying problem shows up before you fix it
The same category of defect — a plausible-looking fake number standing in for a real measurement — gets independently reintroduced in a new part of the codebase, because nothing automatically checks for its specific signature.
A fix that fully corrects a known defect has no mechanism verifying the fix stays in place as the codebase continues to change around it.
A code-scanning rule is written to search for evidence of a problem (like an explanatory comment) rather than the problem's actual, executable pattern — and a comment can be deleted far more easily than the underlying behavior can be removed.
A guard or check that is never adversarially tested against its own supposed targets can pass indefinitely while silently missing exactly the thing it claims to catch.
A dangerous, legacy configuration file remains present in a repository with no persistent marker warning that it must never be applied.
Why nine separate fixes still leave the underlying pattern free to recur
A one-time fix addresses the nine specific lines of code where a defect pattern was found — it does nothing about the eight, or eighty, other places in an actively developed codebase where the identical pattern could be written next, by a different person, months later, with no memory of the original incident. The only way to make a fix genuinely durable against a pattern that recurred nine times independently is to encode the pattern itself as something a machine checks for automatically, on every file, every time — because a pattern real enough to appear nine separate times on its own is exactly the kind of pattern that will appear an unknown number of additional times if nothing is specifically watching for it.
How Centriu built a guard against the exact pattern the audit found, and adversarially tested it against itself
The same internal audit that rewrote Axiom's proof-of-action mechanism and connected its safety scanner to the real AI path (both covered on this pillar's companion pages) produced a standalone script whose entire purpose is refusing to let any of the nine specific fabrication patterns it found reappear anywhere in the module. Rather than attempting to judge intent — the audit's own account is explicit that none of the nine were malicious, all began as legitimate demo scaffolding that simply never got told when it became permanent — the guard searches for the concrete, mechanical signatures each defect actually left in the code.
Among the checks: any code where a random-number function feeds directly into a variable later used as a pass/fail decision, a score, or a count presented to a user as a measurement (with a short, explicitly justified allowlist for the small number of genuinely legitimate uses of randomness, like generating an internal identifier — each exemption has its reason written down, on the principle that an exemption without a documented reason is the same failure mode as the original defect: someone decided, and nobody else knows why); the precise bit-shifting pattern of the specific homemade hash algorithm the fake "proof" feature used, plus any comment admitting a hash implementation is a placeholder; any storage path referencing the fake `mock://` scheme; and any severity or risk ranking computed by looking up a value's position in an array (the exact fail-open pattern that let an unrecognized threat severity silently rank as harmless in the Safety Scanner). The script also directly checks that specific, named wiring stays intact going forward — that the AI conversation path still calls the safety scanner's real enforcement function, that action execution still calls the proof-capture functions, and that a set of legacy, dangerous SQL migration files still carry their obsolete-and-do-not-apply marker.
The script's own honesty about its limits is worth taking at face value: it deliberately strips out comments before scanning code, specifically because several of its own explanatory comments quote the exact bad code being guarded against (to explain what was wrong), and without stripping comments first, the guard would flag its own documentation of the fix as evidence the defect had returned — which would create a genuinely bad incentive, effectively punishing whoever had bothered to explain the fix in a comment.
That design decision was directly, adversarially tested, and the test found a real gap in the guard's own first version — not a hypothetical one. One rule was built to catch a fixed-delay timer used to fake real processing time, and its detection method searched for the specific comment associated with that pattern ("Simulate LLM delay"). But the guard's own comment-stripping step ran first, and comment-stripping removes exactly that kind of comment before any rule ever sees the code — so when the fixed delay was deliberately reintroduced without its identifying comment, as part of testing the guard by trying to sneak 13 previously-fixed violations back in one at a time, that rule missed it, while the other 12 reintroduced violations were all caught. The rule was rewritten to search for the delay's actual executable PATTERN — a literal timer call with a fixed delay above a minimum threshold — rather than relying on a comment that a script had already deleted by the time the rule ran. Re-testing after the fix caught all 13 reintroduced violations.
What is actually built today
A standalone script scanning every `.ts`/`.tsx` file in the module's service, hook, lib, page, and component directories — confirmed by direct re-run today to still pass cleanly across 262 files.
Detection for a random number feeding directly into a score, pass/fail decision, or count presented as a real measurement, with a short, individually-justified allowlist for legitimate uses of randomness.
Detection for the specific homemade hash pattern used in the original fake "proof" feature, plus any comment admitting a hash implementation is a placeholder.
Detection for a fixed-delay timer pattern used to fake real processing time — fixed specifically after an adversarial self-test found the original version relied on a comment its own comment-stripping step had already deleted.
Detection for the fake storage-path scheme the original fabricated evidence used, and for severity/risk rankings computed via array lookup that silently treat an unrecognized value as safe.
Direct, named checks that the safety-scanner enforcement function and the proof-capture functions remain genuinely wired into their real call sites, and that specific legacy SQL files retain their obsolete-and-do-not-apply marker.
A reintroduced shortcut caught before it ships (illustrative scenario, not a real client)
A future change to the codebase, made by someone with no memory of the original nine-defect audit, reintroduces a random-number-based placeholder score somewhere new, planning to replace it with a real calculation "later." Running the guard script catches this immediately and by name, rather than letting it ship silently the way the first nine instances did before anyone was specifically looking.
What changes operationally
The nine specific defects found in one audit are now backed by a standing, repeatable check for the pattern itself — not just nine individual fixes that could each be quietly undone or independently reintroduced elsewhere without anyone noticing. And because the guard was adversarially tested against its own supposed targets and had a real, found-and-fixed gap in its first version, its current pass result carries more weight than a check that has only ever been run against code nobody deliberately tried to sneak a violation past.
When this is not the right fit
This guard is a standalone script invoked directly, confirmed by direct inspection to have no automatic CI or build-pipeline wiring anywhere in the repository today — it does not run itself on every change without someone or something explicitly executing it. A team expecting an automatic, always-on gate blocking every commit will need to add that wiring themselves; what exists today is a working, adversarially-tested detector, not a self-triggering one.
A rule that searches for the confession vs. one that searches for the act
A detection rule built around a comment or a name is only as durable as that comment or name — and a comment is far easier to delete than the underlying code pattern it describes, especially when a different processing step (like the guard's own comment-stripping) removes it before the rule ever runs. Centriu's guard was corrected specifically to search for the executable pattern itself wherever comments alone weren't reliable, learned directly from a real, documented gap its own first adversarial test uncovered rather than assumed to be airtight from the start.
Related systems
Main system: Centriu Axiom.
What it does NOT do
- Does not run automatically as part of any CI pipeline or build step — confirmed by direct inspection that no `package.json` script or workflow file anywhere in the repository invokes it; it is a standalone script run directly today.
- Does not judge intent or flag legitimate uses of randomness — a short, explicitly justified allowlist exists for genuine cases like generating an internal identifier, with each exemption's reason written down.
- Does not rely solely on a comment to detect the theatrical-delay pattern anymore — after its own adversarial self-test found that gap, the rule was rewritten to detect the actual executable timer pattern as well.
- Does not flag its own explanatory comments as violations — code comments are stripped before scanning specifically so the guard doesn't punish documentation that quotes the removed bad code to explain a fix.
- Does not claim to catch every possible future fabrication pattern — it is scoped specifically to the concrete signatures the original nine-defect audit actually found, not a general-purpose fraud detector.
- Does not pass a violation silently — any match writes a specific, named rule violation and a human-readable reason to its output, and the script exits with a failing status if anything is found.
Security and governance
The guard operates entirely on source code already present in the repository and makes no network calls or external requests. Its checks include confirming that specific security-relevant wiring (safety-scanner enforcement, action-proof capture, obsolete-migration markers) remains intact. Full detail on access control lives at /governanca and /iso.
Pricing and contracting
Available by monthly subscription, with tiered plans. Values and terms come from the official pricing table at /precos (Centriu's central source — never restated here).
Frequently asked questions
What exactly does this script check for?
The specific code signatures nine real, independently-found defects left behind: a random number feeding a score or decision, a particular homemade hash pattern, a fixed theatrical delay, a fake storage path, and severity rankings that silently treat an unrecognized value as safe.
Does the script still pass today?
Yes — re-run directly against the current codebase, it scans 262 files and reports no violations, confirming the original fixes have held for close to two months.
What gap did the guard's own self-test find?
One rule searched for a specific comment to detect a fake processing delay, but the guard's own comment-stripping step had already removed that comment before the rule could see it — so reintroducing the delay without its comment slipped through undetected until the rule was rewritten to also check the actual delay pattern.
Does this guard run automatically on every commit or pull request?
No — direct inspection of the repository found no CI workflow or `package.json` script invoking it. It exists today as a standalone script someone runs directly, not an automatic gate.
Does the guard flag every use of Math.random() as a violation?
No — it specifically targets randomness feeding a score, pass/fail decision, or count presented as a measurement, with a short, individually-documented allowlist for legitimate uses like generating an identifier.
What does Centriu Axiom cost?
It is sold by subscription with a published starting price — exact current values are on the central pricing page.
See how Centriu Axiom guards against fabricated results reappearing
Reach our commercial team directly, or leave your details below — we'll follow up with guidance for your case.