Public report of archie0732/healthy-diet-ai-agent, published 17 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 17 November 2026, 08:06 UTC · Survey ID cd_3de9af56c8df40918dbfb27d424c94f0
archie0732/healthy-diet-ai-agent
Measured 17 November 2026, 08:05 UTC, at code version f9573be
Knowledge freshness is not measured: History too condensed to judge knowledge freshness.
CAI scoreAt risk
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A medium codebase: 57,260 lines of product code in 11 projects, tests not counted · Estimated rebuild effort: about 0.4 person-years · Weakest lens: Production Readiness, 29.0
Findings by how serious they are
56 critical559 serious142 minor
12 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 08:05 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
74of 74 dimensions measured by tools.
726of 757 findings point to an exact file and line, so you can open each one in the code. The other 31 concern the repository as a whole, such as missing documentation.
74dimensions across 8 lenses, read from 57,260 lines of product code in 11 projects.
archie0732/healthy-diet-ai-agent is rated At risk because critical security findings are open. Its score is held back in part because we found no automated security scanning of the code, its secrets or its dependencies. It scores 40.5 out of 100, which the At risk rating leaves unchanged.
Production Readiness, at 29.0, is the weakest lens and counts most in the score. The best first steps are adding automated security scanning and adding a test runner and linting to the front end's build, each worth about 4.5 points. Raising Production Readiness to 70 would lift the score to about 49.9.
Twenty known security holes in the packages the code depends on can be used by attackers. Six pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with, and five weaknesses in the code could be used by an attacker. Updating the vulnerable packages, pinning each tool to an exact version and fixing the weaknesses the scanner points to would close these risks. Limiting each secret to its own step would fix the four secrets exposed to more of the pipeline than needed, and the four unsafe settings in infrastructure or container files need changing to safe values. The three pages that don't say their language need their language set.
The product code is 57,260 lines, about €55,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Production Readiness rose from 29.0 to 70, the lowest score rated Strong, the score would rise from 40.5 to about 49.9.
Code composition: what the lines of code are
Product code 88%Tests 12%
Rebuild cost: about €55,000 · Estimate
Cost to rebuild
€18,000 to €92,000, for 305 to 968 hours of work, about 0.4 person-years for one engineer
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 40. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Medium: 57,260 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing.
Add a test runner (vitest / jest / playwright) and eslint and `tsc --noEmit` as REDACTED scripts and run them in CI.
Raises the score by about 4.5 points · Medium effort · Tooling
3
Act on each finding's own remediation rather than one rule: the move depends on what recurs.
Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
Raises the score by about 3.4 points · Medium effort · Code Duplication
Diagnosis: what the measurements show together
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €55,000 to build again, about 0.4 person-years of work. Its weakest lens is Production Readiness, at 29.0 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing. Of all the actions in this report, it raises the score most for the work it takes: about 4.5 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.5 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 4% to 9% on every change. The history of the code shows how much it changes: about 162,062 lines over the last 90 days, which is about 657,251 lines a year. At that pace, the extra work comes to an estimated 63.1 to 378.7 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
133 modules, with 81 dependencies between them. Every module uses only modules listed above it, so there are no loops.
The table shows the 40 modules with the most connections; 93 more are left out to keep it readable.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
1 pair of types, where a type in experiments.version_aware_rag.scripts.run_retrieval_eval uses a type in experiments.version_aware_rag.scripts.build_chunk_pairs.
experiments.version_aware_rag.scripts.run_retrieval_eval uses experiments.version_aware_rag.scripts.build_chunk_pairs, so a change to experiments.version_aware_rag.scripts.build_chunk_pairs can break experiments.version_aware_rag.scripts.run_retrieval_eval, while a change to experiments.version_aware_rag.scripts.run_retrieval_eval can't break experiments.version_aware_rag.scripts.build_chunk_pairs.
Position
Below the diagonal: experiments.version_aware_rag.scripts.run_retrieval_eval uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in experiments.version_aware_rag.scripts.v4.run_v4_policy_repair uses a type in experiments.version_aware_rag.src.diagnostics.diagnostic_types.
experiments.version_aware_rag.scripts.v4.run_v4_policy_repair uses experiments.version_aware_rag.src.diagnostics.diagnostic_types, so a change to experiments.version_aware_rag.src.diagnostics.diagnostic_types can break experiments.version_aware_rag.scripts.v4.run_v4_policy_repair, while a change to experiments.version_aware_rag.scripts.v4.run_v4_policy_repair can't break experiments.version_aware_rag.src.diagnostics.diagnostic_types.
Position
Below the diagonal: experiments.version_aware_rag.scripts.v4.run_v4_policy_repair uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in experiments.version_aware_rag.scripts.v5 uses a type in experiments.version_aware_rag.src.retrieval.relation_aware_pair_policy.
experiments.version_aware_rag.scripts.v5 uses experiments.version_aware_rag.src.retrieval.relation_aware_pair_policy, so a change to experiments.version_aware_rag.src.retrieval.relation_aware_pair_policy can break experiments.version_aware_rag.scripts.v5, while a change to experiments.version_aware_rag.scripts.v5 can't break experiments.version_aware_rag.src.retrieval.relation_aware_pair_policy.
Position
Below the diagonal: experiments.version_aware_rag.scripts.v5 uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in experiments.version_aware_rag.scripts.v6 uses a type in experiments.version_aware_rag.scripts.v6.allocate_v6_query_slots.
experiments.version_aware_rag.scripts.v6 uses experiments.version_aware_rag.scripts.v6.allocate_v6_query_slots, so a change to experiments.version_aware_rag.scripts.v6.allocate_v6_query_slots can break experiments.version_aware_rag.scripts.v6, while a change to experiments.version_aware_rag.scripts.v6 can't break experiments.version_aware_rag.scripts.v6.allocate_v6_query_slots.
Position
Below the diagonal: experiments.version_aware_rag.scripts.v6 uses a module listed above it, which is the healthy direction.
experiments.version_aware_rag.scripts.v6 uses experiments.version_aware_rag.scripts.v6.v6_retrieval_core, so a change to experiments.version_aware_rag.scripts.v6.v6_retrieval_core can break experiments.version_aware_rag.scripts.v6, while a change to experiments.version_aware_rag.scripts.v6 can't break experiments.version_aware_rag.scripts.v6.v6_retrieval_core.
Position
Below the diagonal: experiments.version_aware_rag.scripts.v6 uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in experiments.version_aware_rag.src.annotation uses a type in experiments.version_aware_rag.src.annotation.validate_r2_11_development.
experiments.version_aware_rag.src.annotation uses experiments.version_aware_rag.src.annotation.validate_r2_11_development, so a change to experiments.version_aware_rag.src.annotation.validate_r2_11_development can break experiments.version_aware_rag.src.annotation, while a change to experiments.version_aware_rag.src.annotation can't break experiments.version_aware_rag.src.annotation.validate_r2_11_development.
Position
Below the diagonal: experiments.version_aware_rag.src.annotation uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in experiments.version_aware_rag.src.annotation uses a type in experiments.version_aware_rag.src.annotation.validate_r2_12_confirmation.
experiments.version_aware_rag.src.annotation uses experiments.version_aware_rag.src.annotation.validate_r2_12_confirmation, so a change to experiments.version_aware_rag.src.annotation.validate_r2_12_confirmation can break experiments.version_aware_rag.src.annotation, while a change to experiments.version_aware_rag.src.annotation can't break experiments.version_aware_rag.src.annotation.validate_r2_12_confirmation.
Position
Below the diagonal: experiments.version_aware_rag.src.annotation uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in experiments.version_aware_rag.src.annotation uses a type in experiments.version_aware_rag.src.annotation.validate_r2_14_confirmation.
experiments.version_aware_rag.src.annotation uses experiments.version_aware_rag.src.annotation.validate_r2_14_confirmation, so a change to experiments.version_aware_rag.src.annotation.validate_r2_14_confirmation can break experiments.version_aware_rag.src.annotation, while a change to experiments.version_aware_rag.src.annotation can't break experiments.version_aware_rag.src.annotation.validate_r2_14_confirmation.
Position
Below the diagonal: experiments.version_aware_rag.src.annotation uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in experiments.version_aware_rag.src.annotation uses a type in experiments.version_aware_rag.src.annotation.validate_r2_16_confirmation.
experiments.version_aware_rag.src.annotation uses experiments.version_aware_rag.src.annotation.validate_r2_16_confirmation, so a change to experiments.version_aware_rag.src.annotation.validate_r2_16_confirmation can break experiments.version_aware_rag.src.annotation, while a change to experiments.version_aware_rag.src.annotation can't break experiments.version_aware_rag.src.annotation.validate_r2_16_confirmation.
Position
Below the diagonal: experiments.version_aware_rag.src.annotation uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in experiments.version_aware_rag.src.evaluation uses a type in experiments.version_aware_rag.scripts.v3.compute_agreement.
experiments.version_aware_rag.src.evaluation uses experiments.version_aware_rag.scripts.v3.compute_agreement, so a change to experiments.version_aware_rag.scripts.v3.compute_agreement can break experiments.version_aware_rag.src.evaluation, while a change to experiments.version_aware_rag.src.evaluation can't break experiments.version_aware_rag.scripts.v3.compute_agreement.
Position
Below the diagonal: experiments.version_aware_rag.src.evaluation uses a module listed above it, which is the healthy direction.
experiments.version_aware_rag.src.evaluation uses experiments.version_aware_rag.src.retrieval.types, so a change to experiments.version_aware_rag.src.retrieval.types can break experiments.version_aware_rag.src.evaluation, while a change to experiments.version_aware_rag.src.evaluation can't break experiments.version_aware_rag.src.retrieval.types.
Position
Below the diagonal: experiments.version_aware_rag.src.evaluation uses a module listed above it, which is the healthy direction.
experiments.version_aware_rag.src.retrieval.bm25 uses experiments.version_aware_rag.src.retrieval.types, so a change to experiments.version_aware_rag.src.retrieval.types can break experiments.version_aware_rag.src.retrieval.bm25, while a change to experiments.version_aware_rag.src.retrieval.bm25 can't break experiments.version_aware_rag.src.retrieval.types.
Position
Below the diagonal: experiments.version_aware_rag.src.retrieval.bm25 uses a module listed above it, which is the healthy direction.
experiments.version_aware_rag.src.retrieval.dense uses experiments.version_aware_rag.src.retrieval.types, so a change to experiments.version_aware_rag.src.retrieval.types can break experiments.version_aware_rag.src.retrieval.dense, while a change to experiments.version_aware_rag.src.retrieval.dense can't break experiments.version_aware_rag.src.retrieval.types.
Position
Below the diagonal: experiments.version_aware_rag.src.retrieval.dense uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in experiments.version_aware_rag.src.versioning.detectors.types uses a type in experiments.version_aware_rag.src.versioning.types.
experiments.version_aware_rag.src.versioning.detectors.types uses experiments.version_aware_rag.src.versioning.types, so a change to experiments.version_aware_rag.src.versioning.types can break experiments.version_aware_rag.src.versioning.detectors.types, while a change to experiments.version_aware_rag.src.versioning.detectors.types can't break experiments.version_aware_rag.src.versioning.types.
Position
Below the diagonal: experiments.version_aware_rag.src.versioning.detectors.types uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in experiments.version_aware_rag.src.versioning.relation_graph uses a type in experiments.version_aware_rag.src.versioning.types.
experiments.version_aware_rag.src.versioning.relation_graph uses experiments.version_aware_rag.src.versioning.types, so a change to experiments.version_aware_rag.src.versioning.types can break experiments.version_aware_rag.src.versioning.relation_graph, while a change to experiments.version_aware_rag.src.versioning.relation_graph can't break experiments.version_aware_rag.src.versioning.types.
Position
Below the diagonal: experiments.version_aware_rag.src.versioning.relation_graph uses a module listed above it, which is the healthy direction.
healthy_diet_api_server.api.login uses healthy_diet_api_server.model, so a change to healthy_diet_api_server.model can break healthy_diet_api_server.api.login, while a change to healthy_diet_api_server.api.login can't break healthy_diet_api_server.model.
Position
Below the diagonal: healthy_diet_api_server.api.login uses a module listed above it, which is the healthy direction.
src.storage.types uses src.server.httpRuntime, so a change to src.server.httpRuntime can break src.storage.types, while a change to src.storage.types can't break src.server.httpRuntime.
Position
Below the diagonal: src.storage.types uses a module listed above it, which is the healthy direction.
experiments.version_aware_rag.scripts uses experiments.version_aware_rag.scripts.apply_policy, so a change to experiments.version_aware_rag.scripts.apply_policy can break experiments.version_aware_rag.scripts, while a change to experiments.version_aware_rag.scripts can't break experiments.version_aware_rag.scripts.apply_policy.
Position
Below the diagonal: experiments.version_aware_rag.scripts uses a module listed above it, which is the healthy direction.
experiments.version_aware_rag.scripts uses experiments.version_aware_rag.scripts.build_chunk_pairs, so a change to experiments.version_aware_rag.scripts.build_chunk_pairs can break experiments.version_aware_rag.scripts, while a change to experiments.version_aware_rag.scripts can't break experiments.version_aware_rag.scripts.build_chunk_pairs.
Position
Below the diagonal: experiments.version_aware_rag.scripts uses a module listed above it, which is the healthy direction.
experiments.version_aware_rag.scripts uses experiments.version_aware_rag.scripts.run_retrieval_eval, so a change to experiments.version_aware_rag.scripts.run_retrieval_eval can break experiments.version_aware_rag.scripts, while a change to experiments.version_aware_rag.scripts can't break experiments.version_aware_rag.scripts.run_retrieval_eval.
Position
Below the diagonal: experiments.version_aware_rag.scripts uses a module listed above it, which is the healthy direction.
experiments.version_aware_rag.scripts.v3 uses experiments.version_aware_rag.scripts.v3.compute_agreement, so a change to experiments.version_aware_rag.scripts.v3.compute_agreement can break experiments.version_aware_rag.scripts.v3, while a change to experiments.version_aware_rag.scripts.v3 can't break experiments.version_aware_rag.scripts.v3.compute_agreement.
Position
Below the diagonal: experiments.version_aware_rag.scripts.v3 uses a module listed above it, which is the healthy direction.
experiments.version_aware_rag.scripts.v3 uses experiments.version_aware_rag.src.retrieval.bm25, so a change to experiments.version_aware_rag.src.retrieval.bm25 can break experiments.version_aware_rag.scripts.v3, while a change to experiments.version_aware_rag.scripts.v3 can't break experiments.version_aware_rag.src.retrieval.bm25.
Position
Below the diagonal: experiments.version_aware_rag.scripts.v3 uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in experiments.version_aware_rag.scripts.v4 uses a type in experiments.version_aware_rag.scripts.v4.audit_v4_candidate_coverage.
experiments.version_aware_rag.scripts.v4 uses experiments.version_aware_rag.scripts.v4.audit_v4_candidate_coverage, so a change to experiments.version_aware_rag.scripts.v4.audit_v4_candidate_coverage can break experiments.version_aware_rag.scripts.v4, while a change to experiments.version_aware_rag.scripts.v4 can't break experiments.version_aware_rag.scripts.v4.audit_v4_candidate_coverage.
Position
Below the diagonal: experiments.version_aware_rag.scripts.v4 uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in experiments.version_aware_rag.scripts.v4 uses a type in experiments.version_aware_rag.scripts.v4.run_v4_policy_repair.
experiments.version_aware_rag.scripts.v4 uses experiments.version_aware_rag.scripts.v4.run_v4_policy_repair, so a change to experiments.version_aware_rag.scripts.v4.run_v4_policy_repair can break experiments.version_aware_rag.scripts.v4, while a change to experiments.version_aware_rag.scripts.v4 can't break experiments.version_aware_rag.scripts.v4.run_v4_policy_repair.
Position
Below the diagonal: experiments.version_aware_rag.scripts.v4 uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in experiments.version_aware_rag.src.retrieval uses a type in experiments.version_aware_rag.src.diagnostics.diagnostic_types.
experiments.version_aware_rag.src.retrieval uses experiments.version_aware_rag.src.diagnostics.diagnostic_types, so a change to experiments.version_aware_rag.src.diagnostics.diagnostic_types can break experiments.version_aware_rag.src.retrieval, while a change to experiments.version_aware_rag.src.retrieval can't break experiments.version_aware_rag.src.diagnostics.diagnostic_types.
Position
Below the diagonal: experiments.version_aware_rag.src.retrieval uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in experiments.version_aware_rag.src.retrieval uses a type in experiments.version_aware_rag.src.retrieval.relation_aware_pair_policy.
experiments.version_aware_rag.src.retrieval uses experiments.version_aware_rag.src.retrieval.relation_aware_pair_policy, so a change to experiments.version_aware_rag.src.retrieval.relation_aware_pair_policy can break experiments.version_aware_rag.src.retrieval, while a change to experiments.version_aware_rag.src.retrieval can't break experiments.version_aware_rag.src.retrieval.relation_aware_pair_policy.
Position
Below the diagonal: experiments.version_aware_rag.src.retrieval uses a module listed above it, which is the healthy direction.
experiments.version_aware_rag.src.retrieval uses experiments.version_aware_rag.src.retrieval.types, so a change to experiments.version_aware_rag.src.retrieval.types can break experiments.version_aware_rag.src.retrieval, while a change to experiments.version_aware_rag.src.retrieval can't break experiments.version_aware_rag.src.retrieval.types.
Position
Below the diagonal: experiments.version_aware_rag.src.retrieval uses a module listed above it, which is the healthy direction.
experiments.version_aware_rag.src.retrieval uses experiments.version_aware_rag.src.retrieval.dense, so a change to experiments.version_aware_rag.src.retrieval.dense can break experiments.version_aware_rag.src.retrieval, while a change to experiments.version_aware_rag.src.retrieval can't break experiments.version_aware_rag.src.retrieval.dense.
Position
Below the diagonal: experiments.version_aware_rag.src.retrieval uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in experiments.version_aware_rag.src.retrieval uses a type in experiments.version_aware_rag.src.versioning.relation_graph.
experiments.version_aware_rag.src.retrieval uses experiments.version_aware_rag.src.versioning.relation_graph, so a change to experiments.version_aware_rag.src.versioning.relation_graph can break experiments.version_aware_rag.src.retrieval, while a change to experiments.version_aware_rag.src.retrieval can't break experiments.version_aware_rag.src.versioning.relation_graph.
Position
Below the diagonal: experiments.version_aware_rag.src.retrieval uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in experiments.version_aware_rag.src.retrieval.version_aware uses a type in experiments.version_aware_rag.src.diagnostics.diagnostic_types.
experiments.version_aware_rag.src.retrieval.version_aware uses experiments.version_aware_rag.src.diagnostics.diagnostic_types, so a change to experiments.version_aware_rag.src.diagnostics.diagnostic_types can break experiments.version_aware_rag.src.retrieval.version_aware, while a change to experiments.version_aware_rag.src.retrieval.version_aware can't break experiments.version_aware_rag.src.diagnostics.diagnostic_types.
Position
Below the diagonal: experiments.version_aware_rag.src.retrieval.version_aware uses a module listed above it, which is the healthy direction.
4 pairs of types, where a type in experiments.version_aware_rag.src.retrieval.version_aware uses a type in experiments.version_aware_rag.src.retrieval.types.
experiments.version_aware_rag.src.retrieval.version_aware uses experiments.version_aware_rag.src.retrieval.types, so a change to experiments.version_aware_rag.src.retrieval.types can break experiments.version_aware_rag.src.retrieval.version_aware, while a change to experiments.version_aware_rag.src.retrieval.version_aware can't break experiments.version_aware_rag.src.retrieval.types.
Position
Below the diagonal: experiments.version_aware_rag.src.retrieval.version_aware uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in experiments.version_aware_rag.src.retrieval.version_aware uses a type in experiments.version_aware_rag.src.versioning.relation_graph.
experiments.version_aware_rag.src.retrieval.version_aware uses experiments.version_aware_rag.src.versioning.relation_graph, so a change to experiments.version_aware_rag.src.versioning.relation_graph can break experiments.version_aware_rag.src.retrieval.version_aware, while a change to experiments.version_aware_rag.src.retrieval.version_aware can't break experiments.version_aware_rag.src.versioning.relation_graph.
Position
Below the diagonal: experiments.version_aware_rag.src.retrieval.version_aware uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in experiments.version_aware_rag.src.versioning.detectors.rule_baseline uses a type in experiments.version_aware_rag.src.versioning.detectors.types.
experiments.version_aware_rag.src.versioning.detectors.rule_baseline uses experiments.version_aware_rag.src.versioning.detectors.types, so a change to experiments.version_aware_rag.src.versioning.detectors.types can break experiments.version_aware_rag.src.versioning.detectors.rule_baseline, while a change to experiments.version_aware_rag.src.versioning.detectors.rule_baseline can't break experiments.version_aware_rag.src.versioning.detectors.types.
Position
Below the diagonal: experiments.version_aware_rag.src.versioning.detectors.rule_baseline uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in experiments.version_aware_rag.src.versioning.policy_engine uses a type in experiments.version_aware_rag.src.versioning.types.
experiments.version_aware_rag.src.versioning.policy_engine uses experiments.version_aware_rag.src.versioning.types, so a change to experiments.version_aware_rag.src.versioning.types can break experiments.version_aware_rag.src.versioning.policy_engine, while a change to experiments.version_aware_rag.src.versioning.policy_engine can't break experiments.version_aware_rag.src.versioning.types.
Position
Below the diagonal: experiments.version_aware_rag.src.versioning.policy_engine uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in experiments.version_aware_rag.src.versioning.policy_engine uses a type in experiments.version_aware_rag.src.versioning.detectors.types.
experiments.version_aware_rag.src.versioning.policy_engine uses experiments.version_aware_rag.src.versioning.detectors.types, so a change to experiments.version_aware_rag.src.versioning.detectors.types can break experiments.version_aware_rag.src.versioning.policy_engine, while a change to experiments.version_aware_rag.src.versioning.policy_engine can't break experiments.version_aware_rag.src.versioning.detectors.types.
Position
Below the diagonal: experiments.version_aware_rag.src.versioning.policy_engine uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in experiments.version_aware_rag.src.versioning.detectors.llm_detector uses a type in experiments.version_aware_rag.src.versioning.detectors.types.
experiments.version_aware_rag.src.versioning.detectors.llm_detector uses experiments.version_aware_rag.src.versioning.detectors.types, so a change to experiments.version_aware_rag.src.versioning.detectors.types can break experiments.version_aware_rag.src.versioning.detectors.llm_detector, while a change to experiments.version_aware_rag.src.versioning.detectors.llm_detector can't break experiments.version_aware_rag.src.versioning.detectors.types.
Position
Below the diagonal: experiments.version_aware_rag.src.versioning.detectors.llm_detector uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in experiments.version_aware_rag.src.versioning.detectors.llm_detector uses a type in experiments.version_aware_rag.src.versioning.detectors.rule_baseline.
experiments.version_aware_rag.src.versioning.detectors.llm_detector uses experiments.version_aware_rag.src.versioning.detectors.rule_baseline, so a change to experiments.version_aware_rag.src.versioning.detectors.rule_baseline can break experiments.version_aware_rag.src.versioning.detectors.llm_detector, while a change to experiments.version_aware_rag.src.versioning.detectors.llm_detector can't break experiments.version_aware_rag.src.versioning.detectors.rule_baseline.
Position
Below the diagonal: experiments.version_aware_rag.src.versioning.detectors.llm_detector uses a module listed above it, which is the healthy direction.
src.server uses src.server.httpRuntime, so a change to src.server.httpRuntime can break src.server, while a change to src.server can't break src.server.httpRuntime.
Position
Below the diagonal: src.server uses a module listed above it, which is the healthy direction.
src.server uses experiments.version_aware_rag.src.retrieval.version_aware, so a change to experiments.version_aware_rag.src.retrieval.version_aware can break src.server, while a change to src.server can't break experiments.version_aware_rag.src.retrieval.version_aware.
Position
Below the diagonal: src.server uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 38.4 · Weak · gated by D2, R10, X4 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A03:2025 — Software Supply Chain Failures
55
High / Critical
A05:2025 — Injection
38
High / Critical
A02:2025 — Security Misconfiguration
9
High / Critical
A07:2025 — Authentication Failures
4
High / Critical
Roadmap
Top priorities: Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing; Add a test runner (vitest / jest / playwright) and eslint and `tsc --noEmit` as REDACTED scripts and run them in CI; Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing.
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
Every finding carries one of four grades. Three say how serious it is. The fourth says this
survey could not settle it — and it is a grade, not a gap.
Critical — 56
A definite problem that already costs you something and drags the score down: a
missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here
tends to cause failures elsewhere.
Serious — 559
Likely wrong, but not failing yet. It degrades
the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to
carry for two years either.
Minor — 142
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 12
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 74 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked — 74 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 726 of 757 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: this repository's production source spans .rs, .ts, and our analyzer cannot run the .ts test suite(s) — so no coverage was collected for the repository as a whole. The Rust half did build and run, and its own line coverage came back at 8.2% — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.ts) and the reliability runner does support this ecosystem — it drives jest, vitest, mocha and egg-bin — but no REDACTED in this repository has a `scripts.test`, and none declares a runner the analyzer could start on its own, so it could not tell how this suite is run. Not scored — this is a gap in the analyzer's reading of how the suite is run, not a missing .ts runner and not a verdict that this repository runs no tests.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares REDACTED, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-contributor repository — bus factor is not applicable (1 contributor(s) across 94 commit(s) sampled, automation and bot accounts excluded). Concentration needs a team to concentrate: with one contributor there is nobody to spread the knowledge to, so there is nothing here for the owner to act on.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `agent_skills/conversation_summary_tool.ts` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
D34 Knowledge Freshness — git history too condensed for a reliable signal — The history looks squashed or freshly imported, so per-file ownership reflects those commits rather than real maintenance. This dimension is reported as a low-confidence advisory and is not scored.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (compose.yml). compose up failed (exit 14 — a file the compose project references is missing) — env file .env not found: stat .env: no such file or directory; runtime evidence skipped.
C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
C4 Data Retention — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
C5 Data-Subject Rights — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 324 further occurrence(s) are not listed individually; the score already reflects all 364.
R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 74 further occurrence(s) are not listed individually; the score already reflects all 114.
R4 Test Coverage — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 151 further occurrence(s) are not listed individually; the score already reflects all 191.
S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 47 further occurrence(s) are not listed individually; the score already reflects all 87.
X27 Collection changed while being enumerated — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X4 Structured logging — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 48 further occurrence(s) are not listed individually; the score already reflects all 88.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
72 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was adapter.createSupabaseStorage at 93. A further 1 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being modelRouting.isRetryableGoogleFailure at 17 — they are counted neither in the figure above nor in this dimension's score. 1 file carries no cyclomatic complexity row at all for this reason — every one of its over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: src/server/modelRouting.ts (modelRouting.isRetryableGoogleFailure at 17). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 67 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 5 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with adapter.createSupabaseStorage (cyclomatic 93), run_v4_policy_repair.runV4PolicyRepairPipeline (cyclomatic 86), validate_annotations.validateAnnotations (cyclomatic 83). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 5 together lifts Cyclomatic Complexity from 4.5 to about 5.4/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 99 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 120 down to 120 or less in Cognitive Complexity — start with validate_annotations.validateAnnotations (cognitive 188). — Refactoring it lifts Cognitive Complexity from 2.0 to about 2.2/10.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.5 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 19 FunctionTooLong finding(s) in God Classes — start with adapter.ts (2), build_splits.ts, build_v4_candidate_pairs.ts. — One of this dimension's main actionable groups (19 warning-level).
Resolve the 11 FileTooLong finding(s) in God Classes — start with build_splits.ts, REDACTED, build_r2_11_remaining_annotations.ts. — One of this dimension's main actionable groups (11 warning-level).
Resolve the 2 MethodTooLong finding(s) in God Classes — start with version_aware.ts, llm_detector.ts. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
29 duplicated block group(s) detected. 1.6 % of the production lines (938 of 57,260) are in a reported copy. A further 16 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. Measured on part of this repository only: .ts (78% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.
Edited copy of a member (10 corresponding lines) · ×2experiments/version_aware_rag/scripts/v6/evaluate_v6_fresh_retrieval.py:90
Edited copy of a member (2 corresponding lines) · ×2experiments/version_aware_rag/scripts/v6/run_v6r_repair_diagnostic.py:32
+ 29 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 3 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with evaluate_v6_fresh_retrieval.py, build_v6_runtime_relation_graph.py, v6_retrieval_core.py. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 3 Duplicated block (15 lines × 2) finding(s) in Code Duplication — start with admin.rs (2), agent_content.rs. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 3 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with agent_content.rs, login.rs, rag_document.rs. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling0.2 / 10Critical✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
11 production modules (Cargo+source-import), 2 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations, and — for the source no manifest declares — its top-level source directories, with the imports between them as edges; 1 module(s) off the main sequence.
Circular dependency · ×2
Off the main sequence: src/config
What to do
Resolve the 2 Circular dependency finding(s) in Coupling. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
D10 · Test Quality10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.
12 outdated, 0 yanked direct Cargo dependencies. Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from REDACTED there.
Outdated: async-trait · ×12
✓ On the Gold path — maintain.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
REDACTED scan ran and found no leaked secrets. 1 detection(s) were excluded as holding no minted credential in material that runs: a name, reference or comparison rather than a value, a readable phrase or pattern, a value that declares itself fake, or development, test, example, mock or demo material.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 395 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares REDACTED, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Resolve the 3 Hotspot finding(s) in Churn × Complexity Hotspots — start with compatibility_expansion.ts, agentRuntime.ts, llm_detector.ts. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
0 deducted task-comment markers across 56718 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
1 of 1 documentation facets pass in full. 7 document(s) read across 2 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
Resolve the 17 redundant comment finding(s) in Comment Value — start with build_splits.ts (3), run_oracle_counterfactuals.ts (2), build_paper_tables.ts (2). — One of this dimension's main actionable groups (17 recommendation-level).
Detailed fixes: d24_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D26 · Project Cohesion3.3 / 10Weak✓ Tool-verified
What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.
1 of 3 build units (Cargo, Python, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesionREDACTED:1
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
29 % of calls cross a namespace and 3 % go through an interface, but 98 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
3 finding(s): 0 critical, 3 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 3 REDACTED finding(s) in Secrets (history) — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
38 finding(s): 0 critical, 15 high, 23 medium, 0 low. 6 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 3 file(s) — `agent_skills/conversation_summary_tool.ts` (line 239), `experiments/version_aware_rag/data/models/v5_r2_19_minilm/cache/Xenova/all-MiniLM-L6-v2/751bff37182d3f1213fa05d7196b954e230abad9/tokenizer.json`, `experiments/version_aware_rag/data/sources_v5/who/WHO_TRS_916_2003.legacy-404-error.html` — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 3 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4), REDACTED. — One of this dimension's main actionable groups (5 issue-level).
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
No action in Static Analysis (SAST) — all 6 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (6 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 19 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (8), REDACTED (5), REDACTED (4). — One of this dimension's main actionable groups (19 issue-level).
Resolve the 14 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (9), REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (14 warning-level).
Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 4 High IaC finding(s) in IaC & Container Security — start with REDACTED (4). — One of this dimension's main actionable groups (4 issue-level).
Resolve the 4 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (4). — One of this dimension's main actionable groups (4 warning-level).
Resolve the 1 Low IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 1 Change coupling finding(s) in Change Coupling — start with db_tools.ts. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 19 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives10.0 / 10Exemplary○ Nothing flagged
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
Do you agree with this assessment?
AC2 · Forms & labels7.9 / 10Strong✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label. — experiments/version_aware_rag/data/sources_v5/who/WHO_TRS_916_2003.legacy-404-error.html:256
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Do you agree with this assessment?
AC3 · Page structure4.1 / 10Weak✓ Tool-verified
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). (×3) — experiments/version_aware_rag/data/sources_v4/who/who_trs_916_2003.download-error.html:1, REDACTED:5, experiments/version_aware_rag/data/sources_v5/who/WHO_TRS_916_2003.iris-shell-error.html:1
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×2) — REDACTED:5, experiments/version_aware_rag/data/sources_v5/who/WHO_TRS_916_2003.legacy-404-error.html:2
Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. — REDACTED:12
With more than one navigation landmark, each needs an aria-label/aria-labelledby (e.g. "Primary", "Footer") so assistive tech can tell them apart. At least one nav here is unlabelled. — experiments/version_aware_rag/data/sources_v5/who/WHO_TRS_916_2003.legacy-404-error.html:2
A timed meta-refresh moves users with no control or warning. Use a server redirect or a user-triggered action instead. — experiments/version_aware_rag/data/sources_v5/who/WHO_TRS_916_2003.legacy-404-error.html:1859
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.
Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
<a> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator. — experiments/version_aware_rag/data/sources_v5/who/WHO_TRS_916_2003.legacy-404-error.html:256
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
The projects experiments → src/shared → experiments form a reference cycle. Cyclic dependencies prevent independent build/test/deploy, blur ownership, and tend to grow into a big ball of mud. Break the cycle by extracting the shared types into a separate project both can reference.
The projects agent_skills → src/server → agent_skills (one cycle inside a mutually-dependent group of 3 projects) form a reference cycle. Cyclic dependencies prevent independent build/test/deploy, blur ownership, and tend to grow into a big ball of mud. Break the cycle by extracting the shared types into a separate project both can reference.
What to do
Break project reference cycles by extracting shared abstractions into a separate project; keep the graph a DAG.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.
`AppStorage` declares 17 required operations: `ensureReady`, `insertChatHistory`, `updateChatHistoryReply`, `upsertChatRoom`, `getChatRoomSummary`, `getUserProfile`, `updateUserProfile`, `getChatHistory`, `listKnowledgeDocuments`, `getKnowledgeDocument`, `findKnowledgeDocumentByHash`, `createKnowledgeDocument`, `updateKnowledgeDocument`, `deleteKnowledgeDocument`, `createKnowledgeIngestionJob`, `updateKnowledgeIngestionJob`, `getKnowledgeIngestionJob`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — src/storage/types.ts:107
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Other · Event-Driven — Whether event/message handlers avoid synchronous blocking waits — a blocking wait inside a handler stalls throughput and risks deadlock.
Method: Roslyn semantic scan (event-driven gated): event-handler bodies scanned for HTTP/gRPC invocations by resolved symbol type, not substring. Deterministic, semantic-resolved.
`diet.yolo_handler` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — services/api/src/api/diet.rs:114
`diet.yolo_handler` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::write`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — services/api/src/api/diet.rs:115
`diet.yolo_handler` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — services/api/src/api/diet.rs:358
`src.main` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — services/api/src/main.rs:47
`test.setup_db` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`. — services/api/src/utils/test.rs:20
What to do
Use the awaited twin of each blocking call, or move the work off the loop with `tokio::task::spawn_blocking` — a synchronous handler cannot simply `.await` in place.
Other · Code Health — Unreviewed-generation residue in this repository's JavaScript/TypeScript: functions whose whole body still throws a "not implemented" error, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings and JSX of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.
Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.
Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's JavaScript/TypeScript: functions that only throw a "not implemented" error, functions that take inputs and return a constant or do nothing, async functions that never await, dead `if (false)` branches, and skeleton classes most of whose methods are holes.
Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.
`classifyConflictRelation` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — experiments/version_aware_rag/scripts/classify_conflicts.ts:21
What to do
Remove the dead code that looks live: delete dead if(false) branches, which read as logic that runs, and either do the real async work or drop the async keyword from fake-async functions, which promise work they never wait for.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability5.8 / 10Adequate✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 1/4 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `.`, `services/yolo`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
No static application security testing detected. For this repository's stack, add CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security as a CI step. What was searched, so you can tell an absence from a miss: the 1 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
`REDACTED` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — REDACTED:9
What to do
Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×15) — experiments/version_aware_rag/scripts/v4/draft_v4_devval_queries.ts:125, experiments/version_aware_rag/scripts/v4/run_v4_frozen_answer_generation.ts:15, experiments/version_aware_rag/scripts/v4/run_v4_posttest_predicted_graph.ts:15, …
`Client::new()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×5) — services/api/src/api/agent_approve.rs:20, services/api/src/api/agent_content.rs:81, services/api/src/api/rag_document.rs:119, …
`reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — services/api/src/api/diet.rs:296
What to do
Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`fs.existsSync` in `callback to tool` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×5) — REDACTED:385, REDACTED:411, agent_skills/read_workspace_code.ts:16, …
`fs.readFileSync` in `callback to tool` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — REDACTED:388, REDACTED:411, agent_skills/read_workspace_code.ts:25
`fs.writeFileSync` in `callback to tool` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — REDACTED:409, REDACTED:413
`fs.readFileSync` in `parseSplitQueries` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:40, experiments/version_aware_rag/scripts/diagnostics/run_oracle_counterfactuals.ts:50, experiments/version_aware_rag/scripts/diagnostics/trace_oracle_retrieval.ts:54
`fs.readFileSync` in `compareRecencyAndOracle` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×5) — experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:52, experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:54, experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:61, …
`fs.existsSync` in `compareRecencyAndOracle` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:202
`fs.mkdirSync` in `compareRecencyAndOracle` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:203
`fs.writeFileSync` in `compareRecencyAndOracle` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:206, experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:207, experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:208
`fs.readFileSync` in `runOracleCounterfactuals` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — experiments/version_aware_rag/scripts/diagnostics/run_oracle_counterfactuals.ts:36, experiments/version_aware_rag/scripts/diagnostics/run_oracle_counterfactuals.ts:38, experiments/version_aware_rag/scripts/diagnostics/run_oracle_counterfactuals.ts:44
`fs.existsSync` in `runOracleCounterfactuals` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — experiments/version_aware_rag/scripts/diagnostics/run_oracle_counterfactuals.ts:254
`fs.mkdirSync` in `runOracleCounterfactuals` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — experiments/version_aware_rag/scripts/diagnostics/run_oracle_counterfactuals.ts:255
`fs.writeFileSync` in `runOracleCounterfactuals` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — experiments/version_aware_rag/scripts/diagnostics/run_oracle_counterfactuals.ts:258, experiments/version_aware_rag/scripts/diagnostics/run_oracle_counterfactuals.ts:259
`fs.readFileSync` in `traceOracleRetrieval` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — experiments/version_aware_rag/scripts/diagnostics/trace_oracle_retrieval.ts:40, experiments/version_aware_rag/scripts/diagnostics/trace_oracle_retrieval.ts:42, experiments/version_aware_rag/scripts/diagnostics/trace_oracle_retrieval.ts:48
`fs.readFileSync` in `traceTestSplitPosthoc` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — experiments/version_aware_rag/scripts/diagnostics/trace_oracle_retrieval.ts:212
`fs.existsSync` in `traceOracleRetrieval` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — experiments/version_aware_rag/scripts/diagnostics/trace_oracle_retrieval.ts:265
`fs.mkdirSync` in `traceOracleRetrieval` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — experiments/version_aware_rag/scripts/diagnostics/trace_oracle_retrieval.ts:266
`fs.writeFileSync` in `traceOracleRetrieval` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — experiments/version_aware_rag/scripts/diagnostics/trace_oracle_retrieval.ts:269, experiments/version_aware_rag/scripts/diagnostics/trace_oracle_retrieval.ts:270, experiments/version_aware_rag/scripts/diagnostics/trace_oracle_retrieval.ts:271
What to do
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
Do you agree with this assessment?
R1 · Type Safety9.9 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.
34 duplicated blocks under experiments/version_aware_rag/scripts/ have copies in at least two of the sibling directories diagnostics, v3, v4, v5, v6 — 31 of them are reported below, and 3 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 34 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 34 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 34 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — experiments/version_aware_rag/scripts/v4/prepare_v4_devval_sources.ts:123
14 duplicated blocks under experiments/version_aware_rag/ have copies in at least two of the sibling directories scripts, src — 10 of them are reported below, and 4 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 14 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 14 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 14 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — experiments/version_aware_rag/scripts/run_retrieval_eval.ts:72
9 duplicated blocks under the repository root have copies in at least two of the sibling directories agent_skills, experiments, scripts, src — 7 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 9 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 9 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 9 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — agent_skills/conversation_summary_tool.ts:23
experiments/version_aware_rag/scripts/v5/run_r2_14_confirmation.ts:1 · experiments/version_aware_rag/scripts/v5/run_r2_16_confirmation.ts:1 — these 2 files are line-for-line copies of one another — 279 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — experiments/version_aware_rag/scripts/v5/run_r2_14_confirmation.ts:1
experiments/version_aware_rag/scripts/v5/run_r2_19_neural_hybrid_diagnostic.ts:39 · experiments/version_aware_rag/scripts/v5/run_r2_20_neural_hybrid_confirmation.ts:41 — the two spans are one implementation copied and then locally edited — 1572 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — experiments/version_aware_rag/scripts/v5/run_r2_19_neural_hybrid_diagnostic.ts:39
experiments/version_aware_rag/scripts/v5/freeze_r2_14_confirmation.ts:1 · experiments/version_aware_rag/scripts/v5/freeze_r2_16_confirmation.ts:1 — these 2 files are line-for-line copies of one another — 173 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — experiments/version_aware_rag/scripts/v5/freeze_r2_14_confirmation.ts:1
experiments/version_aware_rag/scripts/v5/mine_r2_16_candidate_groups.ts:41 · experiments/version_aware_rag/scripts/v5/mine_r2_20_candidate_groups.ts:130 — the two spans are one implementation copied and then locally edited — 1216 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — experiments/version_aware_rag/scripts/v5/mine_r2_16_candidate_groups.ts:41
experiments/version_aware_rag/scripts/v5/build_r2_16_confirmation_annotations.ts:1 · experiments/version_aware_rag/scripts/v5/build_r2_20_confirmation_annotations.ts:1 — these 2 files are line-for-line copies of one another — 164 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — experiments/version_aware_rag/scripts/v5/build_r2_16_confirmation_annotations.ts:1
experiments/version_aware_rag/src/annotation/validate_r2_14_confirmation.ts:7 · experiments/version_aware_rag/src/annotation/validate_r2_16_confirmation.ts:7 · experiments/version_aware_rag/src/annotation/validate_r2_20_confirmation.ts:7 — these 3 files are line-for-line copies of one another — 163 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — experiments/version_aware_rag/src/annotation/validate_r2_14_confirmation.ts:7
experiments/version_aware_rag/scripts/v5/run_r2_18_candidate_failure_attribution.ts:10 · experiments/version_aware_rag/scripts/v5/run_r2_19_neural_hybrid_diagnostic.ts:15 — the two spans are one implementation copied and then locally edited — 1544 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — experiments/version_aware_rag/scripts/v5/run_r2_18_candidate_failure_attribution.ts:10
experiments/version_aware_rag/src/annotation/validate_r2_12_confirmation.ts:91 · experiments/version_aware_rag/src/annotation/validate_r2_14_confirmation.ts:80 · experiments/version_aware_rag/src/annotation/validate_r2_16_confirmation.ts:80 · experiments/version_aware_rag/src/annotation/validate_r2_20_confirmation.ts:80 — the 4 copies are spread across 4 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — experiments/version_aware_rag/src/annotation/validate_r2_12_confirmation.ts:91
experiments/version_aware_rag/scripts/v5/mine_r2_14_candidate_groups.ts:1 · experiments/version_aware_rag/scripts/v5/mine_r2_16_candidate_groups.ts:1 — these 2 files are line-for-line copies of one another — 148 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — experiments/version_aware_rag/scripts/v5/mine_r2_14_candidate_groups.ts:1
experiments/version_aware_rag/scripts/v5/run_r2_18_candidate_failure_attribution.ts:30 · experiments/version_aware_rag/scripts/v5/run_r2_21_lexical_weighted_rrf_diagnostic.ts:33 — the two spans are one implementation copied and then locally edited — 1277 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — experiments/version_aware_rag/scripts/v5/run_r2_18_candidate_failure_attribution.ts:30
experiments/version_aware_rag/scripts/v5/run_r2_13_top3_diagnostic.ts:13 · experiments/version_aware_rag/scripts/v5/run_r2_15_compatible_selectivity_diagnostic.ts:21 — the two spans are one implementation copied and then locally edited — 908 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — experiments/version_aware_rag/scripts/v5/run_r2_13_top3_diagnostic.ts:13
experiments/version_aware_rag/scripts/v5/run_r2_8_shared_pool_development.ts:29 · experiments/version_aware_rag/scripts/v5/run_r2_9_retrieval_validation.ts:22 — the two spans are one implementation copied and then locally edited — 1527 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — experiments/version_aware_rag/scripts/v5/run_r2_8_shared_pool_development.ts:29
experiments/version_aware_rag/scripts/v5/run_r2_16_confirmation.ts:78 · experiments/version_aware_rag/scripts/v5/run_r2_20_neural_hybrid_confirmation.ts:101 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — experiments/version_aware_rag/scripts/v5/run_r2_16_confirmation.ts:78
experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts:387 · experiments/version_aware_rag/scripts/v5/build_r2_14_confirmation_annotations.ts:388 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts:387
experiments/version_aware_rag/scripts/v5/audit_r2_18_candidate_failure_attribution.ts:9 · experiments/version_aware_rag/scripts/v5/audit_r2_19_neural_hybrid_diagnostic.ts:12 — the two spans are one implementation copied and then locally edited — 570 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — experiments/version_aware_rag/scripts/v5/audit_r2_18_candidate_failure_attribution.ts:9
experiments/version_aware_rag/scripts/v5/audit_r2_14_confirmation.ts:39 · experiments/version_aware_rag/scripts/v5/audit_r2_15_compatible_selectivity_diagnostic.ts:23 — the two spans are one implementation copied and then locally edited — 450 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — experiments/version_aware_rag/scripts/v5/audit_r2_14_confirmation.ts:39
experiments/version_aware_rag/scripts/v5/run_r2_12_confirmation.ts:41 · experiments/version_aware_rag/scripts/v5/run_r2_14_confirmation.ts:40 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — experiments/version_aware_rag/scripts/v5/run_r2_12_confirmation.ts:41
experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts:514 · experiments/version_aware_rag/scripts/v5/build_r2_14_confirmation_annotations.ts:504 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts:514
experiments/version_aware_rag/scripts/v5/freeze_r2_13_top3_diagnostic.ts:33 · experiments/version_aware_rag/scripts/v5/freeze_r2_15_compatible_selectivity_diagnostic.ts:36 — the two spans are one implementation copied and then locally edited — 334 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — experiments/version_aware_rag/scripts/v5/freeze_r2_13_top3_diagnostic.ts:33
experiments/version_aware_rag/scripts/v5/run_r2_12_confirmation.ts:116 · experiments/version_aware_rag/scripts/v5/run_r2_14_confirmation.ts:129 · experiments/version_aware_rag/scripts/v5/run_r2_16_confirmation.ts:151 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — experiments/version_aware_rag/scripts/v5/run_r2_12_confirmation.ts:116
experiments/version_aware_rag/scripts/v5/freeze_r2_16_annotation_authoring_plan.ts:5 · experiments/version_aware_rag/scripts/v5/freeze_r2_20_annotation_authoring_plan.ts:5 — the two spans are one implementation copied and then locally edited — 477 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — experiments/version_aware_rag/scripts/v5/freeze_r2_16_annotation_authoring_plan.ts:5
experiments/version_aware_rag/scripts/v5/run_r2_action_detector_development.ts:78 · experiments/version_aware_rag/scripts/v5/run_v5_relation_detector_development.ts:45 — the two spans are one implementation copied and then locally edited — 704 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — experiments/version_aware_rag/scripts/v5/run_r2_action_detector_development.ts:78
experiments/version_aware_rag/scripts/v5/build_r2_7_preaudited_cross_version_split.ts:266 · experiments/version_aware_rag/scripts/v5/build_r2_9_retrieval_validation.ts:146 — the two spans are one implementation copied and then locally edited — 614 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — experiments/version_aware_rag/scripts/v5/build_r2_7_preaudited_cross_version_split.ts:266
experiments/version_aware_rag/scripts/v5/audit_r2_16_confirmation.ts:54 · experiments/version_aware_rag/scripts/v5/audit_r2_20_neural_hybrid_confirmation.ts:77 — the two spans are one implementation copied and then locally edited — 336 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — experiments/version_aware_rag/scripts/v5/audit_r2_16_confirmation.ts:54
REDACTED:94 · REDACTED:93 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:94
experiments/version_aware_rag/scripts/v5/audit_r2_12_confirmation.ts:17 · experiments/version_aware_rag/scripts/v5/audit_r2_14_confirmation.ts:38 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — experiments/version_aware_rag/scripts/v5/audit_r2_12_confirmation.ts:17
experiments/version_aware_rag/src/retrieval/bm25.ts:42 · experiments/version_aware_rag/src/retrieval/dense.ts:29 — the two spans are one implementation copied and then locally edited — 335 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — experiments/version_aware_rag/src/retrieval/bm25.ts:42
experiments/version_aware_rag/src/annotation/validate_r2_12_confirmation.ts:36 · experiments/version_aware_rag/src/annotation/validate_r2_14_confirmation.ts:32 · experiments/version_aware_rag/src/annotation/validate_r2_16_confirmation.ts:32 · experiments/version_aware_rag/src/annotation/validate_r2_20_confirmation.ts:32 — the 4 copies are spread across 4 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — experiments/version_aware_rag/src/annotation/validate_r2_12_confirmation.ts:36
experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts:603 · experiments/version_aware_rag/scripts/v5/build_r2_14_confirmation_annotations.ts:593 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts:603
experiments/version_aware_rag/scripts/v5/freeze_r2_12_confirmation.ts:119 · experiments/version_aware_rag/scripts/v5/freeze_r2_14_confirmation.ts:129 · experiments/version_aware_rag/scripts/v5/freeze_r2_16_confirmation.ts:130 — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — experiments/version_aware_rag/scripts/v5/freeze_r2_12_confirmation.ts:119
experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts:10 · experiments/version_aware_rag/scripts/v5/build_r2_14_confirmation_annotations.ts:10 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts:10
experiments/version_aware_rag/scripts/v5/prepare_r2_11_sources.ts:92 · experiments/version_aware_rag/scripts/v5/prepare_r2_19_sources.ts:109 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — experiments/version_aware_rag/scripts/v5/prepare_r2_11_sources.ts:92
experiments/version_aware_rag/scripts/apply_policy.ts:35 · experiments/version_aware_rag/scripts/classify_conflicts.ts:71 — the two spans are one implementation copied and then locally edited — 339 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — experiments/version_aware_rag/scripts/apply_policy.ts:35
experiments/version_aware_rag/scripts/v3/build_policy_graph.ts:24 · experiments/version_aware_rag/scripts/v3/classify_relations.ts:18 — the two spans are one implementation copied and then locally edited — 276 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — experiments/version_aware_rag/scripts/v3/build_policy_graph.ts:24
src/storage/supabase/adapter.ts:205 · src/storage/supabase/adapter.ts:261 — the two spans are one implementation copied and then locally edited — 387 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — src/storage/supabase/adapter.ts:205
experiments/version_aware_rag/scripts/v5/review_r2_16_candidate_groups.ts:59 · experiments/version_aware_rag/scripts/v5/review_r2_20_candidate_groups.ts:104 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — experiments/version_aware_rag/scripts/v5/review_r2_16_candidate_groups.ts:59
experiments/version_aware_rag/scripts/v4/prepare_v4_devval_sources.ts:123 · experiments/version_aware_rag/scripts/v5/prepare_r2_11_sources.ts:116 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — experiments/version_aware_rag/scripts/v4/prepare_v4_devval_sources.ts:123
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
retrieve has cyclomatic complexity 84 and cognitive complexity 133; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/src/retrieval/version_aware.ts:98
validateAnnotations has cyclomatic complexity 83 and cognitive complexity 188; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/src/annotation/validate_annotations.ts:16
runV4PolicyRepairPipeline has cyclomatic complexity 56 and cognitive complexity 97; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/scripts/v4/run_v4_policy_repair.ts:166
(anonymous) has cyclomatic complexity 47 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — agent_skills/db_tools.ts:396
buildSplits has cyclomatic complexity 45 and cognitive complexity 77; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/src/annotation/build_splits.ts:22
chatHandler has cyclomatic complexity 42 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:599
main has cyclomatic complexity 40 and cognitive complexity 67; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/scripts/v3/run_experiment.ts:58
attributeFailure has cyclomatic complexity 40 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/src/diagnostics/stage_attribution.ts:8
validateR212ConfirmationLedger has cyclomatic complexity 39 and cognitive complexity 69; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/src/annotation/validate_r2_12_confirmation.ts:44
validateR214ConfirmationLedger has cyclomatic complexity 39 and cognitive complexity 69; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/src/annotation/validate_r2_14_confirmation.ts:40
validateR216ConfirmationLedger has cyclomatic complexity 39 and cognitive complexity 69; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/src/annotation/validate_r2_16_confirmation.ts:40
validateR220ConfirmationLedger has cyclomatic complexity 39 and cognitive complexity 69; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/src/annotation/validate_r2_20_confirmation.ts:40
(anonymous) has cyclomatic complexity 39 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/server/imageStorage.ts:50
compareRecencyAndOracle has cyclomatic complexity 34 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:28
main has cyclomatic complexity 34 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/scripts/v3/import_and_adjudicate_answer_annotations.ts:76
validateR211DevelopmentLedger has cyclomatic complexity 29 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/src/annotation/validate_r2_11_development.ts:53
runOracleCounterfactuals has cyclomatic complexity 29 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/scripts/diagnostics/run_oracle_counterfactuals.ts:26
(anonymous) has cyclomatic complexity 29 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/scripts/diagnostics/trace_oracle_retrieval.ts:65
main has cyclomatic complexity 29 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/scripts/v3/build_paper_tables.ts:97
work has cyclomatic complexity 28 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/server/agentRuntime.ts:799
auditCorpus has cyclomatic complexity 28 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/src/corpus/audit_corpus.ts:48
buildOracleDiagnosisReport has cyclomatic complexity 28 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/scripts/diagnostics/build_oracle_diagnosis_report.ts:22
main has cyclomatic complexity 28 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/scripts/v3/classify_relations.ts:34
expandCompatibleChunks has cyclomatic complexity 26 and cognitive complexity 72; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/src/retrieval/compatibility_expansion.ts:4
buildChunksFromMarkdown has cyclomatic complexity 26 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/scripts/build_chunks.ts:18
computeClassificationMetrics has cyclomatic complexity 25 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/src/evaluation/classification_metrics.ts:23
(anonymous) has cyclomatic complexity 25 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/sync-mohw-clarifications.ts:233
logDietWithClient has cyclomatic complexity 25 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — agent_skills/db_tools.ts:112
classify has cyclomatic complexity 24 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/scripts/v5/run_r2_action_detector_development.ts:61
(anonymous) has cyclomatic complexity 23 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — agent_skills/fetch_web.ts:20
getLegacyChunkIds has cyclomatic complexity 23 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/src/corpus/build_corpus.ts:17
computeAutomaticCitationProxyMetrics has cyclomatic complexity 22 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/src/evaluation/answer_metrics.ts:102
classify has cyclomatic complexity 21 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/scripts/v5/run_v5_relation_detector_development.ts:30
(anonymous) has cyclomatic complexity 21 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/src/annotation/build_splits.ts:508
updateKnowledgeDocument has cyclomatic complexity 21 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/storage/supabase/adapter.ts:234
resolvePolicyState has cyclomatic complexity 20 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/src/versioning/relation_graph.ts:103
main has cyclomatic complexity 20 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — experiments/version_aware_rag/scripts/v4/build_v4_candidate_pairs.ts:66
getChatHistoryWithClient has cyclomatic complexity 20 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — agent_skills/db_tools.ts:233
(anonymous) has cyclomatic complexity 20 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/storage/supabase/adapter.ts:23
(anonymous) has cyclomatic complexity 20 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:315
Do you agree with this assessment?
R3 · Large Files7.1 / 10Strong✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
experiments/version_aware_rag/src/annotation/build_splits.ts has 1268 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — experiments/version_aware_rag/src/annotation/build_splits.ts:1
REDACTED has 942 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
experiments/version_aware_rag/scripts/v5/build_r2_11_remaining_annotations.ts has 893 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — experiments/version_aware_rag/scripts/v5/build_r2_11_remaining_annotations.ts:1
src/server/agentRuntime.ts has 828 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/server/agentRuntime.ts:1
REDACTED has 766 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
experiments/version_aware_rag/scripts/v4/run_v4_policy_repair.ts has 703 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — experiments/version_aware_rag/scripts/v4/run_v4_policy_repair.ts:1
experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts has 639 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts:1
experiments/version_aware_rag/scripts/v5/run_r2_11_development.ts has 631 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — experiments/version_aware_rag/scripts/v5/run_r2_11_development.ts:1
experiments/version_aware_rag/scripts/v5/build_r2_14_confirmation_annotations.ts has 627 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — experiments/version_aware_rag/scripts/v5/build_r2_14_confirmation_annotations.ts:1
REDACTED has 584 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
experiments/version_aware_rag/scripts/v4/build_v4_candidate_pairs.ts has 573 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — experiments/version_aware_rag/scripts/v4/build_v4_candidate_pairs.ts:1
experiments/version_aware_rag/scripts/v5/run_r2_20_neural_hybrid_confirmation.ts has 561 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — experiments/version_aware_rag/scripts/v5/run_r2_20_neural_hybrid_confirmation.ts:1
src/server/versionAwareRag.ts has 457 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/server/versionAwareRag.ts:1
agent_skills/db_tools.ts has 449 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — agent_skills/db_tools.ts:1
experiments/version_aware_rag/src/retrieval/version_aware.ts has 449 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — experiments/version_aware_rag/src/retrieval/version_aware.ts:1
experiments/version_aware_rag/scripts/v4/run_v4_dev_model_selection.ts has 447 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — experiments/version_aware_rag/scripts/v4/run_v4_dev_model_selection.ts:1
experiments/version_aware_rag/scripts/v5/run_r2_16_confirmation.ts has 433 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — experiments/version_aware_rag/scripts/v5/run_r2_16_confirmation.ts:1
src/storage/sqlite/adapter.ts has 430 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/storage/sqlite/adapter.ts:1
REDACTED has 414 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
experiments/version_aware_rag/scripts/v3/run_experiment.ts has 404 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — experiments/version_aware_rag/scripts/v3/run_experiment.ts:1
experiments/version_aware_rag/scripts/v5/run_r2_14_confirmation.ts has 404 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — experiments/version_aware_rag/scripts/v5/run_r2_14_confirmation.ts:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage3.1 / 10Weak✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×40) — experiments/version_aware_rag/src/annotation/build_splits.ts:1, experiments/version_aware_rag/scripts/v5/build_r2_11_remaining_annotations.ts:1, experiments/version_aware_rag/scripts/v5/run_r2_11_development.ts:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
Do you agree with this assessment?
R6 · Tooling0.0 / 10Critical✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each REDACTED script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: REDACTED scanned for test/lint/typecheck script wiring. Deterministic presence check.
test ✗ · lint ✗ · typecheck ✗ — read from this repository's REDACTED scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
What to do
Add a test runner (vitest / jest / playwright) and eslint and `tsc --noEmit` as REDACTED scripts and run them in CI.
Do you agree with this assessment?
R7 · Dead Code9.2 / 10Exemplary✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
359 file(s) (~56552 LoC) were excluded from dead-code analysis. This package's entry point(s) resolved, but the walk stopped one hop in: experiments/version_aware_rag/scripts/v3/run_heldout_pipeline.ts imports '../../../src/shared/hash', which is not in the scanned tree. That is usually a generated or build-output module, so reachability cannot see past it and no dead-code claim is made about this package. Nothing is necessarily wrong here.
Nothing imports this binding — it is safe to review for removal. (×9) — experiments/version_aware_rag/src/diagnostics/diagnostic_types.ts:26, experiments/version_aware_rag/src/evaluation/answer_metrics.ts:47, experiments/version_aware_rag/src/versioning/detectors/types.ts:11, …
Nothing ultimately consumes this binding: its only referrer is the re-export in src/storage/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/storage/index.ts in the same commit, or the barrel will import a name that no longer exists. — src/storage/runtime.ts:26
This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it. (×6) — agent_skills/db_tools.ts:28, experiments/version_aware_rag/scripts/v4/run_v4_dev_model_selection.ts:157, experiments/version_aware_rag/scripts/v5/run_v5_relation_detector_development.ts:24, …
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
Imported but not declared in any reachable REDACTED — installs work only by hoisting accident. — experiments/version_aware_rag/scripts/v3/run_experiment.ts:3
Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×4) — REDACTED:13, REDACTED:15, REDACTED:18, …
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 1/8 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`fetchHtml` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/server/mohwNews.ts:70
`callLLMApi` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. (×2) — experiments/version_aware_rag/src/versioning/detectors/llm_detector.ts:176, experiments/version_aware_rag/src/generation/answer_generator.ts:123
`classify` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. (×3) — experiments/version_aware_rag/scripts/v5/run_r2_action_detector_development.ts:61, experiments/version_aware_rag/scripts/v5/run_r2_action_detector_validation.ts:44, experiments/version_aware_rag/scripts/v5/run_v5_relation_detector_development.ts:30
`verifyGeminiModel` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — experiments/version_aware_rag/scripts/v4/verify_gemini_model.ts:9
What to do
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
`AgentChatRequest.message` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — services/api/src/api/chat.rs:18
`AgentChatRequest.user_context` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — services/api/src/api/chat.rs:22
`AgentChatRequest.image` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — services/api/src/api/chat.rs:23
`AgentChatRequest.model_source` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — services/api/src/api/chat.rs:24
`YoloScriptOutput.json_path` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — services/api/src/api/diet.rs:20
`AuthRequest.state` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — services/api/src/discord/login.rs:30
`GeminiResponse.candidates` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — services/api/src/utils/gemini.rs:20
`GeminiContentResponse.parts` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — services/api/src/utils/gemini.rs:30
`GeminiPartResponse.text` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — services/api/src/utils/gemini.rs:35
What to do
Each finding names the spans that disagree — the knob the caller supplies and the site that ignores it, whether by re-spelling its default, by falling back under the wrong key, by parsing with no format provider at all, or by printing under whatever culture the host supplies. Confirm from those spans, then decide which of the two the type meant: read the knob at the named site, or drop the knob so the signature stops advertising something the type cannot feel. Leaving both is the one option that cannot be right.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element7.5 / 10Strong✓ Tool-verified
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
This loop runs once per element of `sorted`, and the statement it guards acts on the element it is on — `item`. The test deciding whether that statement runs does not: `chosen.length >= topK` reads `sorted[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 107, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out. — experiments/version_aware_rag/src/retrieval/relation_aware_pair_policy.ts:121
What to do
Each finding names the test and the statement it guards, which index the same collection at two different subscripts — one fixed, one the loop variable. Confirm from the two, then decide which subscript the test meant. If it was meant to be per-element, give it the loop variable so each element is judged on itself. If it really is one answer for the whole collection, hoist the test OUT of the loop, where a reader can see it is asked once and where it is not re-evaluated on every pass — leaving it inside, reading a fixed element, is the one arrangement that cannot be right under either reading.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×10) — src/server/mohwNews.ts:88, experiments/version_aware_rag/src/versioning/detectors/cache.ts:51, experiments/version_aware_rag/scripts/v5/draft_v5_relation_second_opinion.ts:26, …
`catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included. — REDACTED:77
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `REDACTED` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
`info!` at line 59 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/main.rs:59
`error!` at line 177 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/utils/rag_worker.rs:177
`error!` at line 200 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/utils/rag_worker.rs:200
`error!` at line 226 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/utils/rag_worker.rs:226
`error!` at line 248 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/utils/rag_worker.rs:248
`warn!` at line 251 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/utils/rag_worker.rs:251
`warn!` at line 257 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/utils/rag_worker.rs:257
`info!` at line 294 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/utils/rag_worker.rs:294
`error!` at line 337 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/utils/rag_worker.rs:337
`error!` at line 384 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/utils/rag_worker.rs:384
`info!` at line 450 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/utils/rag_worker.rs:450
`error!` at line 470 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/utils/rag_worker.rs:470
`info!` at line 477 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/utils/rag_worker.rs:477
`error!` at line 73 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/utils/route_control.rs:73
`error!` at line 125 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/admin.rs:125
`error!` at line 150 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/admin.rs:150
`error!` at line 231 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/admin.rs:231
`warn!` at line 260 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/admin.rs:260
`error!` at line 290 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/admin.rs:290
`error!` at line 357 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/admin.rs:357
`error!` at line 386 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/admin.rs:386
`error!` at line 463 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/admin.rs:463
`error!` at line 497 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/admin.rs:497
`error!` at line 537 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/admin.rs:537
`error!` at line 566 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/admin.rs:566
`error!` at line 616 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/admin.rs:616
`error!` at line 643 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/admin.rs:643
`error!` at line 682 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/admin.rs:682
`error!` at line 29 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/agent_approve.rs:29
`error!` at line 43 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/agent_approve.rs:43
`error!` at line 65 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/agent_approve.rs:65
`error!` at line 38 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/agent_content.rs:38
`error!` at line 48 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/agent_content.rs:48
`error!` at line 99 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/agent_content.rs:99
`error!` at line 110 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/agent_content.rs:110
`error!` at line 120 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/agent_content.rs:120
`error!` at line 203 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/agent_content.rs:203
`error!` at line 31 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/announcement.rs:31
`error!` at line 165 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/chat.rs:165
`error!` at line 212 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — services/api/src/api/chat.rs:212
Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
~1.8 `!` null assertions per 1k TypeScript source lines — 83 assertion(s) across the 46399 source line(s) of the 266 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: src/server/versionAwareRag.ts (11), experiments/version_aware_rag/scripts/v4/run_v4_policy_repair.ts (10), experiments/version_aware_rag/scripts/v4/run_v4_dev_model_selection.ts (6). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
What to do
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 13 of 55 WCAG 2.2 Level A/AA success criteria (24%; ≈26% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 42 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 3 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
P12 CI test-gate honesty — 1 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 49 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
AX1 Captive dependencies — Not applicable: this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — compose up failed (exit 14 — a file the compose project references is missing) — env file .env not found: stat .env: no such file or directory; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D11 Test Reliability — Test reliability not included — no test command the analyzer could start
D16 Bus Factor — single-contributor repository — bus factor is not applicable
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — D21 withholds its case and prefix conventions rows: 2 candidate(s) found and not reported.
D22 Internal API Consistency — API consistency is measured on C#, TypeScript, Go only; the exposed Rust surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D25 ADR Conformance — no ADRs to check
D32 Data Compliance (PII/GDPR) — 1 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D34 Knowledge Freshness — history too condensed to judge knowledge freshness
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not measured — polyglot repository, one half has no runner
DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (2 value object(s))
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
P8 Schema migrations — sqlx is declared, but this repository defines no table or model of its own, so there is no database schema here for this check to judge
P9 Domain vs controller coverage — coverage data present for 32 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for tinybench, mitata, benchmark.js, benny or vitest `bench(...)` calls in files that import them (or `*.bench.*` files), or one of those in a REDACTED, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X27 Collection changed while being enumerated — X27 reached only 22% of this repository's production lines — typescript (44,363 lines), javascript (542 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
ED1 · Handler temporal coupling· Blocking call on the event loop · ×5
Blocking call on the event loop: diet.yolo_handler calls `std::fs::create_dir_all` services/api/src/api/diet.rs:114— `diet.yolo_handler` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::create_dir_all`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: diet.yolo_handler calls `std::fs::write` services/api/src/api/diet.rs:115— `diet.yolo_handler` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::write`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: diet.yolo_handler calls `std::fs::read` services/api/src/api/diet.rs:358— `diet.yolo_handler` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: src.main calls `std::fs::read_to_string` services/api/src/main.rs:47— `src.main` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
Blocking call on the event loop: test.setup_db calls `std::fs::read_to_string` services/api/src/utils/test.rs:20— `test.setup_db` runs on the async event loop (it is async, an actor or framework handler, a hand-written `poll`, or called from one) and makes the blocking call `std::fs::read_to_string`: while it blocks, the loop's worker thread serves nothing else, so every task, message and request scheduled on it waits — and a blocking wait on a future that needs that worker can deadlock. Use the awaited twin (`tokio::time::sleep(..).await`, `tokio::fs`, an async channel/client), or move the work off the loop with `tokio::task::spawn_blocking`.
<html> without a lang experiments/version_aware_rag/data/sources_v4/who/who_trs_916_2003.download-error.html:1— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang REDACTED:5— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang experiments/version_aware_rag/data/sources_v5/who/WHO_TRS_916_2003.iris-shell-error.html:1— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
Project dependency cycle — The projects experiments → src/shared → experiments form a reference cycle. Cyclic dependencies prevent independent build/test/deploy, blur ownership, and tend to grow into a big ball of mud. Break the cycle by extracting the shared types into a separate project both can reference.
Project dependency cycle — The projects agent_skills → src/server → agent_skills (one cycle inside a mutually-dependent group of 3 projects) form a reference cycle. Cyclic dependencies prevent independent build/test/deploy, blur ownership, and tend to grow into a big ball of mud. Break the cycle by extracting the shared types into a separate project both can reference.
AC2 · Forms & labels· Link with no accessible name · ×1
Link with no accessible name experiments/version_aware_rag/data/sources_v5/who/WHO_TRS_916_2003.legacy-404-error.html:256— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
Unlisted import 'yaml' experiments/version_aware_rag/scripts/v3/run_experiment.ts:3— Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
Serious — 559 finding(s)
R4 · Test Coverage· No test reaches this file · ×40
No test reaches this file experiments/version_aware_rag/src/annotation/build_splits.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file experiments/version_aware_rag/scripts/v5/build_r2_11_remaining_annotations.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file experiments/version_aware_rag/scripts/v5/run_r2_11_development.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file experiments/version_aware_rag/scripts/v4/build_v4_candidate_pairs.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file experiments/version_aware_rag/scripts/v5/build_r2_14_confirmation_annotations.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file experiments/version_aware_rag/scripts/v5/run_r2_20_neural_hybrid_confirmation.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file experiments/version_aware_rag/scripts/v4/run_v4_dev_model_selection.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file experiments/version_aware_rag/scripts/diagnostics/build_oracle_diagnosis_report.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file experiments/version_aware_rag/scripts/v5/run_r2_14_confirmation.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file experiments/version_aware_rag/scripts/v5/build_r2_7_preaudited_cross_version_split.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file experiments/version_aware_rag/scripts/v5/run_r2_19_neural_hybrid_diagnostic.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file experiments/version_aware_rag/scripts/v5/run_r2_15_compatible_selectivity_diagnostic.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file experiments/version_aware_rag/scripts/v5/freeze_r2_11_development.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file experiments/version_aware_rag/scripts/v5/run_r2_12_confirmation.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file src/server/mohwNews.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file experiments/version_aware_rag/scripts/v5/mine_r2_20_candidate_groups.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file experiments/version_aware_rag/scripts/v5/run_r2_12_candidate_diagnostic.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file experiments/version_aware_rag/scripts/v5/freeze_r2_20_neural_hybrid_confirmation.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file experiments/version_aware_rag/scripts/v5/run_r2_6_query_conditioned_development.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file experiments/version_aware_rag/scripts/v5/mine_r2_12_predeclared_candidate_groups.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file experiments/version_aware_rag/scripts/v6/build_v6_exclusion_inventory.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file experiments/version_aware_rag/scripts/v5/build_r2_10_fresh_test_review_packet.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file experiments/version_aware_rag/scripts/v5/run_r2_21_lexical_weighted_rrf_diagnostic.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
Sync-over-async blocking REDACTED:385— `fs.existsSync` in `callback to tool` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:388— `fs.readFileSync` in `callback to tool` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:409— `fs.writeFileSync` in `callback to tool` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:411— `fs.existsSync` in `callback to tool` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:411— `fs.readFileSync` in `callback to tool` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:413— `fs.writeFileSync` in `callback to tool` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking agent_skills/read_workspace_code.ts:16— `fs.existsSync` in `callback to tool` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking agent_skills/read_workspace_code.ts:25— `fs.readFileSync` in `callback to tool` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking agent_skills/versioned_guidelines_tool.ts:13— `fs.existsSync` in `callback to tool` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking agent_skills/vision_model.ts:52— `fs.existsSync` in `callback to tool` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:40— `fs.readFileSync` in `parseSplitQueries` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:52— `fs.readFileSync` in `compareRecencyAndOracle` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:54— `fs.readFileSync` in `compareRecencyAndOracle` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:61— `fs.readFileSync` in `compareRecencyAndOracle` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:71— `fs.readFileSync` in `compareRecencyAndOracle` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:72— `fs.readFileSync` in `compareRecencyAndOracle` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:202— `fs.existsSync` in `compareRecencyAndOracle` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:203— `fs.mkdirSync` in `compareRecencyAndOracle` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:206— `fs.writeFileSync` in `compareRecencyAndOracle` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:207— `fs.writeFileSync` in `compareRecencyAndOracle` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:208— `fs.writeFileSync` in `compareRecencyAndOracle` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking experiments/version_aware_rag/scripts/diagnostics/run_oracle_counterfactuals.ts:36— `fs.readFileSync` in `runOracleCounterfactuals` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking experiments/version_aware_rag/scripts/diagnostics/run_oracle_counterfactuals.ts:38— `fs.readFileSync` in `runOracleCounterfactuals` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking experiments/version_aware_rag/scripts/diagnostics/run_oracle_counterfactuals.ts:44— `fs.readFileSync` in `runOracleCounterfactuals` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking experiments/version_aware_rag/scripts/diagnostics/run_oracle_counterfactuals.ts:50— `fs.readFileSync` in `parseSplitQueries` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Outbound HTTP without resilience experiments/version_aware_rag/scripts/v4/draft_v4_devval_queries.ts:125— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience experiments/version_aware_rag/scripts/v4/run_v4_frozen_answer_generation.ts:15— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience experiments/version_aware_rag/scripts/v4/run_v4_posttest_predicted_graph.ts:15— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience experiments/version_aware_rag/scripts/v4/verify_gemini_model.ts:14— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience experiments/version_aware_rag/scripts/v5/draft_v5_relation_second_opinion.ts:31— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience experiments/version_aware_rag/scripts/v5/run_codex_mined_detector_validation.ts:28— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience experiments/version_aware_rag/scripts/v5/run_r2_action_detector_development.ts:88— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience experiments/version_aware_rag/scripts/v5/run_r2_action_detector_validation.ts:58— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience experiments/version_aware_rag/scripts/v5/run_v5_relation_detector_development.ts:55— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience experiments/version_aware_rag/src/generation/answer_generator.ts:138— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience experiments/version_aware_rag/src/generation/answer_generator.ts:150— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience experiments/version_aware_rag/src/retrieval/gemini_rerank_client.ts:54— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience experiments/version_aware_rag/src/versioning/detectors/llm_detector.ts:190— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience experiments/version_aware_rag/src/versioning/detectors/llm_detector.ts:205— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience services/api/src/api/agent_approve.rs:20— `Client::new()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience services/api/src/api/agent_content.rs:81— `Client::new()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience services/api/src/api/diet.rs:296— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience services/api/src/api/rag_document.rs:119— `Client::new()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience services/api/src/api/rag_document.rs:155— `Client::new()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience services/api/src/api/rag_document.rs:178— `Client::new()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience src/server/mohwNews.ts:71— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
FunctionTooLong: build_splits.buildSplits experiments/version_aware_rag/src/annotation/build_splits.ts:22— FunctionTooLong — buildSplits runs 979 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 879 over it, 9.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: build_v4_candidate_pairs.main experiments/version_aware_rag/scripts/v4/build_v4_candidate_pairs.ts:66— FunctionTooLong — main runs 368 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 268 over it, 3.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: adapter.createSqliteStorage src/storage/sqlite/adapter.ts:96— FunctionTooLong — createSqliteStorage runs 304 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 204 over it, 3.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: run_experiment.main experiments/version_aware_rag/scripts/v3/run_experiment.ts:58— FunctionTooLong — main runs 277 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 177 over it, 2.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: healthy_diet_api_server::api::diet::yolo_handler services/api/src/api/diet.rs:56— FunctionTooLong — healthy_diet_api_server::api::diet::yolo_handler runs 233 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 133 over it, 2.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: audit_v4_candidate_coverage.performAudit experiments/version_aware_rag/scripts/v4/audit_v4_candidate_coverage.ts:101— FunctionTooLong — performAudit runs 228 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 128 over it, 2.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: adapter.createSupabaseStorage src/storage/supabase/adapter.ts:65— FunctionTooLong — createSupabaseStorage runs 213 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 113 over it, 2.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: validate_annotations.validateAnnotations experiments/version_aware_rag/src/annotation/validate_annotations.ts:16— FunctionTooLong — validateAnnotations runs 209 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 109 over it, 2.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: trace_oracle_retrieval.traceOracleRetrieval experiments/version_aware_rag/scripts/diagnostics/trace_oracle_retrieval.ts:29— FunctionTooLong — traceOracleRetrieval runs 176 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 76 over it, 1.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: healthy_diet_api_server::router::create_app services/api/src/router.rs:66— FunctionTooLong — healthy_diet_api_server::router::create_app runs 176 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 76 over it, 1.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: import_and_adjudicate_answer_annotations.main experiments/version_aware_rag/scripts/v3/import_and_adjudicate_answer_annotations.ts:76— FunctionTooLong — main runs 169 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 69 over it, 1.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: run_oracle_counterfactuals.runOracleCounterfactuals experiments/version_aware_rag/scripts/diagnostics/run_oracle_counterfactuals.ts:26— FunctionTooLong — runOracleCounterfactuals runs 157 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 57 over it, 1.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: knowledgeGraph.createKnowledgeGraphRouter REDACTED:651— FunctionTooLong — createKnowledgeGraphRouter runs 156 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 56 over it, 1.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ragDocuments.createRagApiRouter REDACTED:475— FunctionTooLong — createRagApiRouter runs 139 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: compare_recency_oracle.compareRecencyAndOracle experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:28— FunctionTooLong — compareRecencyAndOracle runs 138 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 38 over it, 1.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: build_paper_tables.main experiments/version_aware_rag/scripts/v3/build_paper_tables.ts:97— FunctionTooLong — main runs 125 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 25 over it, 1.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: classify_relations.main experiments/version_aware_rag/scripts/v3/classify_relations.ts:34— FunctionTooLong — main runs 115 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: run_heldout_pipeline.main experiments/version_aware_rag/scripts/v3/run_heldout_pipeline.ts:18— FunctionTooLong — main runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: export_blind_answer_annotation_package.main experiments/version_aware_rag/scripts/v3/export_blind_answer_annotation_package.ts:36— FunctionTooLong — main runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FileTooLong: annotation/build_splits.ts experiments/version_aware_rag/src/annotation/build_splits.ts— FileTooLong — 988 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: buildSplits (22-1310). The bar is 500 significant lines; this is 488 over it, 1.98× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: REDACTED REDACTED— FileTooLong — 789 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 289 over it, 1.58× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: v5/build_r2_11_remaining_annotations.ts experiments/version_aware_rag/scripts/v5/build_r2_11_remaining_annotations.ts— FileTooLong — 770 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 270 over it, 1.54× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: server/agentRuntime.ts src/server/agentRuntime.ts— FileTooLong — 714 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 214 over it, 1.43× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 644 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 144 over it, 1.29× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: v4/run_v4_policy_repair.ts experiments/version_aware_rag/scripts/v4/run_v4_policy_repair.ts— FileTooLong — 582 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 82 over it, 1.16× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: v5/build_r2_22_human_review_docx.py experiments/version_aware_rag/scripts/v5/build_r2_22_human_review_docx.py— FileTooLong — 558 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 58 over it, 1.12× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: api/admin.rs services/api/src/api/admin.rs— FileTooLong — 532 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 32 over it, 1.06× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: v5/build_r2_12_confirmation_annotations.ts experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts— FileTooLong — 529 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 29 over it, 1.06× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: v5/run_r2_11_development.ts experiments/version_aware_rag/scripts/v5/run_r2_11_development.ts— FileTooLong — 528 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 28 over it, 1.06× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: v5/build_r2_14_confirmation_annotations.ts experiments/version_aware_rag/scripts/v5/build_r2_14_confirmation_annotations.ts— FileTooLong — 522 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 22 over it, 1.04× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
Swallowed exception (empty catch) src/server/mohwNews.ts:88— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) experiments/version_aware_rag/src/versioning/detectors/cache.ts:51— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) experiments/version_aware_rag/scripts/v5/draft_v5_relation_second_opinion.ts:26— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) experiments/version_aware_rag/scripts/v5/draft_v5_relation_second_opinion.ts:39— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) experiments/version_aware_rag/scripts/v5/run_codex_mined_detector_validation.ts:29— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) experiments/version_aware_rag/scripts/v5/run_r2_action_detector_development.ts:82— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) experiments/version_aware_rag/scripts/v5/run_r2_action_detector_validation.ts:69— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) experiments/version_aware_rag/scripts/v5/run_v5_relation_detector_development.ts:49— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) experiments/version_aware_rag/scripts/v5/run_v5_relation_detector_development.ts:127— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) experiments/version_aware_rag/scripts/diagnostics/select_frozen_v3_runs.ts:54— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Configuration option is read nowhere services/api/src/api/chat.rs:18— `AgentChatRequest.message` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere services/api/src/api/chat.rs:22— `AgentChatRequest.user_context` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere services/api/src/api/chat.rs:23— `AgentChatRequest.image` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere services/api/src/api/chat.rs:24— `AgentChatRequest.model_source` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere services/api/src/api/diet.rs:20— `YoloScriptOutput.json_path` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere services/api/src/discord/login.rs:30— `AuthRequest.state` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere services/api/src/utils/gemini.rs:20— `GeminiResponse.candidates` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere services/api/src/utils/gemini.rs:30— `GeminiContentResponse.parts` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere services/api/src/utils/gemini.rs:35— `GeminiPartResponse.text` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
X2 · Cancellation propagation· Async function without AbortSignal · ×7
Async function without AbortSignal: fetchHtml src/server/mohwNews.ts:70— `fetchHtml` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: callLLMApi experiments/version_aware_rag/src/versioning/detectors/llm_detector.ts:176— `callLLMApi` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: callLLMApi experiments/version_aware_rag/src/generation/answer_generator.ts:123— `callLLMApi` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: classify experiments/version_aware_rag/scripts/v5/run_r2_action_detector_development.ts:61— `classify` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: classify experiments/version_aware_rag/scripts/v5/run_r2_action_detector_validation.ts:44— `classify` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: classify experiments/version_aware_rag/scripts/v5/run_v5_relation_detector_development.ts:30— `classify` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: verifyGeminiModel experiments/version_aware_rag/scripts/v4/verify_gemini_model.ts:9— `verifyGeminiModel` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×6
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D30 · Dependency Vulnerabilities· Medium vulnerability · ×5
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×4
Hotspot: experiments/version_aware_rag/src/retrieval/compatibility_expansion.ts experiments/version_aware_rag/src/retrieval/compatibility_expansion.ts:4— experiments/version_aware_rag/src/retrieval/compatibility_expansion.ts changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in compatibility_expansion.expandCompatibleChunks at line 4. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 13:48:19 +08:00' --until='2026-09-28 13:48:19 +08:00' --full-history --no-merges -- experiments/version_aware_rag/src/retrieval/compatibility_expansion.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/server/agentRuntime.ts src/server/agentRuntime.ts:634— src/server/agentRuntime.ts changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in agentRuntime.callModel at line 634. 1 of those changes was a fix/bug commit, and the other 2 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 13:48:19 +08:00' --until='2026-09-28 13:48:19 +08:00' --full-history --no-merges -- src/server/agentRuntime.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: experiments/version_aware_rag/src/versioning/detectors/llm_detector.ts experiments/version_aware_rag/src/versioning/detectors/llm_detector.ts:33— experiments/version_aware_rag/src/versioning/detectors/llm_detector.ts changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in LLMDetector.classify at line 33. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-30..2026-09-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-30 13:48:19 +08:00' --until='2026-09-28 13:48:19 +08:00' --full-history --no-merges -- experiments/version_aware_rag/src/versioning/detectors/llm_detector.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Duplicated block (5 lines × 2) experiments/version_aware_rag/scripts/v6/evaluate_v6_fresh_retrieval.py:93— experiments/version_aware_rag/scripts/v6/evaluate_v6_fresh_retrieval.py:93-97 | experiments/version_aware_rag/scripts/v7/evaluate_v7_pilot.py:46-50 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/version_aware_rag/scripts/v6/evaluate_v6_fresh_retrieval.py:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) experiments/version_aware_rag/scripts/v6/build_v6_runtime_relation_graph.py:73— experiments/version_aware_rag/scripts/v6/build_v6_runtime_relation_graph.py:73-77 | experiments/version_aware_rag/scripts/v6/resolve_v6_page_gold_to_chunks.py:145-149 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) experiments/version_aware_rag/scripts/v6/v6_retrieval_core.py:57— experiments/version_aware_rag/scripts/v6/v6_retrieval_core.py:57-61 | experiments/version_aware_rag/scripts/v6/v6r_retrieval_core.py:54-58 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15 lines × 2) services/api/src/api/admin.rs:315— services/api/src/api/admin.rs:315-329 | services/api/src/api/admin.rs:417-431 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/api/src/api/admin.rs:315` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) services/api/src/api/admin.rs:683— services/api/src/api/admin.rs:683-697 | services/api/src/api/user.rs:25-39 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `services/api/src/api/admin.rs:683` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15 lines × 2) services/api/src/api/agent_content.rs:81— services/api/src/api/agent_content.rs:81-95 | services/api/src/api/rag_document.rs:119-133 — before extracting anything, compare `services/api/src/api/agent_content.rs` and `services/api/src/api/rag_document.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) services/api/src/api/agent_content.rs:119— services/api/src/api/agent_content.rs:119-130 | services/api/src/api/rag_document.rs:95-106 — before extracting anything, compare `services/api/src/api/agent_content.rs` and `services/api/src/api/rag_document.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `services/api/src/api/rag_document.rs:91` calls `trim`, `is_empty`, `Ok` and `services/api/src/api/agent_content.rs:117` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) services/api/src/discord/login.rs:78— services/api/src/discord/login.rs:78-89 | services/api/src/discord/login.rs:101-112 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/api/src/discord/login.rs:78` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) services/api/src/api/rag_document.rs:230— services/api/src/api/rag_document.rs:230-241 | services/api/src/api/rag_document.rs:248-259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/api/src/api/rag_document.rs:230` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
AC3 · Page structure· Page without a main landmark · ×2
Page without a main landmark REDACTED:5— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark experiments/version_aware_rag/data/sources_v5/who/WHO_TRS_916_2003.legacy-404-error.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
run_v4_policy_repair.runV4PolicyRepairPipeline::evaluateSplitMetrics (cognitive 20) experiments/version_aware_rag/scripts/v4/run_v4_policy_repair.ts:336— run_v4_policy_repair.runV4PolicyRepairPipeline::evaluateSplitMetrics has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (8 pts), loops 3 (5 pts), if/else 2 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (run_v4_policy_repair.runV4PolicyRepairPipeline, run_v4_policy_repair.runV4PolicyRepairPipeline::evaluateSplitSubset) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
run_v4_policy_repair.runV4PolicyRepairPipeline::evaluateSplitSubset (cognitive 18) experiments/version_aware_rag/scripts/v4/run_v4_policy_repair.ts:427— run_v4_policy_repair.runV4PolicyRepairPipeline::evaluateSplitSubset has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (6 pts), loops 3 (5 pts), if/else 2 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (run_v4_policy_repair.runV4PolicyRepairPipeline, run_v4_policy_repair.runV4PolicyRepairPipeline::evaluateSplitMetrics) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
MethodTooLong: VersionAwareRetriever.retrieve experiments/version_aware_rag/src/retrieval/version_aware.ts:98— MethodTooLong — retrieve runs 295 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 195 over it, 2.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LLMDetector.classify experiments/version_aware_rag/src/versioning/detectors/llm_detector.ts:33— MethodTooLong — classify runs 112 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 12 over it, 1.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×2
Edited copy of a member (10 corresponding lines) experiments/version_aware_rag/scripts/v6/evaluate_v6_fresh_retrieval.py:90— experiments/version_aware_rag/scripts/v6/evaluate_v6_fresh_retrieval.py:90-102 | experiments/version_aware_rag/scripts/v7/evaluate_v7_pilot.py:44-53 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) experiments/version_aware_rag/scripts/v6/v6_retrieval_core.py:64— experiments/version_aware_rag/scripts/v6/v6_retrieval_core.py:64-77 | experiments/version_aware_rag/scripts/v6/v6r_retrieval_core.py:61-70 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (2 corresponding lines) · ×2
Edited copy of a member (2 corresponding lines) experiments/version_aware_rag/scripts/v6/run_v6r_repair_diagnostic.py:32— experiments/version_aware_rag/scripts/v6/run_v6r_repair_diagnostic.py:32-33 | experiments/version_aware_rag/scripts/v7/build_v7_pilot_drafts.py:71-72 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (2 corresponding lines) experiments/version_aware_rag/scripts/v6/analyze_v6_failure_attribution.py:28— experiments/version_aware_rag/scripts/v6/analyze_v6_failure_attribution.py:28-29 | experiments/version_aware_rag/scripts/v6/verify_v6_evaluation_independently.py:27-28 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (7 lines × 2) experiments/version_aware_rag/scripts/v6/build_v6_final_review_gap_batch.py:55— experiments/version_aware_rag/scripts/v6/build_v6_final_review_gap_batch.py:55-61 | experiments/version_aware_rag/scripts/v6/build_v6_query_review_delta_23.py:66-72 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) services/api/src/utils/ai_prompt.rs:6— services/api/src/utils/ai_prompt.rs:6-12 | services/api/src/utils/ai_prompt.rs:16-22 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/api/src/utils/ai_prompt.rs:6` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) services/api/src/api/user.rs:39— services/api/src/api/user.rs:39-51 | services/api/src/api/user.rs:93-105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/api/src/api/user.rs:39` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) services/api/src/api/admin.rs:560— services/api/src/api/admin.rs:560-572 | services/api/src/api/admin.rs:610-622 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/api/src/api/admin.rs:560` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) services/api/src/api/login.rs:19— services/api/src/api/login.rs:19-32 | services/api/src/api/refresh.rs:50-63 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `services/api/src/api/login.rs:19` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) services/api/src/api/admin.rs:122— services/api/src/api/admin.rs:122-135 | services/api/src/api/admin.rs:287-300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/api/src/api/admin.rs:122` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
R10 · Code Duplication· Duplicated block with local edits (56 matched lines × 2 locations) · ×2
Duplicated block with local edits (56 matched lines × 2 locations) experiments/version_aware_rag/scripts/v5/freeze_r2_16_annotation_authoring_plan.ts:5— experiments/version_aware_rag/scripts/v5/freeze_r2_16_annotation_authoring_plan.ts:5 · experiments/version_aware_rag/scripts/v5/freeze_r2_20_annotation_authoring_plan.ts:5 — the two spans are one implementation copied and then locally edited — 477 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (56 matched lines × 2 locations) experiments/version_aware_rag/scripts/v5/run_r2_action_detector_development.ts:78— experiments/version_aware_rag/scripts/v5/run_r2_action_detector_development.ts:78 · experiments/version_aware_rag/scripts/v5/run_v5_relation_detector_development.ts:45 — the two spans are one implementation copied and then locally edited — 704 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (40 lines × 2 locations) experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts:10— experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts:10 · experiments/version_aware_rag/scripts/v5/build_r2_14_confirmation_annotations.ts:10 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (40 lines × 2 locations) experiments/version_aware_rag/scripts/v5/prepare_r2_11_sources.ts:92— experiments/version_aware_rag/scripts/v5/prepare_r2_11_sources.ts:92 · experiments/version_aware_rag/scripts/v5/prepare_r2_19_sources.ts:109 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (38 matched lines × 2 locations) · ×2
Duplicated block with local edits (38 matched lines × 2 locations) experiments/version_aware_rag/scripts/apply_policy.ts:35— experiments/version_aware_rag/scripts/apply_policy.ts:35 · experiments/version_aware_rag/scripts/classify_conflicts.ts:71 — the two spans are one implementation copied and then locally edited — 339 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (38 matched lines × 2 locations) experiments/version_aware_rag/scripts/v3/build_policy_graph.ts:24— experiments/version_aware_rag/scripts/v3/build_policy_graph.ts:24 · experiments/version_aware_rag/scripts/v3/classify_relations.ts:18 — the two spans are one implementation copied and then locally edited — 276 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
AC3 · Page structure· Heading level jumps from h1 to h3 · ×1
Heading level jumps from h1 to h3 REDACTED:12— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
Multiple navigation landmarks without distinguishing labels experiments/version_aware_rag/data/sources_v5/who/WHO_TRS_916_2003.legacy-404-error.html:2— With more than one navigation landmark, each needs an aria-label/aria-labelledby (e.g. "Primary", "Footer") so assistive tech can tell them apart. At least one nav here is unlabelled.
meta-refresh timed redirect/refresh experiments/version_aware_rag/data/sources_v5/who/WHO_TRS_916_2003.legacy-404-error.html:1859— A timed meta-refresh moves users with no control or warning. Use a server redirect or a user-triggered action instead.
Focus outline removed inline experiments/version_aware_rag/data/sources_v5/who/WHO_TRS_916_2003.legacy-404-error.html:256— <a> takes keyboard focus, and outline:none/0 in its inline style removes the focus ring with no chance of a :focus replacement (an inline style outranks every stylesheet rule). Keep a visible focus indicator.
adapter.createSupabaseStorage (cyclomatic 93) src/storage/supabase/adapter.ts:65— adapter.createSupabaseStorage has cyclomatic complexity 93 (threshold 15). Of this number, 88 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
run_v4_policy_repair.runV4PolicyRepairPipeline (cyclomatic 86) experiments/version_aware_rag/scripts/v4/run_v4_policy_repair.ts:166— run_v4_policy_repair.runV4PolicyRepairPipeline has cyclomatic complexity 86 (threshold 15). Of this number, 57 points are the body's own statements and 29 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
validate_annotations.validateAnnotations (cyclomatic 83) experiments/version_aware_rag/src/annotation/validate_annotations.ts:16— validate_annotations.validateAnnotations has cyclomatic complexity 83 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
run_experiment.main (cyclomatic 75) experiments/version_aware_rag/scripts/v3/run_experiment.ts:58— run_experiment.main has cyclomatic complexity 75 (threshold 15). Of this number, 43 points are the body's own statements and 32 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VersionAwareRetriever.retrieve (cyclomatic 74) experiments/version_aware_rag/src/retrieval/version_aware.ts:98— VersionAwareRetriever.retrieve has cyclomatic complexity 74 (threshold 15). Of this number, 69 points are the body's own statements and 5 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
build_oracle_diagnosis_report.buildOracleDiagnosisReport (cyclomatic 52) experiments/version_aware_rag/scripts/diagnostics/build_oracle_diagnosis_report.ts:22— build_oracle_diagnosis_report.buildOracleDiagnosisReport has cyclomatic complexity 52 (threshold 15). Of this number, 31 points are the body's own statements and 21 belong to 14 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
build_v4_candidate_pairs.main (cyclomatic 47) experiments/version_aware_rag/scripts/v4/build_v4_candidate_pairs.ts:66— build_v4_candidate_pairs.main has cyclomatic complexity 47 (threshold 15). Of this number, 20 points are the body's own statements and 27 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
build_splits.buildSplits (cyclomatic 45) experiments/version_aware_rag/src/annotation/build_splits.ts:22— build_splits.buildSplits has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (build_splits.buildSplits::getTopicForQuery) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
serverHandlers.chatHandler (cyclomatic 44) REDACTED:599— serverHandlers.chatHandler has cyclomatic complexity 44 (threshold 15). Of this number, 42 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
compare_recency_oracle.compareRecencyAndOracle (cyclomatic 43) experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:28— compare_recency_oracle.compareRecencyAndOracle has cyclomatic complexity 43 (threshold 15). Of this number, 36 points are the body's own statements and 7 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
validate_r2_12_confirmation.validateR212ConfirmationLedger (cyclomatic 39) experiments/version_aware_rag/src/annotation/validate_r2_12_confirmation.ts:44— validate_r2_12_confirmation.validateR212ConfirmationLedger has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
validate_r2_14_confirmation.validateR214ConfirmationLedger (cyclomatic 39) experiments/version_aware_rag/src/annotation/validate_r2_14_confirmation.ts:40— validate_r2_14_confirmation.validateR214ConfirmationLedger has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
validate_r2_16_confirmation.validateR216ConfirmationLedger (cyclomatic 39) experiments/version_aware_rag/src/annotation/validate_r2_16_confirmation.ts:40— validate_r2_16_confirmation.validateR216ConfirmationLedger has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
validate_r2_20_confirmation.validateR220ConfirmationLedger (cyclomatic 39) experiments/version_aware_rag/src/annotation/validate_r2_20_confirmation.ts:40— validate_r2_20_confirmation.validateR220ConfirmationLedger has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
import_and_adjudicate_answer_annotations.main (cyclomatic 37) experiments/version_aware_rag/scripts/v3/import_and_adjudicate_answer_annotations.ts:76— import_and_adjudicate_answer_annotations.main has cyclomatic complexity 37 (threshold 15). Of this number, 34 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
audit_v4_candidate_coverage.performAudit (cyclomatic 37) experiments/version_aware_rag/scripts/v4/audit_v4_candidate_coverage.ts:101— audit_v4_candidate_coverage.performAudit has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 5 of the 37 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 167, 123, 155, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
stage_attribution.attributeFailure (cyclomatic 36) experiments/version_aware_rag/src/diagnostics/stage_attribution.ts:8— stage_attribution.attributeFailure has cyclomatic complexity 36 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
evaluate_v6_fresh_retrieval.main (cyclomatic 34) experiments/version_aware_rag/scripts/v6/evaluate_v6_fresh_retrieval.py:120— evaluate_v6_fresh_retrieval.main has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
db_tools.updateUserProfileTool (cyclomatic 33) agent_skills/db_tools.ts:396— db_tools.updateUserProfileTool has cyclomatic complexity 33 (threshold 15). Of this number, 31 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
run_oracle_counterfactuals.runOracleCounterfactuals (cyclomatic 32) experiments/version_aware_rag/scripts/diagnostics/run_oracle_counterfactuals.ts:26— run_oracle_counterfactuals.runOracleCounterfactuals has cyclomatic complexity 32 (threshold 15). Of this number, 29 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ragDocuments.createRagApiRouter (cyclomatic 32) REDACTED:475— ragDocuments.createRagApiRouter has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 2 of the 32 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 490, sendDocumentPreview, sendDocumentFile, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
build_paper_tables.main (cyclomatic 30) experiments/version_aware_rag/scripts/v3/build_paper_tables.ts:97— build_paper_tables.main has cyclomatic complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
classify_relations.main (cyclomatic 30) experiments/version_aware_rag/scripts/v3/classify_relations.ts:34— classify_relations.main has cyclomatic complexity 30 (threshold 15). Of this number, 28 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
agentRuntime.runAgentStream (cyclomatic 30) src/server/agentRuntime.ts:765— agentRuntime.runAgentStream has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 1 of the 30 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 799, 848, 890). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
knowledgeGraph.createKnowledgeGraphRouter (cyclomatic 30) REDACTED:651— knowledgeGraph.createKnowledgeGraphRouter has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 2 of the 30 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 664, a function literal at line 723, a function literal at line 767, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
imageStorage.saveIncomingImageToWorkspace (cyclomatic 30) src/server/imageStorage.ts:45— imageStorage.saveIncomingImageToWorkspace has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
analyze_v6_relation_review_agreement.main (cyclomatic 30) experiments/version_aware_rag/scripts/v6/analyze_v6_relation_review_agreement.py:45— analyze_v6_relation_review_agreement.main has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
run_statistics.main (cyclomatic 29) experiments/version_aware_rag/scripts/v3/run_statistics.ts:32— run_statistics.main has cyclomatic complexity 29 (threshold 15). Of this number, 17 points are the body's own statements and 12 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
validate_r2_11_development.validateR211DevelopmentLedger (cyclomatic 29) experiments/version_aware_rag/src/annotation/validate_r2_11_development.ts:53— validate_r2_11_development.validateR211DevelopmentLedger has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
audit_corpus.auditCorpus (cyclomatic 28) experiments/version_aware_rag/src/corpus/audit_corpus.ts:48— audit_corpus.auditCorpus has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
build_chunks.buildChunksFromMarkdown (cyclomatic 26) experiments/version_aware_rag/scripts/build_chunks.ts:18— build_chunks.buildChunksFromMarkdown has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
compatibility_expansion.expandCompatibleChunks (cyclomatic 25) experiments/version_aware_rag/src/retrieval/compatibility_expansion.ts:4— compatibility_expansion.expandCompatibleChunks has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
classification_metrics.computeClassificationMetrics (cyclomatic 25) experiments/version_aware_rag/src/evaluation/classification_metrics.ts:23— classification_metrics.computeClassificationMetrics has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
run_r2_action_detector_development.classify (cyclomatic 25) experiments/version_aware_rag/scripts/v5/run_r2_action_detector_development.ts:61— run_r2_action_detector_development.classify has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
db_tools.logDietWithClient (cyclomatic 24) agent_skills/db_tools.ts:112— db_tools.logDietWithClient has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
build_corpus.getLegacyChunkIds (cyclomatic 23) experiments/version_aware_rag/src/corpus/build_corpus.ts:17— build_corpus.getLegacyChunkIds has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
allocate_v6_query_slots.main (cyclomatic 23) experiments/version_aware_rag/scripts/v6/allocate_v6_query_slots.py:100— allocate_v6_query_slots.main has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AnswerMetricsEvaluator.computeAutomaticCitationProxyMetrics (cyclomatic 22) experiments/version_aware_rag/src/evaluation/answer_metrics.ts:102— AnswerMetricsEvaluator.computeAutomaticCitationProxyMetrics has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
run_v5_relation_detector_development.classify (cyclomatic 22) experiments/version_aware_rag/scripts/v5/run_v5_relation_detector_development.ts:30— run_v5_relation_detector_development.classify has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
audit_v6_relation_candidates.main (cyclomatic 22) experiments/version_aware_rag/scripts/v6/audit_v6_relation_candidates.py:40— audit_v6_relation_candidates.main has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
healthy_diet_api_server::api::diet::yolo_handler (cyclomatic 22) services/api/src/api/diet.rs:56— healthy_diet_api_server::api::diet::yolo_handler has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
fetch_web.isPrivateOrLocalHostname (cyclomatic 21) agent_skills/fetch_web.ts:20— fetch_web.isPrivateOrLocalHostname has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
trace_oracle_retrieval.traceOracleRetrieval::traceSplitWithFixedPool (cyclomatic 21) experiments/version_aware_rag/scripts/diagnostics/trace_oracle_retrieval.ts:65— trace_oracle_retrieval.traceOracleRetrieval::traceSplitWithFixedPool has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
build_splits.buildSplits::getTopicForQuery (cyclomatic 21) experiments/version_aware_rag/src/annotation/build_splits.ts:508— build_splits.buildSplits::getTopicForQuery has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (build_splits.buildSplits) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
freeze_v6_chunk_corpus_and_gold.main (cyclomatic 21) experiments/version_aware_rag/scripts/v6/freeze_v6_chunk_corpus_and_gold.py:46— freeze_v6_chunk_corpus_and_gold.main has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pdf_to_clean_markdown.clean_markdown_headers_footers_dots (cyclomatic 21) src/rag_clean/pdf_to_clean_markdown.py:151— pdf_to_clean_markdown.clean_markdown_headers_footers_dots has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
adapter.mapDocumentRow (cyclomatic 20) src/storage/supabase/adapter.ts:23— adapter.mapDocumentRow has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RelationGraph.resolvePolicyState (cyclomatic 20) experiments/version_aware_rag/src/versioning/relation_graph.ts:103— RelationGraph.resolvePolicyState has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ragDocuments.mapDocumentRow (cyclomatic 20) REDACTED:315— ragDocuments.mapDocumentRow has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
audit_v6_query_contract_drafts.main (cyclomatic 20) experiments/version_aware_rag/scripts/v6/audit_v6_query_contract_drafts.py:33— audit_v6_query_contract_drafts.main has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
resolve_v6_page_gold_to_chunks.resolve (cyclomatic 20) experiments/version_aware_rag/scripts/v6/resolve_v6_page_gold_to_chunks.py:66— resolve_v6_page_gold_to_chunks.resolve has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
db_tools.getChatHistoryWithClient (cyclomatic 19) agent_skills/db_tools.ts:233— db_tools.getChatHistoryWithClient has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
retrieval_metrics.calculateQueryMetrics (cyclomatic 19) experiments/version_aware_rag/src/evaluation/retrieval_metrics.ts:25— retrieval_metrics.calculateQueryMetrics has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
build_v6_chunk_corpus.main (cyclomatic 19) experiments/version_aware_rag/scripts/v6/build_v6_chunk_corpus.py:68— build_v6_chunk_corpus.main has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
run_r2_action_detector_validation.classify (cyclomatic 18) experiments/version_aware_rag/scripts/v5/run_r2_action_detector_validation.ts:44— run_r2_action_detector_validation.classify has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
build_r2_22_human_review_docx.add_instruction_sections (cyclomatic 18) experiments/version_aware_rag/scripts/v5/build_r2_22_human_review_docx.py:301— build_r2_22_human_review_docx.add_instruction_sections has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
run_v6r_repair_diagnostic.evaluate_run (cyclomatic 18) experiments/version_aware_rag/scripts/v6/run_v6r_repair_diagnostic.py:100— run_v6r_repair_diagnostic.evaluate_run has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RelationEnrichedCandidateGenerator.candidates (cyclomatic 18) experiments/version_aware_rag/scripts/v6/v6r_retrieval_core.py:109— RelationEnrichedCandidateGenerator.candidates has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HeuristicRetriever.retrieve (cyclomatic 17) experiments/version_aware_rag/src/retrieval/heuristic.ts:23— HeuristicRetriever.retrieve has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tune_recency_lambda.runTuning (cyclomatic 17) experiments/version_aware_rag/scripts/v3/tune_recency_lambda.ts:97— tune_recency_lambda.runTuning has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GeminiRerankClient.request (cyclomatic 17) experiments/version_aware_rag/src/retrieval/gemini_rerank_client.ts:48— GeminiRerankClient.request has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ragDocuments.parseMultipartUpload (cyclomatic 17) REDACTED:214— ragDocuments.parseMultipartUpload has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
evaluate_v7_pilot.main (cyclomatic 17) experiments/version_aware_rag/scripts/v7/evaluate_v7_pilot.py:68— evaluate_v7_pilot.main has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
file_tools.buildKnowledgeCorpus (cyclomatic 16) REDACTED:185— file_tools.buildKnowledgeCorpus has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RelationEnrichedCandidateGenerator.candidates (cyclomatic 16) src/server/versionAwareRag.ts:217— RelationEnrichedCandidateGenerator.candidates has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
select_frozen_v3_runs.selectFrozenV3Runs (cyclomatic 16) experiments/version_aware_rag/scripts/diagnostics/select_frozen_v3_runs.ts:16— select_frozen_v3_runs.selectFrozenV3Runs has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RelationGraph.loadGraph (cyclomatic 16) experiments/version_aware_rag/src/versioning/relation_graph.ts:26— RelationGraph.loadGraph has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LLMDetector.classify (cyclomatic 16) experiments/version_aware_rag/src/versioning/detectors/llm_detector.ts:33— LLMDetector.classify has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
agentRuntime.callModel (cyclomatic 16) src/server/agentRuntime.ts:634— agentRuntime.callModel has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
knowledgeGraph.extractDocumentGraph (cyclomatic 16) REDACTED:368— knowledgeGraph.extractDocumentGraph has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
extract_v6_antigravity_response.main (cyclomatic 16) experiments/version_aware_rag/scripts/v6/extract_v6_antigravity_response.py:25— extract_v6_antigravity_response.main has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
run_v6_pair_boost_sensitivity_on_prior_devval.evaluate (cyclomatic 16) experiments/version_aware_rag/scripts/v6/run_v6_pair_boost_sensitivity_on_prior_devval.py:67— run_v6_pair_boost_sensitivity_on_prior_devval.evaluate has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
validate_annotations.validateAnnotations (cognitive 188) experiments/version_aware_rag/src/annotation/validate_annotations.ts:16— validate_annotations.validateAnnotations has cognitive complexity 188 (threshold 15). Drivers by points: if/else 40 (105 pts), loops 24 (55 pts), error handling 6 (16 pts), boolean chains 12 (nesting depth added 106). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VersionAwareRetriever.retrieve (cognitive 120) experiments/version_aware_rag/src/retrieval/version_aware.ts:98— VersionAwareRetriever.retrieve has cognitive complexity 120 (threshold 15). Drivers by points: if/else 27 (64 pts), ternaries 10 (22 pts), boolean chains 21, loops 6 (13 pts) (nesting depth added 56). Of this number, 117 points are the body's own statements and 3 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run_experiment.main (cognitive 93) experiments/version_aware_rag/scripts/v3/run_experiment.ts:58— run_experiment.main has cognitive complexity 93 (threshold 15). Drivers by points: if/else 26 (36 pts), ternaries 13 (28 pts), boolean chains 15, error handling 7, loops 5 (7 pts) (nesting depth added 27). Of this number, 70 points are the body's own statements and 23 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run_v4_policy_repair.runV4PolicyRepairPipeline (cognitive 92) experiments/version_aware_rag/scripts/v4/run_v4_policy_repair.ts:166— run_v4_policy_repair.runV4PolicyRepairPipeline has cognitive complexity 92 (threshold 15). Drivers by points: if/else 17 (43 pts), loops 21 (35 pts), ternaries 14 (29 pts), boolean chains 27 (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (run_v4_policy_repair.runV4PolicyRepairPipeline::evaluateSplitMetrics, run_v4_policy_repair.runV4PolicyRepairPipeline::evaluateSplitSubset) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
adapter.createSupabaseStorage (cognitive 91) src/storage/supabase/adapter.ts:65— adapter.createSupabaseStorage has cognitive complexity 91 (threshold 15). Drivers by points: if/else 72, ternaries 13, boolean chains 6. Of this number, 86 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
build_splits.buildSplits (cognitive 87) experiments/version_aware_rag/src/annotation/build_splits.ts:22— build_splits.buildSplits has cognitive complexity 87 (threshold 15). Drivers by points: ternaries 18 (58 pts), boolean chains 24, if/else 19 (20 pts), loops 9 (12 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (build_splits.buildSplits::getTopicForQuery) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
compatibility_expansion.expandCompatibleChunks (cognitive 71) experiments/version_aware_rag/src/retrieval/compatibility_expansion.ts:4— compatibility_expansion.expandCompatibleChunks has cognitive complexity 71 (threshold 15). Drivers by points: if/else 16 (54 pts), ternaries 3 (9 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate_r2_12_confirmation.validateR212ConfirmationLedger (cognitive 68) experiments/version_aware_rag/src/annotation/validate_r2_12_confirmation.ts:44— validate_r2_12_confirmation.validateR212ConfirmationLedger has cognitive complexity 68 (threshold 15). Drivers by points: if/else 19 (43 pts), boolean chains 11, loops 6 (11 pts), ternaries 1 (3 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate_r2_14_confirmation.validateR214ConfirmationLedger (cognitive 68) experiments/version_aware_rag/src/annotation/validate_r2_14_confirmation.ts:40— validate_r2_14_confirmation.validateR214ConfirmationLedger has cognitive complexity 68 (threshold 15). Drivers by points: if/else 19 (43 pts), boolean chains 11, loops 6 (11 pts), ternaries 1 (3 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate_r2_16_confirmation.validateR216ConfirmationLedger (cognitive 68) experiments/version_aware_rag/src/annotation/validate_r2_16_confirmation.ts:40— validate_r2_16_confirmation.validateR216ConfirmationLedger has cognitive complexity 68 (threshold 15). Drivers by points: if/else 19 (43 pts), boolean chains 11, loops 6 (11 pts), ternaries 1 (3 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate_r2_20_confirmation.validateR220ConfirmationLedger (cognitive 68) experiments/version_aware_rag/src/annotation/validate_r2_20_confirmation.ts:40— validate_r2_20_confirmation.validateR220ConfirmationLedger has cognitive complexity 68 (threshold 15). Drivers by points: if/else 19 (43 pts), boolean chains 11, loops 6 (11 pts), ternaries 1 (3 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
serverHandlers.chatHandler (cognitive 58) REDACTED:599— serverHandlers.chatHandler has cognitive complexity 58 (threshold 15). Drivers by points: if/else 17 (23 pts), ternaries 10 (16 pts), boolean chains 12, error handling 5 (7 pts) (nesting depth added 14). Of this number, 56 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agentRuntime.runAgentStream (cognitive 57) src/server/agentRuntime.ts:765— agentRuntime.runAgentStream has cognitive complexity 57 (threshold 15). Drivers by points: if/else 22 (45 pts), boolean chains 9, error handling 1, loops 1, ternaries 1 (nesting depth added 23). None of this is in the body itself: all 57 points belong to 3 function literals inside it that branch (lines 799, 848, 890). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
compare_recency_oracle.compareRecencyAndOracle (cognitive 54) experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:28— compare_recency_oracle.compareRecencyAndOracle has cognitive complexity 54 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 18, ternaries 5 (9 pts), loops 4 (5 pts) (nesting depth added 14). Of this number, 46 points are the body's own statements and 8 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate_r2_11_development.validateR211DevelopmentLedger (cognitive 54) experiments/version_aware_rag/src/annotation/validate_r2_11_development.ts:53— validate_r2_11_development.validateR211DevelopmentLedger has cognitive complexity 54 (threshold 15). Drivers by points: if/else 17 (38 pts), loops 5 (8 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
import_and_adjudicate_answer_annotations.main (cognitive 53) experiments/version_aware_rag/scripts/v3/import_and_adjudicate_answer_annotations.ts:76— import_and_adjudicate_answer_annotations.main has cognitive complexity 53 (threshold 15). Drivers by points: if/else 19 (31 pts), loops 6 (8 pts), ternaries 6 (8 pts), boolean chains 6 (nesting depth added 16). Of this number, 48 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build_oracle_diagnosis_report.buildOracleDiagnosisReport (cognitive 52) experiments/version_aware_rag/scripts/diagnostics/build_oracle_diagnosis_report.ts:22— build_oracle_diagnosis_report.buildOracleDiagnosisReport has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 17, boolean chains 15, if/else 7 (12 pts), loops 7 (8 pts) (nesting depth added 6). Of this number, 33 points are the body's own statements and 19 belong to 14 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
run_oracle_counterfactuals.runOracleCounterfactuals (cognitive 52) experiments/version_aware_rag/scripts/diagnostics/run_oracle_counterfactuals.ts:26— run_oracle_counterfactuals.runOracleCounterfactuals has cognitive complexity 52 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 6 (10 pts), boolean chains 9, ternaries 3 (7 pts) (nesting depth added 23). Of this number, 47 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
audit_corpus.auditCorpus (cognitive 52) experiments/version_aware_rag/src/corpus/audit_corpus.ts:48— audit_corpus.auditCorpus has cognitive complexity 52 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 7 (11 pts), ternaries 4 (5 pts), boolean chains 4 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build_v4_candidate_pairs.main (cognitive 50) experiments/version_aware_rag/scripts/v4/build_v4_candidate_pairs.ts:66— build_v4_candidate_pairs.main has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (19 pts), ternaries 7 (13 pts), loops 8 (10 pts), boolean chains 7, match/switch 1 (nesting depth added 13). Of this number, 31 points are the body's own statements and 19 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run_statistics.main (cognitive 46) experiments/version_aware_rag/scripts/v3/run_statistics.ts:32— run_statistics.main has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 13 (26 pts), if/else 8 (13 pts), loops 4, boolean chains 2, error handling 1 (nesting depth added 18). Of this number, 20 points are the body's own statements and 26 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
classification_metrics.computeClassificationMetrics (cognitive 43) experiments/version_aware_rag/src/evaluation/classification_metrics.ts:23— classification_metrics.computeClassificationMetrics has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 7 (10 pts), ternaries 4 (7 pts), boolean chains 6 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
knowledgeGraph.extractDocumentGraph (cognitive 42) REDACTED:368— knowledgeGraph.extractDocumentGraph has cognitive complexity 42 (threshold 15). Drivers by points: loops 10 (23 pts), if/else 4 (16 pts), ternaries 1 (3 pts) (nesting depth added 27). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
analyze_v6_relation_review_agreement.main (cognitive 40) experiments/version_aware_rag/scripts/v6/analyze_v6_relation_review_agreement.py:45— analyze_v6_relation_review_agreement.main has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 5 (7 pts), boolean chains 6, ternaries 6 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
audit_v4_candidate_coverage.performAudit (cognitive 39) experiments/version_aware_rag/scripts/v4/audit_v4_candidate_coverage.ts:101— audit_v4_candidate_coverage.performAudit has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 21, if/else 11 (14 pts), ternaries 4 (nesting depth added 3). Most of this is not in the body itself: 4 of the 39 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 167, 123, 155, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
evaluate_v6_fresh_retrieval.main (cognitive 38) experiments/version_aware_rag/scripts/v6/evaluate_v6_fresh_retrieval.py:120— evaluate_v6_fresh_retrieval.main has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 8, ternaries 5 (7 pts), loops 5 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
freeze_v6_chunk_corpus_and_gold.main (cognitive 38) experiments/version_aware_rag/scripts/v6/freeze_v6_chunk_corpus_and_gold.py:46— freeze_v6_chunk_corpus_and_gold.main has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 6 (12 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build_chunks.buildChunksFromMarkdown (cognitive 37) experiments/version_aware_rag/scripts/build_chunks.ts:18— build_chunks.buildChunksFromMarkdown has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 10, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
imageStorage.saveIncomingImageToWorkspace (cognitive 37) src/server/imageStorage.ts:45— imageStorage.saveIncomingImageToWorkspace has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (18 pts), ternaries 5 (10 pts), boolean chains 9 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pdf_to_clean_markdown.clean_markdown_headers_footers_dots (cognitive 37) src/rag_clean/pdf_to_clean_markdown.py:151— pdf_to_clean_markdown.clean_markdown_headers_footers_dots has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 5 (10 pts), boolean chains 7 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
stage_attribution.attributeFailure (cognitive 36) experiments/version_aware_rag/src/diagnostics/stage_attribution.ts:8— stage_attribution.attributeFailure has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (23 pts), boolean chains 12, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
run_v5_relation_detector_development.classify (cognitive 36) experiments/version_aware_rag/scripts/v5/run_v5_relation_detector_development.ts:30— run_v5_relation_detector_development.classify has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 6 (13 pts), boolean chains 5, error handling 2 (4 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
knowledgeGraph.createKnowledgeGraphRouter (cognitive 36) REDACTED:651— knowledgeGraph.createKnowledgeGraphRouter has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (16 pts), error handling 8, loops 3 (6 pts), boolean chains 4, ternaries 2 (nesting depth added 7). Most of this is not in the body itself: 1 of the 36 points is its own statement and the rest belongs to 9 function items inside it that branch (a function literal at line 664, a function literal at line 723, a function literal at line 767, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
allocate_v6_query_slots.main (cognitive 36) experiments/version_aware_rag/scripts/v6/allocate_v6_query_slots.py:100— allocate_v6_query_slots.main has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 9 (13 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RelationGraph.resolvePolicyState (cognitive 33) experiments/version_aware_rag/src/versioning/relation_graph.ts:103— RelationGraph.resolvePolicyState has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 7, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ragDocuments.createRagApiRouter (cognitive 33) REDACTED:475— ragDocuments.createRagApiRouter has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16, boolean chains 9, ternaries 3 (6 pts), error handling 2 (nesting depth added 3). Most of this is not in the body itself: 1 of the 33 points is its own statement and the rest belongs to 7 function items inside it that branch (a function literal at line 490, sendDocumentPreview, sendDocumentFile, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
db_tools.updateUserProfileTool (cognitive 32) agent_skills/db_tools.ts:396— db_tools.updateUserProfileTool has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13, ternaries 8 (10 pts), boolean chains 8, error handling 1 (nesting depth added 2). Of this number, 28 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
build_paper_tables.main (cognitive 32) experiments/version_aware_rag/scripts/v3/build_paper_tables.ts:97— build_paper_tables.main has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 16, loops 4 (6 pts), boolean chains 5, if/else 5 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GeminiRerankClient.request (cognitive 32) experiments/version_aware_rag/src/retrieval/gemini_rerank_client.ts:48— GeminiRerankClient.request has cognitive complexity 32 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 3 (10 pts), boolean chains 6, error handling 1 (2 pts), loops 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
audit_v6_relation_candidates.main (cognitive 31) experiments/version_aware_rag/scripts/v6/audit_v6_relation_candidates.py:40— audit_v6_relation_candidates.main has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 4, loops 2 (3 pts), ternaries 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
classify_relations.main (cognitive 30) experiments/version_aware_rag/scripts/v3/classify_relations.ts:34— classify_relations.main has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 13, if/else 7 (9 pts), loops 7, error handling 1 (nesting depth added 2). Of this number, 28 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run_r2_action_detector_development.classify (cognitive 30) experiments/version_aware_rag/scripts/v5/run_r2_action_detector_development.ts:61— run_r2_action_detector_development.classify has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 6, ternaries 4 (5 pts), error handling 2 (4 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pdf_to_clean_markdown.convert_pdf_to_markdown (cognitive 30) src/rag_clean/pdf_to_clean_markdown.py:99— pdf_to_clean_markdown.convert_pdf_to_markdown has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (8 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
trace_oracle_retrieval.traceOracleRetrieval::traceSplitWithFixedPool (cognitive 29) experiments/version_aware_rag/scripts/diagnostics/trace_oracle_retrieval.ts:65— trace_oracle_retrieval.traceOracleRetrieval::traceSplitWithFixedPool has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 13, ternaries 2 (6 pts), if/else 2 (5 pts), loops 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
healthy_diet_api_server::api::diet::yolo_handler (cognitive 29) services/api/src/api/diet.rs:56— healthy_diet_api_server::api::diet::yolo_handler has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (23 pts), loops 3, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
db_tools.getChatHistoryWithClient (cognitive 27) agent_skills/db_tools.ts:233— db_tools.getChatHistoryWithClient has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 4, ternaries 2 (4 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fetch_web.isPrivateOrLocalHostname (cognitive 26) agent_skills/fetch_web.ts:20— fetch_web.isPrivateOrLocalHostname has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 6 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
file_tools.buildKnowledgeCorpus (cognitive 26) REDACTED:185— file_tools.buildKnowledgeCorpus has cognitive complexity 26 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 5 (9 pts), boolean chains 5 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
resolve_v6_page_gold_to_chunks.resolve (cognitive 26) experiments/version_aware_rag/scripts/v6/resolve_v6_page_gold_to_chunks.py:66— resolve_v6_page_gold_to_chunks.resolve has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 8 (13 pts), if/else 4 (6 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RelationEnrichedCandidateGenerator.candidates (cognitive 26) experiments/version_aware_rag/scripts/v6/v6r_retrieval_core.py:109— RelationEnrichedCandidateGenerator.candidates has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (5 pts), boolean chains 4, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pdf_to_clean_markdown.generate_table_text_description (cognitive 26) src/rag_clean/pdf_to_clean_markdown.py:46— pdf_to_clean_markdown.generate_table_text_description has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 3 (8 pts), loops 3 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build_v4_candidate_pairs.produceDuplicateConflictReport (cognitive 25) experiments/version_aware_rag/scripts/v4/build_v4_candidate_pairs.ts:533— build_v4_candidate_pairs.produceDuplicateConflictReport has cognitive complexity 25 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 4 (9 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 13). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run_r2_action_detector_validation.classify (cognitive 25) experiments/version_aware_rag/scripts/v5/run_r2_action_detector_validation.ts:44— run_r2_action_detector_validation.classify has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 5, ternaries 4 (5 pts), error handling 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build_v6_chunk_corpus.main (cognitive 25) experiments/version_aware_rag/scripts/v6/build_v6_chunk_corpus.py:68— build_v6_chunk_corpus.main has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 5 (6 pts), ternaries 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run_v6_pair_boost_sensitivity_on_prior_devval.evaluate (cognitive 25) experiments/version_aware_rag/scripts/v6/run_v6_pair_boost_sensitivity_on_prior_devval.py:67— run_v6_pair_boost_sensitivity_on_prior_devval.evaluate has cognitive complexity 25 (threshold 15). Drivers by points: loops 6 (9 pts), ternaries 3 (9 pts), boolean chains 5, if/else 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
db_tools.logDietWithClient (cognitive 24) agent_skills/db_tools.ts:112— db_tools.logDietWithClient has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 7, ternaries 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build_corpus.buildCorpus (cognitive 24) experiments/version_aware_rag/src/corpus/build_corpus.ts:62— build_corpus.buildCorpus has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (9 pts), boolean chains 2 (nesting depth added 12). Of this number, 14 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnswerMetricsEvaluator.computeAutomaticCitationProxyMetrics (cognitive 24) experiments/version_aware_rag/src/evaluation/answer_metrics.ts:102— AnswerMetricsEvaluator.computeAutomaticCitationProxyMetrics has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 10, if/else 3 (6 pts), ternaries 5, loops 3 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HeuristicRetriever.retrieve (cognitive 24) experiments/version_aware_rag/src/retrieval/heuristic.ts:23— HeuristicRetriever.retrieve has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 8). Of this number, 14 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
allocate_v6_query_slots.min_cost_flow (cognitive 24) experiments/version_aware_rag/scripts/v6/allocate_v6_query_slots.py:55— allocate_v6_query_slots.min_cost_flow has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 5 (10 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run_v6r_repair_diagnostic.evaluate_run (cognitive 24) experiments/version_aware_rag/scripts/v6/run_v6r_repair_diagnostic.py:100— run_v6r_repair_diagnostic.evaluate_run has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 7 (8 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RelationEnrichedCandidateGenerator.candidates (cognitive 23) src/server/versionAwareRag.ts:217— RelationEnrichedCandidateGenerator.candidates has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 8). Of this number, 17 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
assign_topics.assignTopicsAndMetadata (cognitive 23) experiments/version_aware_rag/src/corpus/assign_topics.ts:46— assign_topics.assignTopicsAndMetadata has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 4, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DenseRetriever.initializeIndex (cognitive 23) experiments/version_aware_rag/src/retrieval/dense.ts:24— DenseRetriever.initializeIndex has cognitive complexity 23 (threshold 15). Drivers by points: loops 7 (14 pts), if/else 2 (5 pts), boolean chains 4 (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
audit_v6_query_contract_drafts.main (cognitive 23) experiments/version_aware_rag/scripts/v6/audit_v6_query_contract_drafts.py:33— audit_v6_query_contract_drafts.main has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
build_policy_graph.main (cognitive 22) experiments/version_aware_rag/scripts/v3/build_policy_graph.ts:40— build_policy_graph.main has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 3, boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build_corpus.getLegacyChunkIds (cognitive 21) experiments/version_aware_rag/src/corpus/build_corpus.ts:17— build_corpus.getLegacyChunkIds has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11, boolean chains 10. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
run_r2_6_query_conditioned_development.trainTree (cognitive 21) experiments/version_aware_rag/scripts/v5/run_r2_6_query_conditioned_development.ts:141— run_r2_6_query_conditioned_development.trainTree has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (6 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 9). Of this number, 15 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
db_tools.getChatHistoryTool (cognitive 20) agent_skills/db_tools.ts:306— db_tools.getChatHistoryTool has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 2 (4 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
select_frozen_v3_runs.selectFrozenV3Runs (cognitive 20) experiments/version_aware_rag/scripts/diagnostics/select_frozen_v3_runs.ts:16— select_frozen_v3_runs.selectFrozenV3Runs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, error handling 1 (2 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
result_diversification.diversifyResults (cognitive 20) experiments/version_aware_rag/src/retrieval/result_diversification.ts:4— result_diversification.diversifyResults has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (12 pts), ternaries 1 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
segment_passages.segmentPage (cognitive 20) experiments/version_aware_rag/src/corpus/segment_passages.ts:131— segment_passages.segmentPage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build_splits.buildSplits::getTopicForQuery (cognitive 20) experiments/version_aware_rag/src/annotation/build_splits.ts:508— build_splits.buildSplits::getTopicForQuery has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 10. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (build_splits.buildSplits) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
r2_12_candidate_generator.generateR212CandidatePool (cognitive 20) experiments/version_aware_rag/src/retrieval/r2_12_candidate_generator.ts:36— r2_12_candidate_generator.generateR212CandidatePool has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 6 (7 pts), boolean chains 2 (nesting depth added 6). Of this number, 15 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run_r2_5_local_tree_development.train (cognitive 20) experiments/version_aware_rag/scripts/v5/run_r2_5_local_tree_development.ts:32— run_r2_5_local_tree_development.train has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (6 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 9). Of this number, 14 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build_r2_22_human_review_docx.add_instruction_sections (cognitive 20) experiments/version_aware_rag/scripts/v5/build_r2_22_human_review_docx.py:301— build_r2_22_human_review_docx.add_instruction_sections has cognitive complexity 20 (threshold 15). Drivers by points: loops 7 (9 pts), ternaries 9, if/else 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
audit_v6_final_query_review_coverage.main (cognitive 20) experiments/version_aware_rag/scripts/v6/audit_v6_final_query_review_coverage.py:69— audit_v6_final_query_review_coverage.main has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 pts), boolean chains 3, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
adapter.mapDocumentRow (cognitive 19) src/storage/supabase/adapter.ts:23— adapter.mapDocumentRow has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, ternaries 7. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
file_tools.scoreChunk (cognitive 19) REDACTED:294— file_tools.scoreChunk has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
retrieval_metrics.calculateQueryMetrics (cognitive 19) experiments/version_aware_rag/src/evaluation/retrieval_metrics.ts:25— retrieval_metrics.calculateQueryMetrics has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (10 pts), if/else 4 (5 pts), loops 3, boolean chains 1 (nesting depth added 2). Of this number, 17 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ragDocuments.mapDocumentRow (cognitive 19) REDACTED:315— ragDocuments.mapDocumentRow has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 13, ternaries 6. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
extract_v6_antigravity_response.main (cognitive 19) experiments/version_aware_rag/scripts/v6/extract_v6_antigravity_response.py:25— extract_v6_antigravity_response.main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
v6r_retrieval_core.select_best_relation_pair (cognitive 19) experiments/version_aware_rag/scripts/v6/v6r_retrieval_core.py:155— v6r_retrieval_core.select_best_relation_pair has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
evaluate_v7_pilot.main (cognitive 19) experiments/version_aware_rag/scripts/v7/evaluate_v7_pilot.py:68— evaluate_v7_pilot.main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 2 (4 pts), boolean chains 3, loops 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
versionAwareRag.selectBestRelationPair (cognitive 18) src/server/versionAwareRag.ts:270— versionAwareRag.selectBestRelationPair has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (4 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). Of this number, 16 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
segment_passages.splitLongBlock (cognitive 18) experiments/version_aware_rag/src/corpus/segment_passages.ts:41— segment_passages.splitLongBlock has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (5 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tune_recency_lambda.runTuning (cognitive 18) experiments/version_aware_rag/scripts/v3/tune_recency_lambda.ts:97— tune_recency_lambda.runTuning has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 5 (6 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run_focused_policy_development.runFocusedPolicyDevelopment (cognitive 18) experiments/version_aware_rag/scripts/v4/run_focused_policy_development.ts:38— run_focused_policy_development.runFocusedPolicyDevelopment has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (10 pts), boolean chains 8 (nesting depth added 5). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
relation_aware_pair_policy.selectRelationAwareTopK (cognitive 18) experiments/version_aware_rag/src/retrieval/relation_aware_pair_policy.ts:96— relation_aware_pair_policy.selectRelationAwareTopK has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, loops 2 (nesting depth added 5). Of this number, 16 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run_v5_relation_detector_development.evaluate (cognitive 18) experiments/version_aware_rag/scripts/v5/run_v5_relation_detector_development.ts:80— run_v5_relation_detector_development.evaluate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 4 (6 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
import_v6_query_review_delta.main (cognitive 18) experiments/version_aware_rag/scripts/v6/import_v6_query_review_delta.py:31— import_v6_query_review_delta.main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (4 pts), ternaries 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DenseRetriever.retrieve (cognitive 17) experiments/version_aware_rag/src/retrieval/dense.ts:70— DenseRetriever.retrieve has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (8 pts), boolean chains 5, if/else 3 (4 pts) (nesting depth added 4). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
PolicyEngine.resolve (cognitive 17) experiments/version_aware_rag/src/versioning/policy_engine.ts:18— PolicyEngine.resolve has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agentRuntime.callModel (cognitive 17) src/server/agentRuntime.ts:634— agentRuntime.callModel has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 8 (10 pts), boolean chains 6, if/else 1 (nesting depth added 2). Of this number, 11 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ragDocuments.parseMultipartUpload (cognitive 17) REDACTED:214— ragDocuments.parseMultipartUpload has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts), loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
build_v6_relation_consensus_ledger.main (cognitive 17) experiments/version_aware_rag/scripts/v6/build_v6_relation_consensus_ledger.py:50— build_v6_relation_consensus_ledger.main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3, boolean chains 2, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
resolve_v6_page_gold_to_chunks.main (cognitive 17) experiments/version_aware_rag/scripts/v6/resolve_v6_page_gold_to_chunks.py:137— resolve_v6_page_gold_to_chunks.main has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (8 pts), error handling 1 (4 pts), if/else 3, boolean chains 1, ternaries 1 (nesting depth added 6). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RelationGraph.loadGraph (cognitive 16) experiments/version_aware_rag/src/versioning/relation_graph.ts:26— RelationGraph.loadGraph has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), boolean chains 4, ternaries 2 (4 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
review_r2_14_candidate_groups.reviews (cognitive 16) experiments/version_aware_rag/scripts/v5/review_r2_14_candidate_groups.ts:101— review_r2_14_candidate_groups.reviews has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8 (15 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run_r2_18_candidate_failure_attribution.iterativeClosure (cognitive 16) experiments/version_aware_rag/scripts/v5/run_r2_18_candidate_failure_attribution.ts:63— run_r2_18_candidate_failure_attribution.iterativeClosure has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run_r2_19_neural_hybrid_diagnostic.iterativeClosure (cognitive 16) experiments/version_aware_rag/scripts/v5/run_r2_19_neural_hybrid_diagnostic.ts:92— run_r2_19_neural_hybrid_diagnostic.iterativeClosure has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build_v6_runtime_relation_graph.select (cognitive 16) experiments/version_aware_rag/scripts/v6/build_v6_runtime_relation_graph.py:43— build_v6_runtime_relation_graph.select has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (11 pts), if/else 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build_v6_runtime_relation_graph.main (cognitive 16) experiments/version_aware_rag/scripts/v6/build_v6_runtime_relation_graph.py:69— build_v6_runtime_relation_graph.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 4 (5 pts), boolean chains 3, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Change coupling: db_tools.ts ↔ REDACTED agent_skills/db_tools.ts:1— `agent_skills/db_tools.ts` and `REDACTED` change together 67% of the time (8 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `5811a2db` Add SQLite storage, storage facade, CLI, and docs; `b9e568de` bullshit conmmit v2 (at that commit the file was still `agent_skills/supabase_logger/db_tools.ts`); `b7ca4837` [feat] (at that commit the file was still `agent_skills/supabase_logger/db_tools.ts`) — run `git show` on any of them.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (6 members, 50+ identical tokens) experiments/version_aware_rag/scripts/v6/build_v6_final_review_gap_batch.py:52— experiments/version_aware_rag/scripts/v6/build_v6_final_review_gap_batch.py:52-84 | experiments/version_aware_rag/scripts/v6/build_v6_gemini_query_review_delta.py:53-96 | experiments/version_aware_rag/scripts/v6/build_v6_query_review_batch.py:52-104 | experiments/version_aware_rag/scripts/v6/build_v6_query_review_delta_23.py:57-88 | experiments/version_aware_rag/scripts/v6/build_v6_query_review_delta_26.py:56-77 | experiments/version_aware_rag/scripts/v6/build_v6_query_review_delta_4.py:48-68 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×1
Edited copy of a member (11 corresponding lines) experiments/version_aware_rag/scripts/v6/v6_retrieval_core.py:50— experiments/version_aware_rag/scripts/v6/v6_retrieval_core.py:50-61 | experiments/version_aware_rag/scripts/v6/v6r_retrieval_core.py:48-58 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (39 corresponding lines) · ×1
Edited copy of a member (39 corresponding lines) services/api/src/api/admin.rs:670— services/api/src/api/admin.rs:670-709 | services/api/src/api/user.rs:13-51 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×1
Edited copy of a member (28 corresponding lines) services/api/src/api/admin.rs:108— services/api/src/api/admin.rs:108-135 | services/api/src/api/admin.rs:273-300 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×1
Edited copy of a member (9 corresponding lines) experiments/version_aware_rag/scripts/v6/evaluate_v6_fresh_retrieval.py:106— experiments/version_aware_rag/scripts/v6/evaluate_v6_fresh_retrieval.py:106-117 | experiments/version_aware_rag/scripts/v7/evaluate_v7_pilot.py:57-65 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 30+ corresponding lines) · ×1
Edited copies of one member (3 members, 30+ corresponding lines) services/api/src/api/admin.rs:479— services/api/src/api/admin.rs:479-513 | services/api/src/api/admin.rs:519-553 | services/api/src/api/announcement.rs:18-47 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×1
Edited copy of a member (15 corresponding lines) services/api/src/api/agent_content.rs:36— services/api/src/api/agent_content.rs:36-60 | services/api/src/api/rag_document.rs:41-55 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×1
Edited copy of a member (17 corresponding lines) services/api/src/api/rag_document.rs:228— services/api/src/api/rag_document.rs:228-244 | services/api/src/api/rag_document.rs:246-262 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×1
Edited copy of a member (3 corresponding lines) experiments/version_aware_rag/scripts/v6/build_v6_runtime_relation_graph.py:34— experiments/version_aware_rag/scripts/v6/build_v6_runtime_relation_graph.py:34-36 | experiments/version_aware_rag/scripts/v6/resolve_v6_page_gold_to_chunks.py:57-59 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 14+ corresponding lines) · ×1
Edited copies of one member (3 members, 14+ corresponding lines) services/api/src/api/knowledge_graph.rs:159— services/api/src/api/knowledge_graph.rs:159-173 | services/api/src/api/knowledge_graph.rs:180-194 | services/api/src/api/knowledge_graph.rs:239-252 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×1
Edited copy of a member (13 corresponding lines) services/api/src/api/knowledge_graph.rs:124— services/api/src/api/knowledge_graph.rs:124-136 | services/api/src/api/rag_document.rs:510-522 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 2+ corresponding lines) · ×1
Edited copies of one member (7 members, 2+ corresponding lines) experiments/version_aware_rag/scripts/v6/allocate_v6_query_slots.py:43— experiments/version_aware_rag/scripts/v6/allocate_v6_query_slots.py:43-44 | experiments/version_aware_rag/scripts/v6/analyze_v6_relation_review_agreement.py:26-27 | experiments/version_aware_rag/scripts/v6/audit_v6_relation_candidates.py:32-33 | experiments/version_aware_rag/scripts/v6/build_v6_relation_consensus_ledger.py:42-43 | experiments/version_aware_rag/scripts/v6/build_v6_relation_review_batch.py:78-79 | experiments/version_aware_rag/scripts/v6/import_v6_external_relation_review.py:27-28 | experiments/version_aware_rag/scripts/v6/record_v6_codex_relation_review.py:20-21 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
Duplicated block (7–29 lines × 4) experiments/version_aware_rag/scripts/v6/build_v6_relation_review_batch.py:173— experiments/version_aware_rag/scripts/v6/build_v6_relation_review_batch.py:173-199 | experiments/version_aware_rag/scripts/v6/extract_v6_antigravity_response.py:83-111 | experiments/version_aware_rag/scripts/v6/import_v6_external_relation_review.py:157-178 | experiments/version_aware_rag/scripts/v6/record_v6_codex_relation_review.py:114-120 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/version_aware_rag/scripts/v6/build_v6_relation_review_batch.py:173` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22–24 lines × 2) src/rag_clean/pdf_to_clean_markdown.py:13— src/rag_clean/pdf_to_clean_markdown.py:13-34 | src/rag_clean/pdf_to_clean_markdown.py:47-70 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13–16 lines × 3) experiments/version_aware_rag/scripts/v6/build_v6_gemini_query_review_delta.py:83— experiments/version_aware_rag/scripts/v6/build_v6_gemini_query_review_delta.py:83-95 | experiments/version_aware_rag/scripts/v6/build_v6_query_review_delta_23.py:72-87 | experiments/version_aware_rag/scripts/v6/build_v6_query_review_delta_4.py:54-67 — before extracting anything, compare `experiments/version_aware_rag/scripts/v6/build_v6_gemini_query_review_delta.py` and `experiments/version_aware_rag/scripts/v6/build_v6_query_review_delta_23.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14–17 lines × 4) experiments/version_aware_rag/scripts/v6/build_v6_gemini_query_review_delta.py:81— experiments/version_aware_rag/scripts/v6/build_v6_gemini_query_review_delta.py:81-94 | experiments/version_aware_rag/scripts/v6/build_v6_query_review_delta_23.py:70-86 | experiments/version_aware_rag/scripts/v6/build_v6_query_review_delta_26.py:60-74 | experiments/version_aware_rag/scripts/v6/build_v6_query_review_delta_4.py:52-66 — before extracting anything, compare `experiments/version_aware_rag/scripts/v6/build_v6_gemini_query_review_delta.py` and `experiments/version_aware_rag/scripts/v6/build_v6_query_review_delta_23.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 5) experiments/version_aware_rag/scripts/v6/build_v6_final_review_gap_batch.py:71— experiments/version_aware_rag/scripts/v6/build_v6_final_review_gap_batch.py:71-83 | experiments/version_aware_rag/scripts/v6/build_v6_gemini_query_review_delta.py:86-95 | experiments/version_aware_rag/scripts/v6/build_v6_query_review_batch.py:92-103 | experiments/version_aware_rag/scripts/v6/build_v6_query_review_delta_23.py:75-87 | experiments/version_aware_rag/scripts/v6/build_v6_query_review_delta_4.py:57-67 — before extracting anything, compare `experiments/version_aware_rag/scripts/v6/build_v6_gemini_query_review_delta.py` and `experiments/version_aware_rag/scripts/v6/build_v6_query_review_delta_23.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `experiments/version_aware_rag/scripts/v6/build_v6_final_review_gap_batch.py:71` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `experiments/version_aware_rag/scripts/v6/build_v6_query_review_batch.py:91` calls `write_text`, `dumps` and `experiments/version_aware_rag/scripts/v6/build_v6_gemini_query_review_delta.py:85` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–10 lines × 2) experiments/version_aware_rag/scripts/v6/evaluate_v6_fresh_retrieval.py:134— experiments/version_aware_rag/scripts/v6/evaluate_v6_fresh_retrieval.py:134-143 | experiments/version_aware_rag/scripts/v7/evaluate_v7_pilot.py:78-85 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17 lines × 2) experiments/version_aware_rag/scripts/v7/consolidate_v7_hard_negative_delta.py:20— experiments/version_aware_rag/scripts/v7/consolidate_v7_hard_negative_delta.py:20-36 | experiments/version_aware_rag/scripts/v7/consolidate_v7_structured_review.py:20-36 — before extracting anything, compare `experiments/version_aware_rag/scripts/v7/consolidate_v7_hard_negative_delta.py` and `experiments/version_aware_rag/scripts/v7/consolidate_v7_structured_review.py` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) experiments/version_aware_rag/scripts/v6/evaluate_v6_fresh_retrieval.py:124— experiments/version_aware_rag/scripts/v6/evaluate_v6_fresh_retrieval.py:124-129 | experiments/version_aware_rag/scripts/v7/evaluate_v7_pilot.py:70-75 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (4–5 lines × 3) experiments/version_aware_rag/scripts/v7/build_v7_review_packets.py:67— experiments/version_aware_rag/scripts/v7/build_v7_review_packets.py:67-70 | experiments/version_aware_rag/scripts/v7/build_v7_review_packets.py:75-79 | experiments/version_aware_rag/scripts/v7/build_v7_review_packets.py:82-86 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16 lines × 2) services/api/src/api/admin.rs:498— services/api/src/api/admin.rs:498-513 | services/api/src/api/admin.rs:538-553 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `services/api/src/api/admin.rs:498` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 3) services/api/src/api/admin.rs:498— services/api/src/api/admin.rs:498-513 | services/api/src/api/admin.rs:538-553 | services/api/src/api/announcement.rs:32-47 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `services/api/src/api/admin.rs:498` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) services/api/src/api/agent_content.rs:98— services/api/src/api/agent_content.rs:98-108 | services/api/src/api/rag_document.rs:182-192 — before extracting anything, compare `services/api/src/api/agent_content.rs` and `services/api/src/api/rag_document.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) services/api/src/api/login.rs:59— services/api/src/api/login.rs:59-66 | services/api/src/api/refresh.rs:75-82 | services/api/src/api/register.rs:95-102 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `services/api/src/api/login.rs:59` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) services/api/src/utils/jwt.rs:63— services/api/src/utils/jwt.rs:63-70 | services/api/src/utils/jwt.rs:73-80 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Off the main sequence: src/config — src/config: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Fake-async — async method never awaits experiments/version_aware_rag/scripts/classify_conflicts.ts:21— `classifyConflictRelation` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
P12 · CI test-gate honesty· Test suite runs only after the merge · ×1
Test suite runs only after the merge — `REDACTED` run(s) the test suite, but no workflow that runs tests is triggered by a pull request (or a merge queue) — so the suite reports on code that is already on the default branch. A red build there blocks nothing and the only remedy is a revert. Add the pull-request trigger to the workflow that runs your suite so the gate applies before the merge, not after it.
Duplication concentrated across 5 sibling directories (34 clone groups) experiments/version_aware_rag/scripts/v4/prepare_v4_devval_sources.ts:123— 34 duplicated blocks under experiments/version_aware_rag/scripts/ have copies in at least two of the sibling directories diagnostics, v3, v4, v5, v6 — 31 of them are reported below, and 3 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 34 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 34 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 34 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 2 sibling directories (14 clone groups) experiments/version_aware_rag/scripts/run_retrieval_eval.ts:72— 14 duplicated blocks under experiments/version_aware_rag/ have copies in at least two of the sibling directories scripts, src — 10 of them are reported below, and 4 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 14 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 14 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 14 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 4 sibling directories (9 clone groups) agent_skills/conversation_summary_tool.ts:23— 9 duplicated blocks under the repository root have copies in at least two of the sibling directories agent_skills, experiments, scripts, src — 7 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 9 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 9 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 9 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Wholesale file copy (279 identical lines × 2 files) experiments/version_aware_rag/scripts/v5/run_r2_14_confirmation.ts:1— experiments/version_aware_rag/scripts/v5/run_r2_14_confirmation.ts:1 · experiments/version_aware_rag/scripts/v5/run_r2_16_confirmation.ts:1 — these 2 files are line-for-line copies of one another — 279 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (201 matched lines × 2 locations) · ×1
Duplicated block with local edits (201 matched lines × 2 locations) experiments/version_aware_rag/scripts/v5/run_r2_19_neural_hybrid_diagnostic.ts:39— experiments/version_aware_rag/scripts/v5/run_r2_19_neural_hybrid_diagnostic.ts:39 · experiments/version_aware_rag/scripts/v5/run_r2_20_neural_hybrid_confirmation.ts:41 — the two spans are one implementation copied and then locally edited — 1572 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Wholesale file copy (173 identical lines × 2 files) experiments/version_aware_rag/scripts/v5/freeze_r2_14_confirmation.ts:1— experiments/version_aware_rag/scripts/v5/freeze_r2_14_confirmation.ts:1 · experiments/version_aware_rag/scripts/v5/freeze_r2_16_confirmation.ts:1 — these 2 files are line-for-line copies of one another — 173 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (168 matched lines × 2 locations) · ×1
Duplicated block with local edits (168 matched lines × 2 locations) experiments/version_aware_rag/scripts/v5/mine_r2_16_candidate_groups.ts:41— experiments/version_aware_rag/scripts/v5/mine_r2_16_candidate_groups.ts:41 · experiments/version_aware_rag/scripts/v5/mine_r2_20_candidate_groups.ts:130 — the two spans are one implementation copied and then locally edited — 1216 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Wholesale file copy (164 identical lines × 2 files) experiments/version_aware_rag/scripts/v5/build_r2_16_confirmation_annotations.ts:1— experiments/version_aware_rag/scripts/v5/build_r2_16_confirmation_annotations.ts:1 · experiments/version_aware_rag/scripts/v5/build_r2_20_confirmation_annotations.ts:1 — these 2 files are line-for-line copies of one another — 164 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
Wholesale file copy (163 identical lines × 3 files) experiments/version_aware_rag/src/annotation/validate_r2_14_confirmation.ts:7— experiments/version_aware_rag/src/annotation/validate_r2_14_confirmation.ts:7 · experiments/version_aware_rag/src/annotation/validate_r2_16_confirmation.ts:7 · experiments/version_aware_rag/src/annotation/validate_r2_20_confirmation.ts:7 — these 3 files are line-for-line copies of one another — 163 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (154 matched lines × 2 locations) · ×1
Duplicated block with local edits (154 matched lines × 2 locations) experiments/version_aware_rag/scripts/v5/run_r2_18_candidate_failure_attribution.ts:10— experiments/version_aware_rag/scripts/v5/run_r2_18_candidate_failure_attribution.ts:10 · experiments/version_aware_rag/scripts/v5/run_r2_19_neural_hybrid_diagnostic.ts:15 — the two spans are one implementation copied and then locally edited — 1544 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (150 lines × 4 locations) experiments/version_aware_rag/src/annotation/validate_r2_12_confirmation.ts:91— experiments/version_aware_rag/src/annotation/validate_r2_12_confirmation.ts:91 · experiments/version_aware_rag/src/annotation/validate_r2_14_confirmation.ts:80 · experiments/version_aware_rag/src/annotation/validate_r2_16_confirmation.ts:80 · experiments/version_aware_rag/src/annotation/validate_r2_20_confirmation.ts:80 — the 4 copies are spread across 4 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Wholesale file copy (148 identical lines × 2 files) experiments/version_aware_rag/scripts/v5/mine_r2_14_candidate_groups.ts:1— experiments/version_aware_rag/scripts/v5/mine_r2_14_candidate_groups.ts:1 · experiments/version_aware_rag/scripts/v5/mine_r2_16_candidate_groups.ts:1 — these 2 files are line-for-line copies of one another — 148 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (130 matched lines × 2 locations) · ×1
Duplicated block with local edits (130 matched lines × 2 locations) experiments/version_aware_rag/scripts/v5/run_r2_18_candidate_failure_attribution.ts:30— experiments/version_aware_rag/scripts/v5/run_r2_18_candidate_failure_attribution.ts:30 · experiments/version_aware_rag/scripts/v5/run_r2_21_lexical_weighted_rrf_diagnostic.ts:33 — the two spans are one implementation copied and then locally edited — 1277 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (111 matched lines × 2 locations) · ×1
Duplicated block with local edits (111 matched lines × 2 locations) experiments/version_aware_rag/scripts/v5/run_r2_13_top3_diagnostic.ts:13— experiments/version_aware_rag/scripts/v5/run_r2_13_top3_diagnostic.ts:13 · experiments/version_aware_rag/scripts/v5/run_r2_15_compatible_selectivity_diagnostic.ts:21 — the two spans are one implementation copied and then locally edited — 908 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (92 matched lines × 2 locations) · ×1
Duplicated block with local edits (92 matched lines × 2 locations) experiments/version_aware_rag/scripts/v5/run_r2_8_shared_pool_development.ts:29— experiments/version_aware_rag/scripts/v5/run_r2_8_shared_pool_development.ts:29 · experiments/version_aware_rag/scripts/v5/run_r2_9_retrieval_validation.ts:22 — the two spans are one implementation copied and then locally edited — 1527 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (89 lines × 2 locations) experiments/version_aware_rag/scripts/v5/run_r2_16_confirmation.ts:78— experiments/version_aware_rag/scripts/v5/run_r2_16_confirmation.ts:78 · experiments/version_aware_rag/scripts/v5/run_r2_20_neural_hybrid_confirmation.ts:101 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (81 lines × 2 locations) experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts:387— experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts:387 · experiments/version_aware_rag/scripts/v5/build_r2_14_confirmation_annotations.ts:388 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (79 matched lines × 2 locations) · ×1
Duplicated block with local edits (79 matched lines × 2 locations) experiments/version_aware_rag/scripts/v5/audit_r2_18_candidate_failure_attribution.ts:9— experiments/version_aware_rag/scripts/v5/audit_r2_18_candidate_failure_attribution.ts:9 · experiments/version_aware_rag/scripts/v5/audit_r2_19_neural_hybrid_diagnostic.ts:12 — the two spans are one implementation copied and then locally edited — 570 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (70 matched lines × 2 locations) · ×1
Duplicated block with local edits (70 matched lines × 2 locations) experiments/version_aware_rag/scripts/v5/audit_r2_14_confirmation.ts:39— experiments/version_aware_rag/scripts/v5/audit_r2_14_confirmation.ts:39 · experiments/version_aware_rag/scripts/v5/audit_r2_15_compatible_selectivity_diagnostic.ts:23 — the two spans are one implementation copied and then locally edited — 450 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (68 lines × 2 locations) experiments/version_aware_rag/scripts/v5/run_r2_12_confirmation.ts:41— experiments/version_aware_rag/scripts/v5/run_r2_12_confirmation.ts:41 · experiments/version_aware_rag/scripts/v5/run_r2_14_confirmation.ts:40 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (61 lines × 2 locations) experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts:514— experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts:514 · experiments/version_aware_rag/scripts/v5/build_r2_14_confirmation_annotations.ts:504 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (61 matched lines × 2 locations) · ×1
Duplicated block with local edits (61 matched lines × 2 locations) experiments/version_aware_rag/scripts/v5/freeze_r2_13_top3_diagnostic.ts:33— experiments/version_aware_rag/scripts/v5/freeze_r2_13_top3_diagnostic.ts:33 · experiments/version_aware_rag/scripts/v5/freeze_r2_15_compatible_selectivity_diagnostic.ts:36 — the two spans are one implementation copied and then locally edited — 334 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (59 lines × 3 locations) experiments/version_aware_rag/scripts/v5/run_r2_12_confirmation.ts:116— experiments/version_aware_rag/scripts/v5/run_r2_12_confirmation.ts:116 · experiments/version_aware_rag/scripts/v5/run_r2_14_confirmation.ts:129 · experiments/version_aware_rag/scripts/v5/run_r2_16_confirmation.ts:151 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (50 matched lines × 2 locations) · ×1
Duplicated block with local edits (50 matched lines × 2 locations) experiments/version_aware_rag/scripts/v5/build_r2_7_preaudited_cross_version_split.ts:266— experiments/version_aware_rag/scripts/v5/build_r2_7_preaudited_cross_version_split.ts:266 · experiments/version_aware_rag/scripts/v5/build_r2_9_retrieval_validation.ts:146 — the two spans are one implementation copied and then locally edited — 614 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (49 matched lines × 2 locations) · ×1
Duplicated block with local edits (49 matched lines × 2 locations) experiments/version_aware_rag/scripts/v5/audit_r2_16_confirmation.ts:54— experiments/version_aware_rag/scripts/v5/audit_r2_16_confirmation.ts:54 · experiments/version_aware_rag/scripts/v5/audit_r2_20_neural_hybrid_confirmation.ts:77 — the two spans are one implementation copied and then locally edited — 336 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (47 lines × 2 locations) REDACTED:94— REDACTED:94 · REDACTED:93 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (44 lines × 2 locations) experiments/version_aware_rag/scripts/v5/audit_r2_12_confirmation.ts:17— experiments/version_aware_rag/scripts/v5/audit_r2_12_confirmation.ts:17 · experiments/version_aware_rag/scripts/v5/audit_r2_14_confirmation.ts:38 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (44 matched lines × 2 locations) · ×1
Duplicated block with local edits (44 matched lines × 2 locations) experiments/version_aware_rag/src/retrieval/bm25.ts:42— experiments/version_aware_rag/src/retrieval/bm25.ts:42 · experiments/version_aware_rag/src/retrieval/dense.ts:29 — the two spans are one implementation copied and then locally edited — 335 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (43 lines × 4 locations) experiments/version_aware_rag/src/annotation/validate_r2_12_confirmation.ts:36— experiments/version_aware_rag/src/annotation/validate_r2_12_confirmation.ts:36 · experiments/version_aware_rag/src/annotation/validate_r2_14_confirmation.ts:32 · experiments/version_aware_rag/src/annotation/validate_r2_16_confirmation.ts:32 · experiments/version_aware_rag/src/annotation/validate_r2_20_confirmation.ts:32 — the 4 copies are spread across 4 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (41 lines × 2 locations) experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts:603— experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts:603 · experiments/version_aware_rag/scripts/v5/build_r2_14_confirmation_annotations.ts:593 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (41 lines × 3 locations) experiments/version_aware_rag/scripts/v5/freeze_r2_12_confirmation.ts:119— experiments/version_aware_rag/scripts/v5/freeze_r2_12_confirmation.ts:119 · experiments/version_aware_rag/scripts/v5/freeze_r2_14_confirmation.ts:129 · experiments/version_aware_rag/scripts/v5/freeze_r2_16_confirmation.ts:130 — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
R10 · Code Duplication· Duplicated block with local edits (37 matched lines × 2 locations) · ×1
Duplicated block with local edits (37 matched lines × 2 locations) src/storage/supabase/adapter.ts:205— src/storage/supabase/adapter.ts:205 · src/storage/supabase/adapter.ts:261 — the two spans are one implementation copied and then locally edited — 387 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (36 lines × 2 locations) experiments/version_aware_rag/scripts/v5/review_r2_16_candidate_groups.ts:59— experiments/version_aware_rag/scripts/v5/review_r2_16_candidate_groups.ts:59 · experiments/version_aware_rag/scripts/v5/review_r2_20_candidate_groups.ts:104 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (35 lines × 2 locations) experiments/version_aware_rag/scripts/v4/prepare_v4_devval_sources.ts:123— experiments/version_aware_rag/scripts/v4/prepare_v4_devval_sources.ts:123 · experiments/version_aware_rag/scripts/v5/prepare_r2_11_sources.ts:116 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Complex function retrieve (cyclomatic 84, cognitive 133) experiments/version_aware_rag/src/retrieval/version_aware.ts:98— retrieve has cyclomatic complexity 84 and cognitive complexity 133; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function validateAnnotations (cyclomatic 83, cognitive 188) experiments/version_aware_rag/src/annotation/validate_annotations.ts:16— validateAnnotations has cyclomatic complexity 83 and cognitive complexity 188; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function runV4PolicyRepairPipeline (cyclomatic 56, cognitive 97) experiments/version_aware_rag/scripts/v4/run_v4_policy_repair.ts:166— runV4PolicyRepairPipeline has cyclomatic complexity 56 and cognitive complexity 97; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 47, cognitive 38) agent_skills/db_tools.ts:396— (anonymous) has cyclomatic complexity 47 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildSplits (cyclomatic 45, cognitive 77) experiments/version_aware_rag/src/annotation/build_splits.ts:22— buildSplits has cyclomatic complexity 45 and cognitive complexity 77; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function chatHandler (cyclomatic 42, cognitive 55) REDACTED:599— chatHandler has cyclomatic complexity 42 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function main (cyclomatic 40, cognitive 67) · ×1
Complex function main (cyclomatic 40, cognitive 67) experiments/version_aware_rag/scripts/v3/run_experiment.ts:58— main has cyclomatic complexity 40 and cognitive complexity 67; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function attributeFailure (cyclomatic 40, cognitive 43) experiments/version_aware_rag/src/diagnostics/stage_attribution.ts:8— attributeFailure has cyclomatic complexity 40 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function validateR212ConfirmationLedger (cyclomatic 39, cognitive 69) experiments/version_aware_rag/src/annotation/validate_r2_12_confirmation.ts:44— validateR212ConfirmationLedger has cyclomatic complexity 39 and cognitive complexity 69; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function validateR214ConfirmationLedger (cyclomatic 39, cognitive 69) experiments/version_aware_rag/src/annotation/validate_r2_14_confirmation.ts:40— validateR214ConfirmationLedger has cyclomatic complexity 39 and cognitive complexity 69; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function validateR216ConfirmationLedger (cyclomatic 39, cognitive 69) experiments/version_aware_rag/src/annotation/validate_r2_16_confirmation.ts:40— validateR216ConfirmationLedger has cyclomatic complexity 39 and cognitive complexity 69; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function validateR220ConfirmationLedger (cyclomatic 39, cognitive 69) experiments/version_aware_rag/src/annotation/validate_r2_20_confirmation.ts:40— validateR220ConfirmationLedger has cyclomatic complexity 39 and cognitive complexity 69; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 39, cognitive 41) src/server/imageStorage.ts:50— (anonymous) has cyclomatic complexity 39 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function compareRecencyAndOracle (cyclomatic 34, cognitive 48) experiments/version_aware_rag/scripts/diagnostics/compare_recency_oracle.ts:28— compareRecencyAndOracle has cyclomatic complexity 34 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function main (cyclomatic 34, cognitive 48) · ×1
Complex function main (cyclomatic 34, cognitive 48) experiments/version_aware_rag/scripts/v3/import_and_adjudicate_answer_annotations.ts:76— main has cyclomatic complexity 34 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function validateR211DevelopmentLedger (cyclomatic 29, cognitive 55) experiments/version_aware_rag/src/annotation/validate_r2_11_development.ts:53— validateR211DevelopmentLedger has cyclomatic complexity 29 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function runOracleCounterfactuals (cyclomatic 29, cognitive 53) experiments/version_aware_rag/scripts/diagnostics/run_oracle_counterfactuals.ts:26— runOracleCounterfactuals has cyclomatic complexity 29 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 29, cognitive 37) experiments/version_aware_rag/scripts/diagnostics/trace_oracle_retrieval.ts:65— (anonymous) has cyclomatic complexity 29 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function main (cyclomatic 29, cognitive 32) · ×1
Complex function main (cyclomatic 29, cognitive 32) experiments/version_aware_rag/scripts/v3/build_paper_tables.ts:97— main has cyclomatic complexity 29 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function work (cyclomatic 28, cognitive 55) · ×1
Complex function work (cyclomatic 28, cognitive 55) src/server/agentRuntime.ts:799— work has cyclomatic complexity 28 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function auditCorpus (cyclomatic 28, cognitive 52) experiments/version_aware_rag/src/corpus/audit_corpus.ts:48— auditCorpus has cyclomatic complexity 28 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildOracleDiagnosisReport (cyclomatic 28, cognitive 30) experiments/version_aware_rag/scripts/diagnostics/build_oracle_diagnosis_report.ts:22— buildOracleDiagnosisReport has cyclomatic complexity 28 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function main (cyclomatic 28, cognitive 24) · ×1
Complex function main (cyclomatic 28, cognitive 24) experiments/version_aware_rag/scripts/v3/classify_relations.ts:34— main has cyclomatic complexity 28 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function expandCompatibleChunks (cyclomatic 26, cognitive 72) experiments/version_aware_rag/src/retrieval/compatibility_expansion.ts:4— expandCompatibleChunks has cyclomatic complexity 26 and cognitive complexity 72; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildChunksFromMarkdown (cyclomatic 26, cognitive 37) experiments/version_aware_rag/scripts/build_chunks.ts:18— buildChunksFromMarkdown has cyclomatic complexity 26 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function computeClassificationMetrics (cyclomatic 25, cognitive 43) experiments/version_aware_rag/src/evaluation/classification_metrics.ts:23— computeClassificationMetrics has cyclomatic complexity 25 and cognitive complexity 43; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 25, cognitive 31) scripts/sync-mohw-clarifications.ts:233— (anonymous) has cyclomatic complexity 25 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function logDietWithClient (cyclomatic 25, cognitive 25) agent_skills/db_tools.ts:112— logDietWithClient has cyclomatic complexity 25 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function classify (cyclomatic 24, cognitive 36) experiments/version_aware_rag/scripts/v5/run_r2_action_detector_development.ts:61— classify has cyclomatic complexity 24 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 23, cognitive 28) agent_skills/fetch_web.ts:20— (anonymous) has cyclomatic complexity 23 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function getLegacyChunkIds (cyclomatic 23, cognitive 21) experiments/version_aware_rag/src/corpus/build_corpus.ts:17— getLegacyChunkIds has cyclomatic complexity 23 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function computeAutomaticCitationProxyMetrics (cyclomatic 22, cognitive 24) experiments/version_aware_rag/src/evaluation/answer_metrics.ts:102— computeAutomaticCitationProxyMetrics has cyclomatic complexity 22 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function classify (cyclomatic 21, cognitive 34) experiments/version_aware_rag/scripts/v5/run_v5_relation_detector_development.ts:30— classify has cyclomatic complexity 21 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 21, cognitive 20) experiments/version_aware_rag/src/annotation/build_splits.ts:508— (anonymous) has cyclomatic complexity 21 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function updateKnowledgeDocument (cyclomatic 21, cognitive 20) src/storage/supabase/adapter.ts:234— updateKnowledgeDocument has cyclomatic complexity 21 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function resolvePolicyState (cyclomatic 20, cognitive 33) experiments/version_aware_rag/src/versioning/relation_graph.ts:103— resolvePolicyState has cyclomatic complexity 20 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function main (cyclomatic 20, cognitive 30) · ×1
Complex function main (cyclomatic 20, cognitive 30) experiments/version_aware_rag/scripts/v4/build_v4_candidate_pairs.ts:66— main has cyclomatic complexity 20 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function getChatHistoryWithClient (cyclomatic 20, cognitive 28) agent_skills/db_tools.ts:233— getChatHistoryWithClient has cyclomatic complexity 20 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 20, cognitive 19) src/storage/supabase/adapter.ts:23— (anonymous) has cyclomatic complexity 20 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 20, cognitive 18) REDACTED:315— (anonymous) has cyclomatic complexity 20 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files· experiments/version_aware_rag/src/annotation/build_splits.ts · ×1
experiments/version_aware_rag/src/annotation/build_splits.ts: 1268 lines of code experiments/version_aware_rag/src/annotation/build_splits.ts:1— experiments/version_aware_rag/src/annotation/build_splits.ts has 1268 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 942 lines of code REDACTED:1— REDACTED has 942 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· experiments/version_aware_rag/scripts/v5/build_r2_11_remaining_annotations.ts · ×1
experiments/version_aware_rag/scripts/v5/build_r2_11_remaining_annotations.ts: 893 lines of code experiments/version_aware_rag/scripts/v5/build_r2_11_remaining_annotations.ts:1— experiments/version_aware_rag/scripts/v5/build_r2_11_remaining_annotations.ts has 893 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/server/agentRuntime.ts: 828 lines of code src/server/agentRuntime.ts:1— src/server/agentRuntime.ts has 828 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 766 lines of code REDACTED:1— REDACTED has 766 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· experiments/version_aware_rag/scripts/v4/run_v4_policy_repair.ts · ×1
experiments/version_aware_rag/scripts/v4/run_v4_policy_repair.ts: 703 lines of code experiments/version_aware_rag/scripts/v4/run_v4_policy_repair.ts:1— experiments/version_aware_rag/scripts/v4/run_v4_policy_repair.ts has 703 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts · ×1
experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts: 639 lines of code experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts:1— experiments/version_aware_rag/scripts/v5/build_r2_12_confirmation_annotations.ts has 639 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· experiments/version_aware_rag/scripts/v5/run_r2_11_development.ts · ×1
experiments/version_aware_rag/scripts/v5/run_r2_11_development.ts: 631 lines of code experiments/version_aware_rag/scripts/v5/run_r2_11_development.ts:1— experiments/version_aware_rag/scripts/v5/run_r2_11_development.ts has 631 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· experiments/version_aware_rag/scripts/v5/build_r2_14_confirmation_annotations.ts · ×1
experiments/version_aware_rag/scripts/v5/build_r2_14_confirmation_annotations.ts: 627 lines of code experiments/version_aware_rag/scripts/v5/build_r2_14_confirmation_annotations.ts:1— experiments/version_aware_rag/scripts/v5/build_r2_14_confirmation_annotations.ts has 627 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 584 lines of code REDACTED:1— REDACTED has 584 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· experiments/version_aware_rag/scripts/v4/build_v4_candidate_pairs.ts · ×1
experiments/version_aware_rag/scripts/v4/build_v4_candidate_pairs.ts: 573 lines of code experiments/version_aware_rag/scripts/v4/build_v4_candidate_pairs.ts:1— experiments/version_aware_rag/scripts/v4/build_v4_candidate_pairs.ts has 573 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· experiments/version_aware_rag/scripts/v5/run_r2_20_neural_hybrid_confirmation.ts · ×1
experiments/version_aware_rag/scripts/v5/run_r2_20_neural_hybrid_confirmation.ts: 561 lines of code experiments/version_aware_rag/scripts/v5/run_r2_20_neural_hybrid_confirmation.ts:1— experiments/version_aware_rag/scripts/v5/run_r2_20_neural_hybrid_confirmation.ts has 561 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/server/versionAwareRag.ts · ×1
src/server/versionAwareRag.ts: 457 lines of code src/server/versionAwareRag.ts:1— src/server/versionAwareRag.ts has 457 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
agent_skills/db_tools.ts: 449 lines of code agent_skills/db_tools.ts:1— agent_skills/db_tools.ts has 449 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· experiments/version_aware_rag/src/retrieval/version_aware.ts · ×1
experiments/version_aware_rag/src/retrieval/version_aware.ts: 449 lines of code experiments/version_aware_rag/src/retrieval/version_aware.ts:1— experiments/version_aware_rag/src/retrieval/version_aware.ts has 449 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· experiments/version_aware_rag/scripts/v4/run_v4_dev_model_selection.ts · ×1
experiments/version_aware_rag/scripts/v4/run_v4_dev_model_selection.ts: 447 lines of code experiments/version_aware_rag/scripts/v4/run_v4_dev_model_selection.ts:1— experiments/version_aware_rag/scripts/v4/run_v4_dev_model_selection.ts has 447 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· experiments/version_aware_rag/scripts/v5/run_r2_16_confirmation.ts · ×1
experiments/version_aware_rag/scripts/v5/run_r2_16_confirmation.ts: 433 lines of code experiments/version_aware_rag/scripts/v5/run_r2_16_confirmation.ts:1— experiments/version_aware_rag/scripts/v5/run_r2_16_confirmation.ts has 433 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/storage/sqlite/adapter.ts · ×1
src/storage/sqlite/adapter.ts: 430 lines of code src/storage/sqlite/adapter.ts:1— src/storage/sqlite/adapter.ts has 430 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 414 lines of code REDACTED:1— REDACTED has 414 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· experiments/version_aware_rag/scripts/v3/run_experiment.ts · ×1
experiments/version_aware_rag/scripts/v3/run_experiment.ts: 404 lines of code experiments/version_aware_rag/scripts/v3/run_experiment.ts:1— experiments/version_aware_rag/scripts/v3/run_experiment.ts has 404 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· experiments/version_aware_rag/scripts/v5/run_r2_14_confirmation.ts · ×1
experiments/version_aware_rag/scripts/v5/run_r2_14_confirmation.ts: 404 lines of code experiments/version_aware_rag/scripts/v5/run_r2_14_confirmation.ts:1— experiments/version_aware_rag/scripts/v5/run_r2_14_confirmation.ts has 404 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R6 · Tooling· No test, lint or typecheck script · ×1
No test, lint or typecheck script — test ✗ · lint ✗ · typecheck ✗ — read from this repository's REDACTED scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
Unused dependency '@langchain/tavily' REDACTED:13— Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'body-parser' REDACTED:15— Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'deepagents' REDACTED:18— Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'langchain' REDACTED:21— Declared in the root REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
X29 · Per-element action decided by a fixed element· Per-element action decided by a fixed element · ×1
Per-element action decided by a fixed element experiments/version_aware_rag/src/retrieval/relation_aware_pair_policy.ts:121— This loop runs once per element of `sorted`, and the statement it guards acts on the element it is on — `item`. The test deciding whether that statement runs does not: `chosen.length >= topK` reads `sorted[0]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts — the fixed one at line 107, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out.
Swallowed exception (caught, then discarded) REDACTED:77— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Duplicated predicate agent_skills/conversation_summary_tool.ts:29— `!candidate || typeof candidate !== 'object'` appears character-identically in 2 files — agent_skills/conversation_summary_tool.ts, src/server/profileApproval.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/v5/mine_r2_14_candidate_groups.ts:71— `!excludedChunkIds.has(chunk.chunk_id) && chunk.text.length >= 220 && chunk.text.length <= 4200 && !methodLike && urlCount <= 1` appears character-identically in 2 files — experiments/version_aware_rag/scripts/v5/mine_r2_14_candidate_groups.ts, experiments/version_aware_rag/scripts/v5/mine_r2_16_candidate_groups.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/v5/build_r2_16_confirmation_annotations.ts:87— `!group || !eligible.has(spec.group) || plan.get(spec.group) !== spec.stratum` appears character-identically in 2 files — experiments/version_aware_rag/scripts/v5/build_r2_16_confirmation_annotations.ts, experiments/version_aware_rag/scripts/v5/build_r2_20_confirmation_annotations.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/src/annotation/validate_r2_14_confirmation.ts:122— `!implicit && record.required_retained_evidence.length > 0` appears character-identically in 3 files — experiments/version_aware_rag/src/annotation/validate_r2_14_confirmation.ts, experiments/version_aware_rag/src/annotation/validate_r2_16_confirmation.ts, experiments/version_aware_rag/src/annotation/validate_r2_20_confirmation.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/v3/run_experiment.ts:195— `'published_year' in c && typeof (c as any).published_year === 'number'` appears character-identically in 2 files — experiments/version_aware_rag/scripts/v3/run_experiment.ts, experiments/version_aware_rag/src/retrieval/heuristic.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/v5/mine_r2_14_candidate_groups.ts:122— `a.chunk.text.toLowerCase().includes(anchor) && b.chunk.text.toLowerCase().includes(anchor)` appears character-identically in 3 files — experiments/version_aware_rag/scripts/v5/mine_r2_14_candidate_groups.ts, experiments/version_aware_rag/scripts/v5/mine_r2_16_candidate_groups.ts, experiments/version_aware_rag/scripts/v5/mine_r2_20_candidate_groups.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/v3/run_experiment.ts:29— `args[i] === '--config' && i + 1 < args.length` appears character-identically in 2 files — experiments/version_aware_rag/scripts/v3/run_experiment.ts, experiments/version_aware_rag/scripts/v3/validate_experiment.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/v3/build_policy_graph.ts:14— `args[i] === '--model' && i + 1 < args.length` appears character-identically in 2 files — experiments/version_aware_rag/scripts/v3/build_policy_graph.ts, experiments/version_aware_rag/scripts/v3/classify_relations.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/v3/build_paper_tables.ts:32— `args[i] === '--outputDir' && i + 1 < args.length` appears character-identically in 3 files — experiments/version_aware_rag/scripts/v3/build_paper_tables.ts, experiments/version_aware_rag/scripts/v3/import_and_adjudicate_answer_annotations.ts, experiments/version_aware_rag/scripts/v3/run_statistics.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/v3/classify_relations.ts:16— `args[i] === '--split' && i + 1 < args.length` appears character-identically in 2 files — experiments/version_aware_rag/scripts/v3/classify_relations.ts, experiments/version_aware_rag/scripts/v3/run_experiment.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/v5/mine_r2_14_candidate_groups.ts:111— `b.anchorCount - a.anchorCount || a.chunk.chunk_id.localeCompare(b.chunk.chunk_id)` appears character-identically in 3 files — experiments/version_aware_rag/scripts/v5/mine_r2_14_candidate_groups.ts, experiments/version_aware_rag/scripts/v5/mine_r2_16_candidate_groups.ts, experiments/version_aware_rag/scripts/v5/mine_r2_20_candidate_groups.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/v4/run_v4_dev_model_selection.ts:74— `b.final_score - a.final_score || a.chunk_id.localeCompare(b.chunk_id)` appears character-identically in 2 files — experiments/version_aware_rag/scripts/v4/run_v4_dev_model_selection.ts, experiments/version_aware_rag/src/retrieval/relation_aware_pair_policy.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/v5/run_r2_3_local_action_detector_development.ts:108— `b.metrics.pair_preserve_recall - a.metrics.pair_preserve_recall || b.metrics.accuracy - a.metrics.accuracy` appears character-identically in 2 files — experiments/version_aware_rag/scripts/v5/run_r2_3_local_action_detector_development.ts, experiments/version_aware_rag/scripts/v5/run_r2_action_detector_development.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/v5/run_r2_8_shared_pool_development.ts:87— `b.recency_score - a.recency_score || a.item_id.localeCompare(b.item_id)` appears character-identically in 2 files — experiments/version_aware_rag/scripts/v5/run_r2_8_shared_pool_development.ts, experiments/version_aware_rag/scripts/v5/run_r2_9_retrieval_validation.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/v5/mine_r2_14_candidate_groups.ts:136— `b.score - a.score || a.a.chunk.chunk_id.localeCompare(b.a.chunk.chunk_id) || a.b.chunk.chunk_id.localeCompare(b.b.chunk.chunk_id)` appears character-identically in 3 files — experiments/version_aware_rag/scripts/v5/mine_r2_14_candidate_groups.ts, experiments/version_aware_rag/scripts/v5/mine_r2_16_candidate_groups.ts, experiments/version_aware_rag/scripts/v5/mine_r2_20_candidate_groups.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/v5/run_r2_8_shared_pool_development.ts:39— `b.score - a.score || a.item.item_id.localeCompare(b.item.item_id)` appears character-identically in 2 files — experiments/version_aware_rag/scripts/v5/run_r2_8_shared_pool_development.ts, experiments/version_aware_rag/scripts/v5/run_r2_9_retrieval_validation.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/v5/run_r2_8_shared_pool_development.ts:88— `b.version_aware_score - a.version_aware_score || a.item_id.localeCompare(b.item_id)` appears character-identically in 2 files — experiments/version_aware_rag/scripts/v5/run_r2_8_shared_pool_development.ts, experiments/version_aware_rag/scripts/v5/run_r2_9_retrieval_validation.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/build_chunks.ts:42— `bodyLower.includes('added sugar') || bodyLower.includes('sugars')` appears character-identically in 2 files — experiments/version_aware_rag/scripts/build_chunks.ts, experiments/version_aware_rag/src/corpus/build_corpus.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/build_chunks.ts:51— `bodyLower.includes('alcohol') || bodyLower.includes('drink')` appears character-identically in 2 files — experiments/version_aware_rag/scripts/build_chunks.ts, experiments/version_aware_rag/src/corpus/build_corpus.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/build_chunks.ts:36— `bodyLower.includes('dairy') || bodyLower.includes('milk')` appears character-identically in 2 files — experiments/version_aware_rag/scripts/build_chunks.ts, experiments/version_aware_rag/src/corpus/build_corpus.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/build_chunks.ts:60— `bodyLower.includes('processed') || (bodyLower.includes('nutrient-dense') && bodyLower.includes('calorie limits'))` appears character-identically in 2 files — experiments/version_aware_rag/scripts/build_chunks.ts, experiments/version_aware_rag/src/corpus/build_corpus.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/build_chunks.ts:39— `bodyLower.includes('protein') || bodyLower.includes('meat') || bodyLower.includes('egg')` appears character-identically in 2 files — experiments/version_aware_rag/scripts/build_chunks.ts, experiments/version_aware_rag/src/corpus/build_corpus.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/build_chunks.ts:57— `bodyLower.includes('sodium') || bodyLower.includes('salt')` appears character-identically in 2 files — experiments/version_aware_rag/scripts/build_chunks.ts, experiments/version_aware_rag/src/corpus/build_corpus.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/build_chunks.ts:45— `bodyLower.includes('sweetener') || bodyLower.includes('aspartame')` appears character-identically in 2 files — experiments/version_aware_rag/scripts/build_chunks.ts, experiments/version_aware_rag/src/corpus/build_corpus.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate experiments/version_aware_rag/scripts/build_chunks.ts:63— `bodyLower.includes('vegetable') || bodyLower.includes('fruit')` appears character-identically in 2 files — experiments/version_aware_rag/scripts/build_chunks.ts, experiments/version_aware_rag/src/corpus/build_corpus.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Interpolated log message defeats structured logging services/api/src/main.rs:59— `info!` at line 59 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/utils/rag_worker.rs:177— `error!` at line 177 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/utils/rag_worker.rs:200— `error!` at line 200 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/utils/rag_worker.rs:226— `error!` at line 226 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/utils/rag_worker.rs:248— `error!` at line 248 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/utils/rag_worker.rs:251— `warn!` at line 251 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/utils/rag_worker.rs:257— `warn!` at line 257 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/utils/rag_worker.rs:294— `info!` at line 294 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/utils/rag_worker.rs:337— `error!` at line 337 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/utils/rag_worker.rs:384— `error!` at line 384 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/utils/rag_worker.rs:450— `info!` at line 450 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/utils/rag_worker.rs:470— `error!` at line 470 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/utils/rag_worker.rs:477— `info!` at line 477 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/utils/route_control.rs:73— `error!` at line 73 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/api/admin.rs:125— `error!` at line 125 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/api/admin.rs:150— `error!` at line 150 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/api/admin.rs:231— `error!` at line 231 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/api/admin.rs:260— `warn!` at line 260 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/api/admin.rs:290— `error!` at line 290 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/api/admin.rs:357— `error!` at line 357 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/api/admin.rs:386— `error!` at line 386 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/api/admin.rs:463— `error!` at line 463 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/api/admin.rs:497— `error!` at line 497 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/api/admin.rs:537— `error!` at line 537 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging services/api/src/api/admin.rs:566— `error!` at line 566 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
redundant comment experiments/version_aware_rag/scripts/diagnostics/run_oracle_counterfactuals.ts:217— "Recency on fixed pool" repeats the code it sits on: 3 of its 3 words (recency, fixed, pool) are already in `const recencyRetriever = new RecencyBoostRetriever(fixedPoolRetriever, chunks, 0.75);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment experiments/version_aware_rag/scripts/diagnostics/run_oracle_counterfactuals.ts:222— "Full Oracle on fixed pool" repeats the code it sits on: 4 of its 4 words (full, oracle, fixed, pool) are already in `const oracleRetriever = new VersionAwareRetriever(fixedPoolRetriever, chunks, graph, { full_version_aware: true });`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment experiments/version_aware_rag/scripts/v3/build_paper_tables.ts:167— "SECTION 1: Retrieval Evaluation (Automatic)" repeats the code it sits on: 4 of its 4 words (section, retrieval, evaluation, automatic) are already in `const section1Md = ``. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment experiments/version_aware_rag/scripts/v3/build_paper_tables.ts:221— "LaTeX Output" repeats the code it sits on: 3 of its 3 words (la, te, output) are already in `const latexOutput = ``. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment experiments/version_aware_rag/scripts/v3/run_experiment.ts:164— "Filter queries by split" repeats the code it sits on: 3 of its 3 words (filter, queries, split) are already in `const queries = allQueries.filter(q => splitQueryIds.has(q.query_id));`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment experiments/version_aware_rag/scripts/v3/run_heldout_pipeline.ts:158— "Export Blind Review Annotation Package" repeats the code it sits on: 5 of its 5 words (export, blind, review, annotation, package) are already in `console.log('Exporting blind review annotation package...');`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment experiments/version_aware_rag/scripts/v3/tune_recency_lambda.ts:44— "Set split to validation" repeats the code it sits on: 3 of its 3 words (set, split, validation) are already in `const splitName = 'validation';`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment experiments/version_aware_rag/scripts/v4/run_v4_policy_repair.ts:242— "Base BM25 candidate pool (Top-20)" repeats the code it sits on: 6 of its 7 words (base, bm, 25, candidate, pool, 20) are already in `const basePool20 = await bm25.retrieve(queryContextBase, CANDIDATE_POOL_SIZE);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment experiments/version_aware_rag/scripts/v4/run_v4_policy_repair.ts:547— "Before / After failure cases for q-030, q-031, and q-037" repeats the code it sits on: 5 of its 5 words (failure, cases, 030, 031, 037) are already in `const failureCaseQueries = ['q-030', 'q-031', 'q-037'];`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment experiments/version_aware_rag/src/annotation/build_splits.ts:83— "Write queries.jsonl" repeats the code it sits on: 3 of its 3 words (write, queries, jsonl) are already in `fs.writeFileSync(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment experiments/version_aware_rag/src/annotation/build_splits.ts:1267— "Write queries.jsonl" repeats the code it sits on: 3 of its 3 words (write, queries, jsonl) are already in `fs.writeFileSync(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment experiments/version_aware_rag/src/annotation/build_splits.ts:1279— "Write relation pairs and annotations" repeats the code it sits on: 4 of its 4 words (write, relation, pairs, annotations) are already in `fs.writeFileSync(path.join(annotationsV3Dir, 'relation_pairs.jsonl'), relationPairs.map(r => JSON.stringify(r)).join('\n …`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment experiments/version_aware_rag/src/corpus/audit_corpus.ts:122— "Page sequence auditing" repeats the code it sits on: 3 of its 3 words (page, sequence, auditing) are already in `const page_sequence_audit: Record<string, any> = {};`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment experiments/version_aware_rag/src/retrieval/version_aware.ts:387— "Update processed list with expanded items" repeats the code it sits on: 4 of its 5 words (processed, list, expanded, items) are already in `processed = expandedList.map(item =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment experiments/version_aware_rag/src/versioning/relation_graph.ts:154— "Transitive checks along duplicate or superseded edges" repeats the code it sits on: 4 of its 5 words (checks, duplicate, superseded, edges) are already in `if (edge.relationType === 'duplicate' || edge.relationType === 'superseded')`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment experiments/version_aware_rag/tests/unit/compatibility_expansion.test.ts:27— "Base scores map (c-old has baseScore > minBaseScore)" repeats the code it sits on: 5 of its 6 words (base, scores, map, old, score) are already in `const baseScoresMap = new Map<string, number>([`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment experiments/version_aware_rag/tests/unit/retrieval_metrics.test.ts:186— "Scenario 5: compatible old chunk" repeats the code it sits on: 4 of its 4 words (scenario, compatible, old, chunk) are already in `test("Scenario 5: compatible old chunk", () =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
Silent fallback default in catch src/storage/sqlite/adapter.ts:25— `parseJsonArray` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch REDACTED:61— `readTextFileSafe` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Fat interface: AppStorage (17 required operations) src/storage/types.ts:107— `AppStorage` declares 17 required operations: `ensureReady`, `insertChatHistory`, `updateChatHistoryReply`, `upsertChatRoom`, `getChatRoomSummary`, `getUserProfile`, `updateUserProfile`, `getChatHistory`, `listKnowledgeDocuments`, `getKnowledgeDocument`, `findKnowledgeDocumentByHash`, `createKnowledgeDocument`, `updateKnowledgeDocument`, `deleteKnowledgeDocument`, `createKnowledgeIngestionJob`, `updateKnowledgeIngestionJob`, `getKnowledgeIngestionJob`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
No ADRs found REDACTED:4— No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `REDACTED` makes this repository a deployable product (line 4).
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion REDACTED:1— `(repository root)` (51298 LoC, 431 module-visible types across 25 directories) overshoots its size bounds. 1 of 3 build unit(s) (Cargo, Python, npm) overshoot their size bounds, lowering Project Cohesion to 3.3/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
Logging is not universal — Only 1/4 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `.`, `services/yolo`.
No SAST — No static application security testing detected. For this repository's stack, add CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security as a CI step. What was searched, so you can tell an absence from a miss: the 1 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
No dependency-update automation REDACTED:9— `REDACTED` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
R7 · Dead Code· Unused export 'BaselineReferenceSnapshot' · ×1
Unused export 'BaselineReferenceSnapshot' experiments/version_aware_rag/src/diagnostics/diagnostic_types.ts:26— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'AnswerJudgment' · ×1
Unused export 'AnswerJudgment' experiments/version_aware_rag/src/evaluation/answer_metrics.ts:47— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'RelationDetectionResult' · ×1
Unused export 'RelationDetectionResult' experiments/version_aware_rag/src/versioning/detectors/types.ts:11— Nothing imports this binding — it is safe to review for removal.
Unused export 'RULES_FILE' src/server/workspacePaths.ts:12— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'resetStorageForTest' · ×1
Unused export 'resetStorageForTest' src/storage/runtime.ts:26— Nothing ultimately consumes this binding: its only referrer is the re-export in src/storage/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/storage/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'createSupabaseStorageForTest' · ×1
Unused export 'createSupabaseStorageForTest' src/storage/supabase/adapter.ts:308— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused module-local declaration 'getSupabaseOrError' · ×1
Unused module-local declaration 'getSupabaseOrError' agent_skills/db_tools.ts:28— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'mapLimit' · ×1
Unused module-local declaration 'mapLimit' experiments/version_aware_rag/scripts/v4/run_v4_dev_model_selection.ts:157— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'prompt' · ×1
Unused module-local declaration 'prompt' experiments/version_aware_rag/scripts/v5/run_v5_relation_detector_development.ts:24— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'getTopicFromLegacyId' · ×1
Unused module-local declaration 'getTopicFromLegacyId' experiments/version_aware_rag/src/annotation/build_splits.ts:12— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'mapDocumentRow' · ×1
Unused module-local declaration 'mapDocumentRow' REDACTED:315— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'fetchExistingRoomSummary' · ×1
Unused module-local declaration 'fetchExistingRoomSummary' REDACTED:405— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
X2 · Cancellation propagation· Not all async functions that make a request accept an AbortSignal · ×1
Not all async functions that make a request accept an AbortSignal — Only 1/8 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
Null assertions (`!`) override strict null checking — ~1.8 `!` null assertions per 1k TypeScript source lines — 83 assertion(s) across the 46399 source line(s) of the 266 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: src/server/versionAwareRag.ts (11), experiments/version_aware_rag/scripts/v4/run_v4_policy_repair.ts (10), experiments/version_aware_rag/scripts/v4/run_v4_dev_model_selection.ts (6). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
Outdated: async-trait — `async-trait` is locked at 0.1.89 but 0.1.92 is the current stable release on crates.io, and it already satisfies the `"0.1.89"` requirement declared in services/api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p async-trait` and commit the updated REDACTED.
Outdated: axum — `axum` is locked at 0.8.8 but 0.8.9 is the current stable release on crates.io, and it already satisfies the `"0.8.0"` requirement declared in services/api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p axum` and commit the updated REDACTED.
Outdated: axum-extra — `axum-extra` is locked at 0.12.5 but 0.12.6 is the current stable release on crates.io, and it already satisfies the `"0.12.5"` requirement declared in services/api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p axum-extra` and commit the updated REDACTED.
Outdated: chrono — `chrono` is locked at 0.4.44 but 0.4.45 is the current stable release on crates.io, and it already satisfies the `"0.4.44"` requirement declared in services/api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p chrono` and commit the updated REDACTED.
Outdated: futures — `futures` is locked at 0.3.31 but 0.3.34 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in services/api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p futures` and commit the updated REDACTED.
Outdated: rand — `rand` is locked at 0.10.0 but 0.10.4 is the current stable release on crates.io, and it already satisfies the `"0.10.0"` requirement declared in services/api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rand` and commit the updated REDACTED.
Outdated: serde — `serde` is locked at 1.0.228 but 1.0.229 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in services/api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde` and commit the updated REDACTED.
Outdated: serde_json — `serde_json` is locked at 1.0.145 but 1.0.154 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in services/api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde_json` and commit the updated REDACTED.
Outdated: tokio — `tokio` is locked at 1.48.0 but 1.54.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in services/api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio` and commit the updated REDACTED.
Outdated: tracing — `tracing` is locked at 0.1.41 but 0.1.44 is the current stable release on crates.io, and it already satisfies the `"0.1"` requirement declared in services/api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tracing` and commit the updated REDACTED.
Outdated: tracing-subscriber — `tracing-subscriber` is locked at 0.3.20 but 0.3.23 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in services/api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tracing-subscriber` and commit the updated REDACTED.
Outdated: uuid — `uuid` is locked at 1.19.0 but 1.29.3 is the current stable release on crates.io, and it already satisfies the `"1.19.0"` requirement declared in services/api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p uuid` and commit the updated REDACTED.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 1 file(s) — `agent_skills/conversation_summary_tool.ts` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a1e88a-8606-7f86-b0c7-85d590c4ef7c · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 56 · Warnings: 559 · Recommendations: 130 · Info: 12 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 08:05 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.