Public report of jordigilh/kubernaut, published 16 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, 16 November 2026, 23:54 UTC · Survey ID cd_63b2816942924f09acf833c17198c39f
jordigilh/kubernaut
Measured 16 November 2026, 23:52 UTC, at code version 741f7d8
First survey, so nothing to compare with yet
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 large codebase: 200,263 lines of product code in 6 projects, tests not counted · Estimated rebuild effort: about 9.4 person-years · Weakest lens: Security and Compliance, 65.6
Findings by how serious they are
51 critical1038 serious650 minor
18 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
16 November 2026, 23:52 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 ▸
63of 63 dimensions measured by tools.
1726of 1739 findings point to an exact file and line, so you can open each one in the code. The other 13 concern the repository as a whole, such as missing documentation.
63dimensions across 7 lenses, read from 200,263 lines of product code in 6 projects.
jordigilh/kubernaut is rated At risk because critical security findings are open, most of them in the build pipeline. Its score is held back because it has pipeline steps that put outside input straight into a shell command and passwords or keys in the code's history. It scores 68.5 out of 100, which the At risk rating leaves unchanged.
Security and Compliance, at 65.6, is the weakest lens by a small margin, and the weakest lens counts most in the score. The best first step for the work it takes is replacing the three exposed passwords or keys and switching the old ones off, worth about 2.4 points. Bringing the documentation in line with the code comes next, worth about 2.5 points.
Eleven pipeline steps put outside input straight into a shell command, so an attacker can run commands in the build pipeline. Nine pipeline steps run downloads nobody checks, and nine secrets can leak from the build pipeline. Passing outside input through environment variables, checking each download against a checksum and limiting each secret to its own step would close these risks. Reading outside data into plain values would fix the four places where outside data is turned straight into objects, and the eight passwords or keys in the code's history and the three passwords or keys in the code need replacing, with the old ones switched off. The set of files in separate parts that keep changing together needs that dependency made explicit.
The product code is 200,263 lines, about €1,400,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.
The weakest lenses score close to each other, so improving any of them moves the score.
Code composition: what the lines of code are
Product code 26%Tests 74%
Rebuild cost: about €1,400,000 · Estimate
Cost to rebuild
€460,000 to €2,300,000, for 7,589 to 24,076 hours of work, about 9.4 person-years for 5 to 18 engineers
Difficulty of the problem
High, 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
×1.0 at a score of 68. 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
Large: 200,263 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
Resolve the 3 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2), REDACTED.
Raises the score by about 2.4 points · Low effort · REDACTED Scanning
2
Reconcile the README with reality: docs/README.md links to `value-proposition/README.md`, but `docs/value-proposition/README.md` does not exist; docs/README.md links to `value-proposition/TECHNICAL_SCENARIOS.md`, but `docs/value-proposition/TECHNICAL_SCENARIOS.md` does not exist; docs/README.md links to `value-proposition/V1_VS_V2_CAPABILITIES.md`, but `docs/value-proposition/V1_VS_V2_CAPABILITIES.md` does not exist; docs/README.md links to `development/getting-started/setup/PGVECTOR_SETUP_GUIDE.md`, but `docs/development/getting-started/setup/PGVECTOR_SETUP_GUIDE.md` does not exist; docs/README.md links to `architecture/AI_CONTEXT_ORCHESTRATION_ARCHITECTURE.md`, but `docs/architecture/AI_CONTEXT_ORCHESTRATION_ARCHITECTURE.md` does not exist.
Resolve the 6 High secret finding(s) in Secrets (history) — start with REDACTED (2), REDACTED (2), REDACTED.
Raises the score by about 1.2 points · Low effort · Secrets (history)
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.
Files that change often carry extra risk · Combined risk
9 files are changed often and are hard to read, which makes them the likeliest places for a mistake. They also have under half their code tested, or were written almost entirely by one person, so a mistake there is less likely to be caught, or only one person knows the code well enough to avoid it. A change to these files therefore carries more risk than the overall score suggests.
Based on: Churn × Complexity Hotspots (74 files) · Code Coverage (73 files under half tested) · The files: types.go, backend_deps.go and workflowexecution_controller.go
What to do: Add tests to these files and have a second person review every change to them, starting with types.go, backend_deps.go and workflowexecution_controller.go.
One cause behind 10 Domain Modelling findings · Common cause
10 findings in the Domain Modelling lens come from the same cause. The code models the business as objects, such as an order or a customer, and each object should guard its own rules: an order, for example, should refuse to be shipped before it has been paid. Here the objects don't do that. Other code can change an object's data directly, so it can put an order into a state the rules forbid. Some objects only hold data, while the rules that should keep that data valid sit elsewhere in the code. Because all of these findings have the same cause, fixing it once, in the business objects themselves, deals with them together.
Based on: Encapsulated state (4 findings) · Rich vs anemic model (6 findings)
What to do: Give each business object the methods that enforce its rules, such as a method for shipping an order that first checks it has been paid, and let only those methods change its data. Give each kind of identifier a type of its own, so an order number can't be used where a customer number belongs.
If you do one thing first · First action
Resolve the 3 Leaked secret finding(s) in REDACTED Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 2.4 points for low effort, because it clears the 3 REDACTED Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
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.
263 modules, with 625 dependencies between them. 5 loops run through 13 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 223 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.
com/jordigilh/kubernaut/api/aianalysis/v1alpha1 uses com/jordigilh/kubernaut/pkg/shared/types, so a change to com/jordigilh/kubernaut/pkg/shared/types can break com/jordigilh/kubernaut/api/aianalysis/v1alpha1, while a change to com/jordigilh/kubernaut/api/aianalysis/v1alpha1 can't break com/jordigilh/kubernaut/pkg/shared/types.
Position
Below the diagonal: com/jordigilh/kubernaut/api/aianalysis/v1alpha1 uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/api/remediation/v1alpha1 uses com/jordigilh/kubernaut/pkg/shared/types, so a change to com/jordigilh/kubernaut/pkg/shared/types can break com/jordigilh/kubernaut/api/remediation/v1alpha1, while a change to com/jordigilh/kubernaut/api/remediation/v1alpha1 can't break com/jordigilh/kubernaut/pkg/shared/types.
Position
Below the diagonal: com/jordigilh/kubernaut/api/remediation/v1alpha1 uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/api/remediationworkflow/v1alpha1 uses com/jordigilh/kubernaut/pkg/shared/types, so a change to com/jordigilh/kubernaut/pkg/shared/types can break com/jordigilh/kubernaut/api/remediationworkflow/v1alpha1, while a change to com/jordigilh/kubernaut/api/remediationworkflow/v1alpha1 can't break com/jordigilh/kubernaut/pkg/shared/types.
Position
Below the diagonal: com/jordigilh/kubernaut/api/remediationworkflow/v1alpha1 uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/api/signalprocessing/v1alpha1 uses com/jordigilh/kubernaut/pkg/shared/types, so a change to com/jordigilh/kubernaut/pkg/shared/types can break com/jordigilh/kubernaut/api/signalprocessing/v1alpha1, while a change to com/jordigilh/kubernaut/api/signalprocessing/v1alpha1 can't break com/jordigilh/kubernaut/pkg/shared/types.
Position
Below the diagonal: com/jordigilh/kubernaut/api/signalprocessing/v1alpha1 uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/api/workflowexecution/v1alpha1 uses com/jordigilh/kubernaut/pkg/shared/types, so a change to com/jordigilh/kubernaut/pkg/shared/types can break com/jordigilh/kubernaut/api/workflowexecution/v1alpha1, while a change to com/jordigilh/kubernaut/api/workflowexecution/v1alpha1 can't break com/jordigilh/kubernaut/pkg/shared/types.
Position
Below the diagonal: com/jordigilh/kubernaut/api/workflowexecution/v1alpha1 uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/audit uses com/jordigilh/kubernaut/pkg/fleet/readiness, so a change to com/jordigilh/kubernaut/pkg/fleet/readiness can break com/jordigilh/kubernaut/pkg/audit, while a change to com/jordigilh/kubernaut/pkg/audit can't break com/jordigilh/kubernaut/pkg/fleet/readiness.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/audit uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/audit uses com/jordigilh/kubernaut/pkg/shared/types, so a change to com/jordigilh/kubernaut/pkg/shared/types can break com/jordigilh/kubernaut/pkg/audit, while a change to com/jordigilh/kubernaut/pkg/audit can't break com/jordigilh/kubernaut/pkg/shared/types.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/audit uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/datastorage/models uses com/jordigilh/kubernaut/pkg/shared/types, so a change to com/jordigilh/kubernaut/pkg/shared/types can break com/jordigilh/kubernaut/pkg/datastorage/models, while a change to com/jordigilh/kubernaut/pkg/datastorage/models can't break com/jordigilh/kubernaut/pkg/shared/types.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/datastorage/models uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/fleet uses com/jordigilh/kubernaut/pkg/fleet/registry, so a change to com/jordigilh/kubernaut/pkg/fleet/registry can break com/jordigilh/kubernaut/pkg/fleet, while a change to com/jordigilh/kubernaut/pkg/fleet can't break com/jordigilh/kubernaut/pkg/fleet/registry.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/fleet uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/fleet uses com/jordigilh/kubernaut/pkg/shared/scope, so a change to com/jordigilh/kubernaut/pkg/shared/scope can break com/jordigilh/kubernaut/pkg/fleet, while a change to com/jordigilh/kubernaut/pkg/fleet can't break com/jordigilh/kubernaut/pkg/shared/scope.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/fleet uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/shared/hotreload uses com/jordigilh/kubernaut/pkg/fleet/registry, so a change to com/jordigilh/kubernaut/pkg/fleet/registry can break com/jordigilh/kubernaut/pkg/shared/hotreload, while a change to com/jordigilh/kubernaut/pkg/shared/hotreload can't break com/jordigilh/kubernaut/pkg/fleet/registry.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/shared/hotreload uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/internal/controller/effectivenessmonitor uses com/jordigilh/kubernaut/pkg/fleet, so a change to com/jordigilh/kubernaut/pkg/fleet can break com/jordigilh/kubernaut/internal/controller/effectivenessmonitor, while a change to com/jordigilh/kubernaut/internal/controller/effectivenessmonitor can't break com/jordigilh/kubernaut/pkg/fleet.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/controller/effectivenessmonitor uses a module listed above it, which is the healthy direction.
7 pairs of types, where a type in com/jordigilh/kubernaut/internal/controller/notification uses a type in com/jordigilh/kubernaut/api/notification/v1alpha1.
com/jordigilh/kubernaut/internal/controller/notification uses com/jordigilh/kubernaut/api/notification/v1alpha1, so a change to com/jordigilh/kubernaut/api/notification/v1alpha1 can break com/jordigilh/kubernaut/internal/controller/notification, while a change to com/jordigilh/kubernaut/internal/controller/notification can't break com/jordigilh/kubernaut/api/notification/v1alpha1.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/controller/notification uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/internal/controller/notification uses com/jordigilh/kubernaut/pkg/audit, so a change to com/jordigilh/kubernaut/pkg/audit can break com/jordigilh/kubernaut/internal/controller/notification, while a change to com/jordigilh/kubernaut/internal/controller/notification can't break com/jordigilh/kubernaut/pkg/audit.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/controller/notification uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in com/jordigilh/kubernaut/internal/controller/workflowexecution uses a type in com/jordigilh/kubernaut/api/remediationworkflow/v1alpha1.
com/jordigilh/kubernaut/internal/controller/workflowexecution uses com/jordigilh/kubernaut/api/remediationworkflow/v1alpha1, so a change to com/jordigilh/kubernaut/api/remediationworkflow/v1alpha1 can break com/jordigilh/kubernaut/internal/controller/workflowexecution, while a change to com/jordigilh/kubernaut/internal/controller/workflowexecution can't break com/jordigilh/kubernaut/api/remediationworkflow/v1alpha1.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/controller/workflowexecution uses a module listed above it, which is the healthy direction.
6 pairs of types, where a type in com/jordigilh/kubernaut/internal/controller/workflowexecution uses a type in com/jordigilh/kubernaut/api/workflowexecution/v1alpha1.
com/jordigilh/kubernaut/internal/controller/workflowexecution uses com/jordigilh/kubernaut/api/workflowexecution/v1alpha1, so a change to com/jordigilh/kubernaut/api/workflowexecution/v1alpha1 can break com/jordigilh/kubernaut/internal/controller/workflowexecution, while a change to com/jordigilh/kubernaut/internal/controller/workflowexecution can't break com/jordigilh/kubernaut/api/workflowexecution/v1alpha1.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/controller/workflowexecution uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/internal/controller/workflowexecution uses com/jordigilh/kubernaut/pkg/audit, so a change to com/jordigilh/kubernaut/pkg/audit can break com/jordigilh/kubernaut/internal/controller/workflowexecution, while a change to com/jordigilh/kubernaut/internal/controller/workflowexecution can't break com/jordigilh/kubernaut/pkg/audit.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/controller/workflowexecution uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/jordigilh/kubernaut/internal/controller/workflowexecution uses a type in com/jordigilh/kubernaut/pkg/datastorage/models.
com/jordigilh/kubernaut/internal/controller/workflowexecution uses com/jordigilh/kubernaut/pkg/datastorage/models, so a change to com/jordigilh/kubernaut/pkg/datastorage/models can break com/jordigilh/kubernaut/internal/controller/workflowexecution, while a change to com/jordigilh/kubernaut/internal/controller/workflowexecution can't break com/jordigilh/kubernaut/pkg/datastorage/models.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/controller/workflowexecution uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/internal/kubernautagent/audit uses com/jordigilh/kubernaut/pkg/audit, so a change to com/jordigilh/kubernaut/pkg/audit can break com/jordigilh/kubernaut/internal/kubernautagent/audit, while a change to com/jordigilh/kubernaut/internal/kubernautagent/audit can't break com/jordigilh/kubernaut/pkg/audit.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/kubernautagent/audit uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/aianalysis/handlers uses com/jordigilh/kubernaut/pkg/shared/types, so a change to com/jordigilh/kubernaut/pkg/shared/types can break com/jordigilh/kubernaut/pkg/aianalysis/handlers, while a change to com/jordigilh/kubernaut/pkg/aianalysis/handlers can't break com/jordigilh/kubernaut/pkg/shared/types.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/aianalysis/handlers uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/aianalysis/handlers uses com/jordigilh/kubernaut/api/aianalysis/v1alpha1, so a change to com/jordigilh/kubernaut/api/aianalysis/v1alpha1 can break com/jordigilh/kubernaut/pkg/aianalysis/handlers, while a change to com/jordigilh/kubernaut/pkg/aianalysis/handlers can't break com/jordigilh/kubernaut/api/aianalysis/v1alpha1.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/aianalysis/handlers uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/audit uses com/jordigilh/kubernaut/pkg/shared/types, so a change to com/jordigilh/kubernaut/pkg/shared/types can break com/jordigilh/kubernaut/pkg/apifrontend/audit, while a change to com/jordigilh/kubernaut/pkg/apifrontend/audit can't break com/jordigilh/kubernaut/pkg/shared/types.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/audit uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/audit uses com/jordigilh/kubernaut/pkg/audit, so a change to com/jordigilh/kubernaut/pkg/audit can break com/jordigilh/kubernaut/pkg/apifrontend/audit, while a change to com/jordigilh/kubernaut/pkg/apifrontend/audit can't break com/jordigilh/kubernaut/pkg/audit.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/audit uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/datastorage/server uses com/jordigilh/kubernaut/pkg/shared/types, so a change to com/jordigilh/kubernaut/pkg/shared/types can break com/jordigilh/kubernaut/pkg/datastorage/server, while a change to com/jordigilh/kubernaut/pkg/datastorage/server can't break com/jordigilh/kubernaut/pkg/shared/types.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/datastorage/server uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/datastorage/server uses com/jordigilh/kubernaut/api/remediation/v1alpha1, so a change to com/jordigilh/kubernaut/api/remediation/v1alpha1 can break com/jordigilh/kubernaut/pkg/datastorage/server, while a change to com/jordigilh/kubernaut/pkg/datastorage/server can't break com/jordigilh/kubernaut/api/remediation/v1alpha1.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/datastorage/server uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/datastorage/server uses com/jordigilh/kubernaut/pkg/audit, so a change to com/jordigilh/kubernaut/pkg/audit can break com/jordigilh/kubernaut/pkg/datastorage/server, while a change to com/jordigilh/kubernaut/pkg/datastorage/server can't break com/jordigilh/kubernaut/pkg/audit.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/datastorage/server uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/datastorage/server uses com/jordigilh/kubernaut/pkg/datastorage/models, so a change to com/jordigilh/kubernaut/pkg/datastorage/models can break com/jordigilh/kubernaut/pkg/datastorage/server, while a change to com/jordigilh/kubernaut/pkg/datastorage/server can't break com/jordigilh/kubernaut/pkg/datastorage/models.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/datastorage/server uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/datastorage/server uses com/jordigilh/kubernaut/pkg/shared/hotreload, so a change to com/jordigilh/kubernaut/pkg/shared/hotreload can break com/jordigilh/kubernaut/pkg/datastorage/server, while a change to com/jordigilh/kubernaut/pkg/datastorage/server can't break com/jordigilh/kubernaut/pkg/shared/hotreload.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/datastorage/server uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/fleet/mcpclient uses com/jordigilh/kubernaut/pkg/fleet/readiness, so a change to com/jordigilh/kubernaut/pkg/fleet/readiness can break com/jordigilh/kubernaut/pkg/fleet/mcpclient, while a change to com/jordigilh/kubernaut/pkg/fleet/mcpclient can't break com/jordigilh/kubernaut/pkg/fleet/readiness.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/fleet/mcpclient uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/fleet/mcpclient uses com/jordigilh/kubernaut/pkg/fleet/registry, so a change to com/jordigilh/kubernaut/pkg/fleet/registry can break com/jordigilh/kubernaut/pkg/fleet/mcpclient, while a change to com/jordigilh/kubernaut/pkg/fleet/mcpclient can't break com/jordigilh/kubernaut/pkg/fleet/registry.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/fleet/mcpclient uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/fleet/mcpclient uses com/jordigilh/kubernaut/pkg/kubernautagent/tools, so a change to com/jordigilh/kubernaut/pkg/kubernautagent/tools can break com/jordigilh/kubernaut/pkg/fleet/mcpclient, while a change to com/jordigilh/kubernaut/pkg/fleet/mcpclient can't break com/jordigilh/kubernaut/pkg/kubernautagent/tools.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/fleet/mcpclient uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/fleet/mcpclient uses com/jordigilh/kubernaut/pkg/fleet, so a change to com/jordigilh/kubernaut/pkg/fleet can break com/jordigilh/kubernaut/pkg/fleet/mcpclient, while a change to com/jordigilh/kubernaut/pkg/fleet/mcpclient can't break com/jordigilh/kubernaut/pkg/fleet.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/fleet/mcpclient uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/fleet/mcpclient uses com/jordigilh/kubernaut/pkg/shared/hotreload, so a change to com/jordigilh/kubernaut/pkg/shared/hotreload can break com/jordigilh/kubernaut/pkg/fleet/mcpclient, while a change to com/jordigilh/kubernaut/pkg/fleet/mcpclient can't break com/jordigilh/kubernaut/pkg/shared/hotreload.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/fleet/mcpclient uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/gateway uses com/jordigilh/kubernaut/pkg/fleet/readiness, so a change to com/jordigilh/kubernaut/pkg/fleet/readiness can break com/jordigilh/kubernaut/pkg/gateway, while a change to com/jordigilh/kubernaut/pkg/gateway can't break com/jordigilh/kubernaut/pkg/fleet/readiness.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/gateway uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/gateway uses com/jordigilh/kubernaut/pkg/shared/scope, so a change to com/jordigilh/kubernaut/pkg/shared/scope can break com/jordigilh/kubernaut/pkg/gateway, while a change to com/jordigilh/kubernaut/pkg/gateway can't break com/jordigilh/kubernaut/pkg/shared/scope.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/gateway uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/gateway uses com/jordigilh/kubernaut/api/remediation/v1alpha1, so a change to com/jordigilh/kubernaut/api/remediation/v1alpha1 can break com/jordigilh/kubernaut/pkg/gateway, while a change to com/jordigilh/kubernaut/pkg/gateway can't break com/jordigilh/kubernaut/api/remediation/v1alpha1.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/gateway uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/gateway uses com/jordigilh/kubernaut/pkg/audit, so a change to com/jordigilh/kubernaut/pkg/audit can break com/jordigilh/kubernaut/pkg/gateway, while a change to com/jordigilh/kubernaut/pkg/gateway can't break com/jordigilh/kubernaut/pkg/audit.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/gateway uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/gateway uses com/jordigilh/kubernaut/pkg/shared/hotreload, so a change to com/jordigilh/kubernaut/pkg/shared/hotreload can break com/jordigilh/kubernaut/pkg/gateway, while a change to com/jordigilh/kubernaut/pkg/gateway can't break com/jordigilh/kubernaut/pkg/shared/hotreload.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/gateway uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/kubernautagent/types uses com/jordigilh/kubernaut/pkg/shared/types, so a change to com/jordigilh/kubernaut/pkg/shared/types can break com/jordigilh/kubernaut/pkg/kubernautagent/types, while a change to com/jordigilh/kubernaut/pkg/kubernautagent/types can't break com/jordigilh/kubernaut/pkg/shared/types.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/kubernautagent/types uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/kubernautagent/types uses com/jordigilh/kubernaut/pkg/datastorage/models, so a change to com/jordigilh/kubernaut/pkg/datastorage/models can break com/jordigilh/kubernaut/pkg/kubernautagent/types, while a change to com/jordigilh/kubernaut/pkg/kubernautagent/types can't break com/jordigilh/kubernaut/pkg/datastorage/models.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/kubernautagent/types uses a module listed above it, which is the healthy direction.
6 pairs of types, where a type in com/jordigilh/kubernaut/pkg/remediationorchestrator/creator uses a type in com/jordigilh/kubernaut/api/notification/v1alpha1.
com/jordigilh/kubernaut/pkg/remediationorchestrator/creator uses com/jordigilh/kubernaut/api/notification/v1alpha1, so a change to com/jordigilh/kubernaut/api/notification/v1alpha1 can break com/jordigilh/kubernaut/pkg/remediationorchestrator/creator, while a change to com/jordigilh/kubernaut/pkg/remediationorchestrator/creator can't break com/jordigilh/kubernaut/api/notification/v1alpha1.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/remediationorchestrator/creator uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/remediationorchestrator/creator uses com/jordigilh/kubernaut/pkg/shared/types, so a change to com/jordigilh/kubernaut/pkg/shared/types can break com/jordigilh/kubernaut/pkg/remediationorchestrator/creator, while a change to com/jordigilh/kubernaut/pkg/remediationorchestrator/creator can't break com/jordigilh/kubernaut/pkg/shared/types.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/remediationorchestrator/creator uses a module listed above it, which is the healthy direction.
9 pairs of types, where a type in com/jordigilh/kubernaut/pkg/remediationorchestrator/creator uses a type in com/jordigilh/kubernaut/api/aianalysis/v1alpha1.
com/jordigilh/kubernaut/pkg/remediationorchestrator/creator uses com/jordigilh/kubernaut/api/aianalysis/v1alpha1, so a change to com/jordigilh/kubernaut/api/aianalysis/v1alpha1 can break com/jordigilh/kubernaut/pkg/remediationorchestrator/creator, while a change to com/jordigilh/kubernaut/pkg/remediationorchestrator/creator can't break com/jordigilh/kubernaut/api/aianalysis/v1alpha1.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/remediationorchestrator/creator uses a module listed above it, which is the healthy direction.
14 pairs of types, where a type in com/jordigilh/kubernaut/pkg/remediationorchestrator/creator uses a type in com/jordigilh/kubernaut/api/remediation/v1alpha1.
com/jordigilh/kubernaut/pkg/remediationorchestrator/creator uses com/jordigilh/kubernaut/api/remediation/v1alpha1, so a change to com/jordigilh/kubernaut/api/remediation/v1alpha1 can break com/jordigilh/kubernaut/pkg/remediationorchestrator/creator, while a change to com/jordigilh/kubernaut/pkg/remediationorchestrator/creator can't break com/jordigilh/kubernaut/api/remediation/v1alpha1.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/remediationorchestrator/creator uses a module listed above it, which is the healthy direction.
8 pairs of types, where a type in com/jordigilh/kubernaut/pkg/remediationorchestrator/creator uses a type in com/jordigilh/kubernaut/api/signalprocessing/v1alpha1.
com/jordigilh/kubernaut/pkg/remediationorchestrator/creator uses com/jordigilh/kubernaut/api/signalprocessing/v1alpha1, so a change to com/jordigilh/kubernaut/api/signalprocessing/v1alpha1 can break com/jordigilh/kubernaut/pkg/remediationorchestrator/creator, while a change to com/jordigilh/kubernaut/pkg/remediationorchestrator/creator can't break com/jordigilh/kubernaut/api/signalprocessing/v1alpha1.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/remediationorchestrator/creator uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in com/jordigilh/kubernaut/pkg/remediationorchestrator/creator uses a type in com/jordigilh/kubernaut/api/workflowexecution/v1alpha1.
com/jordigilh/kubernaut/pkg/remediationorchestrator/creator uses com/jordigilh/kubernaut/api/workflowexecution/v1alpha1, so a change to com/jordigilh/kubernaut/api/workflowexecution/v1alpha1 can break com/jordigilh/kubernaut/pkg/remediationorchestrator/creator, while a change to com/jordigilh/kubernaut/pkg/remediationorchestrator/creator can't break com/jordigilh/kubernaut/api/workflowexecution/v1alpha1.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/remediationorchestrator/creator uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/notification uses com/jordigilh/kubernaut/pkg/fleet/readiness, so a change to com/jordigilh/kubernaut/pkg/fleet/readiness can break com/jordigilh/kubernaut/cmd/notification, while a change to com/jordigilh/kubernaut/cmd/notification can't break com/jordigilh/kubernaut/pkg/fleet/readiness.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/notification uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/notification uses com/jordigilh/kubernaut/pkg/audit, so a change to com/jordigilh/kubernaut/pkg/audit can break com/jordigilh/kubernaut/cmd/notification, while a change to com/jordigilh/kubernaut/cmd/notification can't break com/jordigilh/kubernaut/pkg/audit.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/notification uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/notification uses com/jordigilh/kubernaut/internal/controller/notification, so a change to com/jordigilh/kubernaut/internal/controller/notification can break com/jordigilh/kubernaut/cmd/notification, while a change to com/jordigilh/kubernaut/cmd/notification can't break com/jordigilh/kubernaut/internal/controller/notification.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/notification uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/signalprocessing uses com/jordigilh/kubernaut/pkg/fleet/readiness, so a change to com/jordigilh/kubernaut/pkg/fleet/readiness can break com/jordigilh/kubernaut/cmd/signalprocessing, while a change to com/jordigilh/kubernaut/cmd/signalprocessing can't break com/jordigilh/kubernaut/pkg/fleet/readiness.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/signalprocessing uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/signalprocessing uses com/jordigilh/kubernaut/pkg/fleet/registry, so a change to com/jordigilh/kubernaut/pkg/fleet/registry can break com/jordigilh/kubernaut/cmd/signalprocessing, while a change to com/jordigilh/kubernaut/cmd/signalprocessing can't break com/jordigilh/kubernaut/pkg/fleet/registry.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/signalprocessing uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/signalprocessing uses com/jordigilh/kubernaut/pkg/audit, so a change to com/jordigilh/kubernaut/pkg/audit can break com/jordigilh/kubernaut/cmd/signalprocessing, while a change to com/jordigilh/kubernaut/cmd/signalprocessing can't break com/jordigilh/kubernaut/pkg/audit.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/signalprocessing uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/signalprocessing uses com/jordigilh/kubernaut/pkg/fleet/mcpclient, so a change to com/jordigilh/kubernaut/pkg/fleet/mcpclient can break com/jordigilh/kubernaut/cmd/signalprocessing, while a change to com/jordigilh/kubernaut/cmd/signalprocessing can't break com/jordigilh/kubernaut/pkg/fleet/mcpclient.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/signalprocessing uses a module listed above it, which is the healthy direction.
3 pairs of types, where a type in com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses a type in com/jordigilh/kubernaut/api/notification/v1alpha1.
com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses com/jordigilh/kubernaut/api/notification/v1alpha1, so a change to com/jordigilh/kubernaut/api/notification/v1alpha1 can break com/jordigilh/kubernaut/internal/controller/remediationorchestrator, while a change to com/jordigilh/kubernaut/internal/controller/remediationorchestrator can't break com/jordigilh/kubernaut/api/notification/v1alpha1.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses a module listed above it, which is the healthy direction.
5 pairs of types, where a type in com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses a type in com/jordigilh/kubernaut/api/aianalysis/v1alpha1.
com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses com/jordigilh/kubernaut/api/aianalysis/v1alpha1, so a change to com/jordigilh/kubernaut/api/aianalysis/v1alpha1 can break com/jordigilh/kubernaut/internal/controller/remediationorchestrator, while a change to com/jordigilh/kubernaut/internal/controller/remediationorchestrator can't break com/jordigilh/kubernaut/api/aianalysis/v1alpha1.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses a module listed above it, which is the healthy direction.
29 pairs of types, where a type in com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses a type in com/jordigilh/kubernaut/api/remediation/v1alpha1. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses com/jordigilh/kubernaut/api/remediation/v1alpha1, so a change to com/jordigilh/kubernaut/api/remediation/v1alpha1 can break com/jordigilh/kubernaut/internal/controller/remediationorchestrator, while a change to com/jordigilh/kubernaut/internal/controller/remediationorchestrator can't break com/jordigilh/kubernaut/api/remediation/v1alpha1.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses a type in com/jordigilh/kubernaut/api/remediationworkflow/v1alpha1.
com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses com/jordigilh/kubernaut/api/remediationworkflow/v1alpha1, so a change to com/jordigilh/kubernaut/api/remediationworkflow/v1alpha1 can break com/jordigilh/kubernaut/internal/controller/remediationorchestrator, while a change to com/jordigilh/kubernaut/internal/controller/remediationorchestrator can't break com/jordigilh/kubernaut/api/remediationworkflow/v1alpha1.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses a type in com/jordigilh/kubernaut/api/signalprocessing/v1alpha1.
com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses com/jordigilh/kubernaut/api/signalprocessing/v1alpha1, so a change to com/jordigilh/kubernaut/api/signalprocessing/v1alpha1 can break com/jordigilh/kubernaut/internal/controller/remediationorchestrator, while a change to com/jordigilh/kubernaut/internal/controller/remediationorchestrator can't break com/jordigilh/kubernaut/api/signalprocessing/v1alpha1.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses a type in com/jordigilh/kubernaut/api/workflowexecution/v1alpha1.
com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses com/jordigilh/kubernaut/api/workflowexecution/v1alpha1, so a change to com/jordigilh/kubernaut/api/workflowexecution/v1alpha1 can break com/jordigilh/kubernaut/internal/controller/remediationorchestrator, while a change to com/jordigilh/kubernaut/internal/controller/remediationorchestrator can't break com/jordigilh/kubernaut/api/workflowexecution/v1alpha1.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses a module listed above it, which is the healthy direction.
4 pairs of types, where a type in com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses a type in com/jordigilh/kubernaut/pkg/audit.
com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses com/jordigilh/kubernaut/pkg/audit, so a change to com/jordigilh/kubernaut/pkg/audit can break com/jordigilh/kubernaut/internal/controller/remediationorchestrator, while a change to com/jordigilh/kubernaut/internal/controller/remediationorchestrator can't break com/jordigilh/kubernaut/pkg/audit.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses a type in com/jordigilh/kubernaut/pkg/fleet.
com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses com/jordigilh/kubernaut/pkg/fleet, so a change to com/jordigilh/kubernaut/pkg/fleet can break com/jordigilh/kubernaut/internal/controller/remediationorchestrator, while a change to com/jordigilh/kubernaut/internal/controller/remediationorchestrator can't break com/jordigilh/kubernaut/pkg/fleet.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses a type in com/jordigilh/kubernaut/pkg/shared/hotreload.
com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses com/jordigilh/kubernaut/pkg/shared/hotreload, so a change to com/jordigilh/kubernaut/pkg/shared/hotreload can break com/jordigilh/kubernaut/internal/controller/remediationorchestrator, while a change to com/jordigilh/kubernaut/internal/controller/remediationorchestrator can't break com/jordigilh/kubernaut/pkg/shared/hotreload.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses a module listed above it, which is the healthy direction.
17 pairs of types, where a type in com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses a type in com/jordigilh/kubernaut/pkg/remediationorchestrator/creator.
com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses com/jordigilh/kubernaut/pkg/remediationorchestrator/creator, so a change to com/jordigilh/kubernaut/pkg/remediationorchestrator/creator can break com/jordigilh/kubernaut/internal/controller/remediationorchestrator, while a change to com/jordigilh/kubernaut/internal/controller/remediationorchestrator can't break com/jordigilh/kubernaut/pkg/remediationorchestrator/creator.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/controller/remediationorchestrator uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in com/jordigilh/kubernaut/internal/kubernautagent/investigator uses a type in com/jordigilh/kubernaut/pkg/kubernautagent/tools.
com/jordigilh/kubernaut/internal/kubernautagent/investigator uses com/jordigilh/kubernaut/pkg/kubernautagent/tools, so a change to com/jordigilh/kubernaut/pkg/kubernautagent/tools can break com/jordigilh/kubernaut/internal/kubernautagent/investigator, while a change to com/jordigilh/kubernaut/internal/kubernautagent/investigator can't break com/jordigilh/kubernaut/pkg/kubernautagent/tools.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/kubernautagent/investigator uses a module listed above it, which is the healthy direction.
13 pairs of types, where a type in com/jordigilh/kubernaut/internal/kubernautagent/investigator uses a type in com/jordigilh/kubernaut/pkg/shared/types.
com/jordigilh/kubernaut/internal/kubernautagent/investigator uses com/jordigilh/kubernaut/pkg/shared/types, so a change to com/jordigilh/kubernaut/pkg/shared/types can break com/jordigilh/kubernaut/internal/kubernautagent/investigator, while a change to com/jordigilh/kubernaut/internal/kubernautagent/investigator can't break com/jordigilh/kubernaut/pkg/shared/types.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/kubernautagent/investigator uses a module listed above it, which is the healthy direction.
6 pairs of types, where a type in com/jordigilh/kubernaut/internal/kubernautagent/investigator uses a type in com/jordigilh/kubernaut/internal/kubernautagent/audit.
com/jordigilh/kubernaut/internal/kubernautagent/investigator uses com/jordigilh/kubernaut/internal/kubernautagent/audit, so a change to com/jordigilh/kubernaut/internal/kubernautagent/audit can break com/jordigilh/kubernaut/internal/kubernautagent/investigator, while a change to com/jordigilh/kubernaut/internal/kubernautagent/investigator can't break com/jordigilh/kubernaut/internal/kubernautagent/audit.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/kubernautagent/investigator uses a module listed above it, which is the healthy direction.
49 pairs of types, where a type in com/jordigilh/kubernaut/internal/kubernautagent/investigator uses a type in com/jordigilh/kubernaut/pkg/kubernautagent/types. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
com/jordigilh/kubernaut/internal/kubernautagent/investigator uses com/jordigilh/kubernaut/pkg/kubernautagent/types, so a change to com/jordigilh/kubernaut/pkg/kubernautagent/types can break com/jordigilh/kubernaut/internal/kubernautagent/investigator, while a change to com/jordigilh/kubernaut/internal/kubernautagent/investigator can't break com/jordigilh/kubernaut/pkg/kubernautagent/types.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/kubernautagent/investigator uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/launcher uses com/jordigilh/kubernaut/pkg/shared/types, so a change to com/jordigilh/kubernaut/pkg/shared/types can break com/jordigilh/kubernaut/pkg/apifrontend/launcher, while a change to com/jordigilh/kubernaut/pkg/apifrontend/launcher can't break com/jordigilh/kubernaut/pkg/shared/types.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/launcher uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/launcher uses com/jordigilh/kubernaut/pkg/apifrontend/audit, so a change to com/jordigilh/kubernaut/pkg/apifrontend/audit can break com/jordigilh/kubernaut/pkg/apifrontend/launcher, while a change to com/jordigilh/kubernaut/pkg/apifrontend/launcher can't break com/jordigilh/kubernaut/pkg/apifrontend/audit.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/launcher uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/launcher uses com/jordigilh/kubernaut/pkg/kubernautagent/types, so a change to com/jordigilh/kubernaut/pkg/kubernautagent/types can break com/jordigilh/kubernaut/pkg/apifrontend/launcher, while a change to com/jordigilh/kubernaut/pkg/apifrontend/launcher can't break com/jordigilh/kubernaut/pkg/kubernautagent/types.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/launcher uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/policyread uses com/jordigilh/kubernaut/pkg/shared/scope, so a change to com/jordigilh/kubernaut/pkg/shared/scope can break com/jordigilh/kubernaut/pkg/apifrontend/policyread, while a change to com/jordigilh/kubernaut/pkg/apifrontend/policyread can't break com/jordigilh/kubernaut/pkg/shared/scope.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/policyread uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/policyread uses com/jordigilh/kubernaut/api/aianalysis/v1alpha1, so a change to com/jordigilh/kubernaut/api/aianalysis/v1alpha1 can break com/jordigilh/kubernaut/pkg/apifrontend/policyread, while a change to com/jordigilh/kubernaut/pkg/apifrontend/policyread can't break com/jordigilh/kubernaut/api/aianalysis/v1alpha1.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/policyread uses a module listed above it, which is the healthy direction.
5 pairs of types, where a type in com/jordigilh/kubernaut/pkg/apifrontend/policyread uses a type in com/jordigilh/kubernaut/api/signalprocessing/v1alpha1.
com/jordigilh/kubernaut/pkg/apifrontend/policyread uses com/jordigilh/kubernaut/api/signalprocessing/v1alpha1, so a change to com/jordigilh/kubernaut/api/signalprocessing/v1alpha1 can break com/jordigilh/kubernaut/pkg/apifrontend/policyread, while a change to com/jordigilh/kubernaut/pkg/apifrontend/policyread can't break com/jordigilh/kubernaut/api/signalprocessing/v1alpha1.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/policyread uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/policyread uses com/jordigilh/kubernaut/pkg/apifrontend/audit, so a change to com/jordigilh/kubernaut/pkg/apifrontend/audit can break com/jordigilh/kubernaut/pkg/apifrontend/policyread, while a change to com/jordigilh/kubernaut/pkg/apifrontend/policyread can't break com/jordigilh/kubernaut/pkg/apifrontend/audit.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/policyread uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/remediationorchestrator uses com/jordigilh/kubernaut/pkg/fleet/readiness, so a change to com/jordigilh/kubernaut/pkg/fleet/readiness can break com/jordigilh/kubernaut/cmd/remediationorchestrator, while a change to com/jordigilh/kubernaut/cmd/remediationorchestrator can't break com/jordigilh/kubernaut/pkg/fleet/readiness.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/remediationorchestrator uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/remediationorchestrator uses com/jordigilh/kubernaut/pkg/audit, so a change to com/jordigilh/kubernaut/pkg/audit can break com/jordigilh/kubernaut/cmd/remediationorchestrator, while a change to com/jordigilh/kubernaut/cmd/remediationorchestrator can't break com/jordigilh/kubernaut/pkg/audit.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/remediationorchestrator uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/remediationorchestrator uses com/jordigilh/kubernaut/pkg/fleet, so a change to com/jordigilh/kubernaut/pkg/fleet can break com/jordigilh/kubernaut/cmd/remediationorchestrator, while a change to com/jordigilh/kubernaut/cmd/remediationorchestrator can't break com/jordigilh/kubernaut/pkg/fleet.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/remediationorchestrator uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/remediationorchestrator uses com/jordigilh/kubernaut/pkg/fleet/mcpclient, so a change to com/jordigilh/kubernaut/pkg/fleet/mcpclient can break com/jordigilh/kubernaut/cmd/remediationorchestrator, while a change to com/jordigilh/kubernaut/cmd/remediationorchestrator can't break com/jordigilh/kubernaut/pkg/fleet/mcpclient.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/remediationorchestrator uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/jordigilh/kubernaut/cmd/remediationorchestrator uses a type in com/jordigilh/kubernaut/pkg/remediationorchestrator/creator.
com/jordigilh/kubernaut/cmd/remediationorchestrator uses com/jordigilh/kubernaut/pkg/remediationorchestrator/creator, so a change to com/jordigilh/kubernaut/pkg/remediationorchestrator/creator can break com/jordigilh/kubernaut/cmd/remediationorchestrator, while a change to com/jordigilh/kubernaut/cmd/remediationorchestrator can't break com/jordigilh/kubernaut/pkg/remediationorchestrator/creator.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/remediationorchestrator uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/jordigilh/kubernaut/cmd/remediationorchestrator uses a type in com/jordigilh/kubernaut/internal/controller/remediationorchestrator.
com/jordigilh/kubernaut/cmd/remediationorchestrator uses com/jordigilh/kubernaut/internal/controller/remediationorchestrator, so a change to com/jordigilh/kubernaut/internal/controller/remediationorchestrator can break com/jordigilh/kubernaut/cmd/remediationorchestrator, while a change to com/jordigilh/kubernaut/cmd/remediationorchestrator can't break com/jordigilh/kubernaut/internal/controller/remediationorchestrator.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/remediationorchestrator uses a module listed above it, which is the healthy direction.
4 pairs of types, where a type in com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools uses a type in com/jordigilh/kubernaut/pkg/datastorage/models.
com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools uses com/jordigilh/kubernaut/pkg/datastorage/models, so a change to com/jordigilh/kubernaut/pkg/datastorage/models can break com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools, while a change to com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools can't break com/jordigilh/kubernaut/pkg/datastorage/models.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools uses a module listed above it, which is the healthy direction.
3 pairs of types, where a type in com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools uses a type in com/jordigilh/kubernaut/internal/kubernautagent/audit.
com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools uses com/jordigilh/kubernaut/internal/kubernautagent/audit, so a change to com/jordigilh/kubernaut/internal/kubernautagent/audit can break com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools, while a change to com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools can't break com/jordigilh/kubernaut/internal/kubernautagent/audit.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools uses a module listed above it, which is the healthy direction.
13 pairs of types, where a type in com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools uses a type in com/jordigilh/kubernaut/pkg/kubernautagent/types.
com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools uses com/jordigilh/kubernaut/pkg/kubernautagent/types, so a change to com/jordigilh/kubernaut/pkg/kubernautagent/types can break com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools, while a change to com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools can't break com/jordigilh/kubernaut/pkg/kubernautagent/types.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools uses a type in com/jordigilh/kubernaut/internal/kubernautagent/investigator.
com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools uses com/jordigilh/kubernaut/internal/kubernautagent/investigator, so a change to com/jordigilh/kubernaut/internal/kubernautagent/investigator can break com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools, while a change to com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools can't break com/jordigilh/kubernaut/internal/kubernautagent/investigator.
Position
Below the diagonal: com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/tools uses com/jordigilh/kubernaut/pkg/fleet/registry, so a change to com/jordigilh/kubernaut/pkg/fleet/registry can break com/jordigilh/kubernaut/pkg/apifrontend/tools, while a change to com/jordigilh/kubernaut/pkg/apifrontend/tools can't break com/jordigilh/kubernaut/pkg/fleet/registry.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/tools uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/tools uses com/jordigilh/kubernaut/pkg/shared/scope, so a change to com/jordigilh/kubernaut/pkg/shared/scope can break com/jordigilh/kubernaut/pkg/apifrontend/tools, while a change to com/jordigilh/kubernaut/pkg/apifrontend/tools can't break com/jordigilh/kubernaut/pkg/shared/scope.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/tools uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/tools uses com/jordigilh/kubernaut/pkg/shared/types, so a change to com/jordigilh/kubernaut/pkg/shared/types can break com/jordigilh/kubernaut/pkg/apifrontend/tools, while a change to com/jordigilh/kubernaut/pkg/apifrontend/tools can't break com/jordigilh/kubernaut/pkg/shared/types.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/tools uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/tools uses com/jordigilh/kubernaut/api/remediation/v1alpha1, so a change to com/jordigilh/kubernaut/api/remediation/v1alpha1 can break com/jordigilh/kubernaut/pkg/apifrontend/tools, while a change to com/jordigilh/kubernaut/pkg/apifrontend/tools can't break com/jordigilh/kubernaut/api/remediation/v1alpha1.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/tools uses a module listed above it, which is the healthy direction.
3 pairs of types, where a type in com/jordigilh/kubernaut/pkg/apifrontend/tools uses a type in com/jordigilh/kubernaut/api/remediationworkflow/v1alpha1.
com/jordigilh/kubernaut/pkg/apifrontend/tools uses com/jordigilh/kubernaut/api/remediationworkflow/v1alpha1, so a change to com/jordigilh/kubernaut/api/remediationworkflow/v1alpha1 can break com/jordigilh/kubernaut/pkg/apifrontend/tools, while a change to com/jordigilh/kubernaut/pkg/apifrontend/tools can't break com/jordigilh/kubernaut/api/remediationworkflow/v1alpha1.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/tools uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/tools uses com/jordigilh/kubernaut/pkg/apifrontend/audit, so a change to com/jordigilh/kubernaut/pkg/apifrontend/audit can break com/jordigilh/kubernaut/pkg/apifrontend/tools, while a change to com/jordigilh/kubernaut/pkg/apifrontend/tools can't break com/jordigilh/kubernaut/pkg/apifrontend/audit.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/tools uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/tools uses com/jordigilh/kubernaut/pkg/kubernautagent/types, so a change to com/jordigilh/kubernaut/pkg/kubernautagent/types can break com/jordigilh/kubernaut/pkg/apifrontend/tools, while a change to com/jordigilh/kubernaut/pkg/apifrontend/tools can't break com/jordigilh/kubernaut/pkg/kubernautagent/types.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/tools uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/tools uses com/jordigilh/kubernaut/pkg/apifrontend/launcher, so a change to com/jordigilh/kubernaut/pkg/apifrontend/launcher can break com/jordigilh/kubernaut/pkg/apifrontend/tools, while a change to com/jordigilh/kubernaut/pkg/apifrontend/tools can't break com/jordigilh/kubernaut/pkg/apifrontend/launcher.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/tools uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/kubernautagent uses com/jordigilh/kubernaut/pkg/fleet/readiness, so a change to com/jordigilh/kubernaut/pkg/fleet/readiness can break com/jordigilh/kubernaut/cmd/kubernautagent, while a change to com/jordigilh/kubernaut/cmd/kubernautagent can't break com/jordigilh/kubernaut/pkg/fleet/readiness.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/kubernautagent uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/kubernautagent uses com/jordigilh/kubernaut/pkg/fleet/registry, so a change to com/jordigilh/kubernaut/pkg/fleet/registry can break com/jordigilh/kubernaut/cmd/kubernautagent, while a change to com/jordigilh/kubernaut/cmd/kubernautagent can't break com/jordigilh/kubernaut/pkg/fleet/registry.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/kubernautagent uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/kubernautagent uses com/jordigilh/kubernaut/pkg/kubernautagent/tools, so a change to com/jordigilh/kubernaut/pkg/kubernautagent/tools can break com/jordigilh/kubernaut/cmd/kubernautagent, while a change to com/jordigilh/kubernaut/cmd/kubernautagent can't break com/jordigilh/kubernaut/pkg/kubernautagent/tools.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/kubernautagent uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/kubernautagent uses com/jordigilh/kubernaut/pkg/shared/types, so a change to com/jordigilh/kubernaut/pkg/shared/types can break com/jordigilh/kubernaut/cmd/kubernautagent, while a change to com/jordigilh/kubernaut/cmd/kubernautagent can't break com/jordigilh/kubernaut/pkg/shared/types.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/kubernautagent uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/kubernautagent uses com/jordigilh/kubernaut/pkg/datastorage/models, so a change to com/jordigilh/kubernaut/pkg/datastorage/models can break com/jordigilh/kubernaut/cmd/kubernautagent, while a change to com/jordigilh/kubernaut/cmd/kubernautagent can't break com/jordigilh/kubernaut/pkg/datastorage/models.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/kubernautagent uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/kubernautagent uses com/jordigilh/kubernaut/pkg/fleet, so a change to com/jordigilh/kubernaut/pkg/fleet can break com/jordigilh/kubernaut/cmd/kubernautagent, while a change to com/jordigilh/kubernaut/cmd/kubernautagent can't break com/jordigilh/kubernaut/pkg/fleet.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/kubernautagent uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/kubernautagent uses com/jordigilh/kubernaut/internal/kubernautagent/audit, so a change to com/jordigilh/kubernaut/internal/kubernautagent/audit can break com/jordigilh/kubernaut/cmd/kubernautagent, while a change to com/jordigilh/kubernaut/cmd/kubernautagent can't break com/jordigilh/kubernaut/internal/kubernautagent/audit.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/kubernautagent uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/kubernautagent uses com/jordigilh/kubernaut/pkg/fleet/mcpclient, so a change to com/jordigilh/kubernaut/pkg/fleet/mcpclient can break com/jordigilh/kubernaut/cmd/kubernautagent, while a change to com/jordigilh/kubernaut/cmd/kubernautagent can't break com/jordigilh/kubernaut/pkg/fleet/mcpclient.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/kubernautagent uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/kubernautagent uses com/jordigilh/kubernaut/pkg/kubernautagent/types, so a change to com/jordigilh/kubernaut/pkg/kubernautagent/types can break com/jordigilh/kubernaut/cmd/kubernautagent, while a change to com/jordigilh/kubernaut/cmd/kubernautagent can't break com/jordigilh/kubernaut/pkg/kubernautagent/types.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/kubernautagent uses a module listed above it, which is the healthy direction.
18 pairs of types, where a type in com/jordigilh/kubernaut/cmd/kubernautagent uses a type in com/jordigilh/kubernaut/internal/kubernautagent/investigator.
com/jordigilh/kubernaut/cmd/kubernautagent uses com/jordigilh/kubernaut/internal/kubernautagent/investigator, so a change to com/jordigilh/kubernaut/internal/kubernautagent/investigator can break com/jordigilh/kubernaut/cmd/kubernautagent, while a change to com/jordigilh/kubernaut/cmd/kubernautagent can't break com/jordigilh/kubernaut/internal/kubernautagent/investigator.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/kubernautagent uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/kubernautagent uses com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools, so a change to com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools can break com/jordigilh/kubernaut/cmd/kubernautagent, while a change to com/jordigilh/kubernaut/cmd/kubernautagent can't break com/jordigilh/kubernaut/internal/kubernautagent/mcp/tools.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/kubernautagent uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/agent uses com/jordigilh/kubernaut/pkg/fleet/registry, so a change to com/jordigilh/kubernaut/pkg/fleet/registry can break com/jordigilh/kubernaut/pkg/apifrontend/agent, while a change to com/jordigilh/kubernaut/pkg/apifrontend/agent can't break com/jordigilh/kubernaut/pkg/fleet/registry.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/agent uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/agent uses com/jordigilh/kubernaut/pkg/shared/scope, so a change to com/jordigilh/kubernaut/pkg/shared/scope can break com/jordigilh/kubernaut/pkg/apifrontend/agent, while a change to com/jordigilh/kubernaut/pkg/apifrontend/agent can't break com/jordigilh/kubernaut/pkg/shared/scope.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/agent uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/agent uses com/jordigilh/kubernaut/pkg/apifrontend/audit, so a change to com/jordigilh/kubernaut/pkg/apifrontend/audit can break com/jordigilh/kubernaut/pkg/apifrontend/agent, while a change to com/jordigilh/kubernaut/pkg/apifrontend/agent can't break com/jordigilh/kubernaut/pkg/apifrontend/audit.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/agent uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/agent uses com/jordigilh/kubernaut/pkg/kubernautagent/types, so a change to com/jordigilh/kubernaut/pkg/kubernautagent/types can break com/jordigilh/kubernaut/pkg/apifrontend/agent, while a change to com/jordigilh/kubernaut/pkg/apifrontend/agent can't break com/jordigilh/kubernaut/pkg/kubernautagent/types.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/agent uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/agent uses com/jordigilh/kubernaut/pkg/apifrontend/launcher, so a change to com/jordigilh/kubernaut/pkg/apifrontend/launcher can break com/jordigilh/kubernaut/pkg/apifrontend/agent, while a change to com/jordigilh/kubernaut/pkg/apifrontend/agent can't break com/jordigilh/kubernaut/pkg/apifrontend/launcher.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/agent uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/agent uses com/jordigilh/kubernaut/pkg/apifrontend/tools, so a change to com/jordigilh/kubernaut/pkg/apifrontend/tools can break com/jordigilh/kubernaut/pkg/apifrontend/agent, while a change to com/jordigilh/kubernaut/pkg/apifrontend/agent can't break com/jordigilh/kubernaut/pkg/apifrontend/tools.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/agent uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/handler uses com/jordigilh/kubernaut/pkg/shared/scope, so a change to com/jordigilh/kubernaut/pkg/shared/scope can break com/jordigilh/kubernaut/pkg/apifrontend/handler, while a change to com/jordigilh/kubernaut/pkg/apifrontend/handler can't break com/jordigilh/kubernaut/pkg/shared/scope.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/handler uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/handler uses com/jordigilh/kubernaut/api/remediation/v1alpha1, so a change to com/jordigilh/kubernaut/api/remediation/v1alpha1 can break com/jordigilh/kubernaut/pkg/apifrontend/handler, while a change to com/jordigilh/kubernaut/pkg/apifrontend/handler can't break com/jordigilh/kubernaut/api/remediation/v1alpha1.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/handler uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/handler uses com/jordigilh/kubernaut/pkg/apifrontend/audit, so a change to com/jordigilh/kubernaut/pkg/apifrontend/audit can break com/jordigilh/kubernaut/pkg/apifrontend/handler, while a change to com/jordigilh/kubernaut/pkg/apifrontend/handler can't break com/jordigilh/kubernaut/pkg/apifrontend/audit.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/handler uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/handler uses com/jordigilh/kubernaut/pkg/apifrontend/launcher, so a change to com/jordigilh/kubernaut/pkg/apifrontend/launcher can break com/jordigilh/kubernaut/pkg/apifrontend/handler, while a change to com/jordigilh/kubernaut/pkg/apifrontend/handler can't break com/jordigilh/kubernaut/pkg/apifrontend/launcher.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/handler uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/handler uses com/jordigilh/kubernaut/pkg/apifrontend/policyread, so a change to com/jordigilh/kubernaut/pkg/apifrontend/policyread can break com/jordigilh/kubernaut/pkg/apifrontend/handler, while a change to com/jordigilh/kubernaut/pkg/apifrontend/handler can't break com/jordigilh/kubernaut/pkg/apifrontend/policyread.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/handler uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/pkg/apifrontend/handler uses com/jordigilh/kubernaut/pkg/apifrontend/tools, so a change to com/jordigilh/kubernaut/pkg/apifrontend/tools can break com/jordigilh/kubernaut/pkg/apifrontend/handler, while a change to com/jordigilh/kubernaut/pkg/apifrontend/handler can't break com/jordigilh/kubernaut/pkg/apifrontend/tools.
Position
Below the diagonal: com/jordigilh/kubernaut/pkg/apifrontend/handler uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/apifrontend uses com/jordigilh/kubernaut/pkg/fleet/readiness, so a change to com/jordigilh/kubernaut/pkg/fleet/readiness can break com/jordigilh/kubernaut/cmd/apifrontend, while a change to com/jordigilh/kubernaut/cmd/apifrontend can't break com/jordigilh/kubernaut/pkg/fleet/readiness.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/apifrontend uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/apifrontend uses com/jordigilh/kubernaut/pkg/fleet/registry, so a change to com/jordigilh/kubernaut/pkg/fleet/registry can break com/jordigilh/kubernaut/cmd/apifrontend, while a change to com/jordigilh/kubernaut/cmd/apifrontend can't break com/jordigilh/kubernaut/pkg/fleet/registry.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/apifrontend uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/apifrontend uses com/jordigilh/kubernaut/pkg/shared/scope, so a change to com/jordigilh/kubernaut/pkg/shared/scope can break com/jordigilh/kubernaut/cmd/apifrontend, while a change to com/jordigilh/kubernaut/cmd/apifrontend can't break com/jordigilh/kubernaut/pkg/shared/scope.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/apifrontend uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/apifrontend uses com/jordigilh/kubernaut/pkg/shared/types, so a change to com/jordigilh/kubernaut/pkg/shared/types can break com/jordigilh/kubernaut/cmd/apifrontend, while a change to com/jordigilh/kubernaut/cmd/apifrontend can't break com/jordigilh/kubernaut/pkg/shared/types.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/apifrontend uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/apifrontend uses com/jordigilh/kubernaut/pkg/fleet, so a change to com/jordigilh/kubernaut/pkg/fleet can break com/jordigilh/kubernaut/cmd/apifrontend, while a change to com/jordigilh/kubernaut/cmd/apifrontend can't break com/jordigilh/kubernaut/pkg/fleet.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/apifrontend uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/apifrontend uses com/jordigilh/kubernaut/pkg/shared/hotreload, so a change to com/jordigilh/kubernaut/pkg/shared/hotreload can break com/jordigilh/kubernaut/cmd/apifrontend, while a change to com/jordigilh/kubernaut/cmd/apifrontend can't break com/jordigilh/kubernaut/pkg/shared/hotreload.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/apifrontend uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/apifrontend uses com/jordigilh/kubernaut/pkg/apifrontend/audit, so a change to com/jordigilh/kubernaut/pkg/apifrontend/audit can break com/jordigilh/kubernaut/cmd/apifrontend, while a change to com/jordigilh/kubernaut/cmd/apifrontend can't break com/jordigilh/kubernaut/pkg/apifrontend/audit.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/apifrontend uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/apifrontend uses com/jordigilh/kubernaut/pkg/fleet/mcpclient, so a change to com/jordigilh/kubernaut/pkg/fleet/mcpclient can break com/jordigilh/kubernaut/cmd/apifrontend, while a change to com/jordigilh/kubernaut/cmd/apifrontend can't break com/jordigilh/kubernaut/pkg/fleet/mcpclient.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/apifrontend uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/apifrontend uses com/jordigilh/kubernaut/pkg/apifrontend/launcher, so a change to com/jordigilh/kubernaut/pkg/apifrontend/launcher can break com/jordigilh/kubernaut/cmd/apifrontend, while a change to com/jordigilh/kubernaut/cmd/apifrontend can't break com/jordigilh/kubernaut/pkg/apifrontend/launcher.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/apifrontend uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/apifrontend uses com/jordigilh/kubernaut/pkg/apifrontend/policyread, so a change to com/jordigilh/kubernaut/pkg/apifrontend/policyread can break com/jordigilh/kubernaut/cmd/apifrontend, while a change to com/jordigilh/kubernaut/cmd/apifrontend can't break com/jordigilh/kubernaut/pkg/apifrontend/policyread.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/apifrontend uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/apifrontend uses com/jordigilh/kubernaut/pkg/apifrontend/tools, so a change to com/jordigilh/kubernaut/pkg/apifrontend/tools can break com/jordigilh/kubernaut/cmd/apifrontend, while a change to com/jordigilh/kubernaut/cmd/apifrontend can't break com/jordigilh/kubernaut/pkg/apifrontend/tools.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/apifrontend uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/apifrontend uses com/jordigilh/kubernaut/pkg/apifrontend/agent, so a change to com/jordigilh/kubernaut/pkg/apifrontend/agent can break com/jordigilh/kubernaut/cmd/apifrontend, while a change to com/jordigilh/kubernaut/cmd/apifrontend can't break com/jordigilh/kubernaut/pkg/apifrontend/agent.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/apifrontend uses a module listed above it, which is the healthy direction.
com/jordigilh/kubernaut/cmd/apifrontend uses com/jordigilh/kubernaut/pkg/apifrontend/handler, so a change to com/jordigilh/kubernaut/pkg/apifrontend/handler can break com/jordigilh/kubernaut/cmd/apifrontend, while a change to com/jordigilh/kubernaut/cmd/apifrontend can't break com/jordigilh/kubernaut/pkg/apifrontend/handler.
Position
Below the diagonal: com/jordigilh/kubernaut/cmd/apifrontend uses a module listed above it, which is the healthy direction.
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
A05:2025 — Injection
37
High / Critical
A02:2025 — Security Misconfiguration
36
High / Critical
A07:2025 — Authentication Failures
12
High / Critical
A03:2025 — Software Supply Chain Failures
7
Medium
Roadmap
Top priorities: Reconcile the README with reality: docs/README.md links to `value-proposition/README.md`, but `docs/value-proposition/README.md` does not exist; docs/README.md links to `value-proposition/TECHNICAL_SCENARIOS.md`, but `docs/value-proposition/TECHNICAL_SCENARIOS.md` does not exist; docs/README.md links to `value-proposition/V1_VS_V2_CAPABILITIES.md`, but `docs/value-proposition/V1_VS_V2_CAPABILITIES.md` does not exist; docs/README.md links to `development/getting-started/setup/PGVECTOR_SETUP_GUIDE.md`, but `docs/development/getting-started/setup/PGVECTOR_SETUP_GUIDE.md` does not exist; docs/README.md links to `architecture/AI_CONTEXT_ORCHESTRATION_ARCHITECTURE.md`, but `docs/architecture/AI_CONTEXT_ORCHESTRATION_ARCHITECTURE.md` does not exist; Resolve the 3 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2), REDACTED; Give every `http.Client` an explicit `Timeout` (never call `http.Get`/`http.Post` or `http.DefaultClient`, which have none), or build each request with `http.NewRequestWithContext` under a `context.WithTimeout`; add retry with back-off (`hashicorp/go-retryablehttp`) and a breaker (`sony/gobreaker`) around dependencies that fail.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 3 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2), REDACTED.
Reconcile the README with reality: docs/README.md links to `value-proposition/README.md`, but `docs/value-proposition/README.md` does not exist; docs/README.md links to `value-proposition/TECHNICAL_SCENARIOS.md`, but `docs/value-proposition/TECHNICAL_SCENARIOS.md` does not exist; docs/README.md links to `value-proposition/V1_VS_V2_CAPABILITIES.md`, but `docs/value-proposition/V1_VS_V2_CAPABILITIES.md` does not exist; docs/README.md links to `development/getting-started/setup/PGVECTOR_SETUP_GUIDE.md`, but `docs/development/getting-started/setup/PGVECTOR_SETUP_GUIDE.md` does not exist; docs/README.md links to `architecture/AI_CONTEXT_ORCHESTRATION_ARCHITECTURE.md`, but `docs/architecture/AI_CONTEXT_ORCHESTRATION_ARCHITECTURE.md` does not exist.
Give every `http.Client` an explicit `Timeout` (never call `http.Get`/`http.Post` or `http.DefaultClient`, which have none), or build each request with `http.NewRequestWithContext` under a `context.WithTimeout`; add retry with back-off (`hashicorp/go-retryablehttp`) and a breaker (`sony/gobreaker`) around dependencies that fail.
Code Duplication: Edited copies of one member (4 members, 18+ corresponding lines)
pkg/gateway/audit_emission.go
5.7
Mixed
Code Duplication: Edited copies of one member (3 members, 48+ corresponding lines)
cmd/datastorage/main.go
5.7
Mixed
Code Duplication: Edited copy of a member (33 corresponding lines)
REDACTED
5.7
Mixed
Static Analysis (SAST): High: REDACTED
How the grades work
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 — 51
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 — 1038
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 — 650
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 18
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 63 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 1.0, 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 — 63 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, 1726 of 1739 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.
D7 Architectural Integrity — 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. These records DO declare how the decision is enforced; FileSystemAdrInventoryBuilder.ParseEnforcement maps a fixed vocabulary (`prose`, `test`, `analyzer`, `mechanical`, `judgment`, `judgement`, `process`, `not-applicable`) and these values are outside it. Each was therefore treated as Unclassified: counted into the mechanizable set, but excluded from the scored set because nothing claimed it enforceable. That exclusion rests on our word list, not on the repository. Affected ADR(s): docs/architecture/decisions/ADR-051-operator-sdk-webhook-scaffolding.md, docs/architecture/decisions/ADR-071-CONFIGURATION-MANAGEMENT.md, docs/architecture/decisions/ADR-CI-001-ci-pipeline-testing-strategy.md, docs/architecture/decisions/ADR-E2E-001-DEPLOYMENT-PATTERNS.md, docs/architecture/decisions/DD-GATEWAY-012-redis-removal.md, docs/architecture/decisions/DD-KA-003-mandatory-openapi-client-usage.md, docs/architecture/decisions/DD-NOT-007-DELIVERY-ORCHESTRATOR-REGISTRATION-PATTERN.md, docs/architecture/decisions/DD-REGISTRY-001-container-registry-strategy.md, docs/architecture/decisions/DD-TEST-001-port-allocation-strategy.md, docs/architecture/decisions/DD-TESTING-001-audit-event-validation-standards.md. You can widen what we reach: no action is needed from this repository — the gap is in our parser. The values above are reported so the vocabulary can be added; declaring `enforcement: analyzer`, `test`, `prose` or `not-applicable` alongside your own grading would settle these ADRs immediately.
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-maintainer repository — bus factor is not applicable (3 contributor(s) across 9960 commit(s) sampled, automation and bot accounts excluded). One of them holds 100% of the history; the other 2 hold 0% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
D19 Documentation Quality — 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 ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D19 Documentation Quality — 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 kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D20 ADR Quality — 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. The ADR lexicon (adr-lexicon-1) covers de, en, it, nl. A record identified as another language, or whose language could not be identified (fewer than 25 words of prose, or no clear winner), is never read with English rules: its missing-section, status, consequence-cost and same-question rules abstain, and only the structural rules (title, single option, dangling link, enforcement field) run.
D21 Naming Consistency — 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. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
D21 Naming Consistency — 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. 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.
D24 Comment Value — 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. D24 compares a comment's words with the identifiers, literals and constructs of the code it annotates, using English function-word and rationale lexicons. Comments in another script or language were left unread rather than counted as clean.
D24 Comment Value — 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. 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.
D25 ADR Conformance — 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. The prohibition grammar (cue words, exception markers, scope prepositions) is English. A decision in another language is never read with it. An `adr-rules` block is read in any language.
D25 ADR Conformance — 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. The code index reads C#, Razor, TypeScript, JavaScript and Vue. A rule whose scope holds production code in another language is not called honoured, because its uses could sit in that code.
D31 IaC & Container Security — 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. Checkov ran but its report could not be read (checkov produced no output — not a clean result). Every misconfiguration only checkov reports — most of its Terraform, CloudFormation, Bicep and Ansible policies — is absent from this card, so its absence here is not evidence those resources are configured correctly.
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. `internal/kubernautagent/mcp/tools/select_workflow.go`, `pkg/fleet/fmc/inventory.go`, `pkg/kubernautagent/types/live_selection.go` 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.
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 REDACTED (docs/spikes/oas-runtime/Dockerfile). the image ran but published no HTTP port — nothing to crawl (EXPOSE the web port to unlock runtime evidence).
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.
DM8 Value-object opportunities — 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 finds primitive parameters that travel together through several signatures of the domain (a missing value object). Its deterministic rule has not yet shown 95 % precision on adjudicated rows, so the clumps it finds are counted here and not published as findings, and the card carries no score. That is a limit of the analyzer, not a finding about your code.
DM9 Scattered domain decisions — 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. Arm two tells a construction that PRODUCES a measurement from one that merely passes it along, and this repository's frontend does not compute that fact. A measurement built independently in two places would not appear above.
DM9 Scattered domain decisions — 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. Some of this repository's production types come from a frontend that does not bind comparison operands to the members they read, which arm one needs, and those types were not walked for this dimension. The counts above speak for the languages that declare it.
GD1 Unfinished & placeholder code — 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 reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Java was found, and this repository's Go, Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — 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 reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby, Scala or Rust was found, and this repository's Go, Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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.
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. 22 further occurrence(s) are not listed individually; the score already reflects all 62.
X12 Unreachable branch — 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.
X16 Unfloored truncation loop — 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 reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala, Kotlin and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala, Kotlin or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X17 Uncapped recursion over a caller-supplied document — 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 reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Kotlin or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X18 Disposal-pattern correctness — 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 reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala, PHP and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala, PHP or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X24 Document value interpolated into markup unescaped — 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 reads C# syntax, and JavaScript/TypeScript, Java, Scala, Ruby and Python source only, and no C# was loaded and no JavaScript/TypeScript, Java, Scala, Ruby or Python was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X29 Per-element action decided by a fixed element — 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 reads C# syntax, and JavaScript/TypeScript (Vue and Svelte components included), Java, Rust, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X3 Exception handling — 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. 124 further occurrence(s) are not listed individually; the score already reflects all 164.
X5 Nullable reference types — 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 reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, Kotlin source, and Rust source only, and no C# was loaded, no TypeScript was found, and this repository's Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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.
D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
D8 Code Coverage: Coverage is measured by building and running the test suite inside our isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
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.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
D22 Internal API Consistency: API consistency compares the call shapes of members that play the same role on the exposed C# surface: whether the API suits its callers is not measured, and surfaces in other languages are not measured.
D23 Boundary Type-Coupling: Boundary leakage is detected from type references across detected contexts — leaks that flow through primitives, serialization or shared infrastructure may not surface as a typed reference.
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.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
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 (REDACTED, 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.
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.
DM4 Rich vs anemic model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
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".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
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.
Bring the 1 body over 15 down to 15 or less in Cyclomatic Complexity — start with prompt.BuildRCAProvisionalReviewSection (cyclomatic 16). — Refactoring it lifts Cyclomatic Complexity from 9.9 to about 10.0/10.
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.
+ 72 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 78 bodies over 15 down to 15 or less in Cognitive Complexity — start with runtime.sdkEventToACP (cognitive 20), controller.ComputePodHealthStats (cognitive 20), prompt.BuildRCAProvisionalReviewSection (cognitive 20). — 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 78 together lifts Cognitive Complexity from 7.7 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes9.3 / 10Stronggated by 41 serious findings✓ 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 FileTooLong finding(s) in God Classes — start with REDACTED (2), investigator_gates.go, notification.go. — One of this dimension's main actionable groups (19 warning-level).
Resolve the 11 TooManyMethods finding(s) in God Classes — start with reconciler.go (2), server.go (2), investigator.go. — One of this dimension's main actionable groups (11 warning-level).
Resolve the 7 ClassTooLong finding(s) in God Classes — start with notificationrequest_controller.go, notification.go, dispatcher.go. — One of this dimension's main actionable groups (7 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.
326 duplicated block group(s) detected. 8.1 % of the production lines (16,320 of 200,263) are in a reported copy. A further 262 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 1 of the 588 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
+ 171 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 33 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with REDACTED (3), client.go (3), awx_client.go (3). — One of this dimension's main actionable groups (33 warning-level).
Resolve the 29 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with REDACTED (3), evaluator.go (2), eaigw_registry.go (2). — One of this dimension's main actionable groups (29 warning-level).
Resolve the 27 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with REDACTED (5), manager.go (2), REDACTED (2). — One of this dimension's main actionable groups (27 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling10.0 / 10Exemplary✓ 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.
6 production modules (Go), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 0 module(s) off the main sequence.
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.
Resolve the 8 Low cohesion finding(s) in Cohesion (LCOM4) — start with REDACTED (2), mcp_client.go, remediationrequest_types.go. — One of this dimension's main actionable groups (8 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the code respects its intended layering / architecture rules.
Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.
No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
What it measures: How much of the code is actually exercised by tests.
Method: Coverage from the analyzer's own run of the suite, computed per-file with structured exclusions for generated, trivial, and glue code. A coverage report found in the repository is never read. When the suite can't be built/run in-image, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.
Line coverage 74.7% — 98 file(s) below 50%. Measured from the Go suite (github.com/jordigilh/kubernaut: `go test -coverprofile -coverpkg=./...`, the 3 run(s) test reliability made; github.com/jordigilh/kubernaut/spikes/acp-enforcement: `go test -coverprofile -coverpkg=./...`, the 3 run(s) test reliability made). Taken over 3 runs of the suite: a line counts as covered only when every run executed it. 28 line(s) in 8 file(s) were executed in some runs and not in others, so they are not counted.
Tests reach code only in some runs: internal/kubernautagent/workflowcatalog/lazy_catalog.go · ×8internal/kubernautagent/workflowcatalog/lazy_catalog.go:118
What to do
Resolve the 98 Low coverage finding(s) in Code Coverage — start with REDACTED (19), manager.go (6), client.go (4). — One of this dimension's main actionable groups (98 warning-level).
Resolve the 8 Tests reach code only in some runs finding(s) in Code Coverage — start with lazy_catalog.go, session_pool.go, streaming_executor.go. — One of this dimension's main actionable groups (8 recommendation-level).
Detailed fixes: d8_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests pass reliably, with no flakiness.
Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.
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.
8 outdated, 0 author-deprecated direct Go module(s), 0 pinning or checksum defect(s). 78 of 78 direct requirement(s) were graded against proxy.golang.org (0 not served there, 2 publishing no tagged release to be behind). Whether any of these modules is UNMAINTAINED is not graded — proxy.golang.org publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: that is a source question, not a registry one. Known CVEs in this module graph are D30's question, read from REDACTED and go.sum there.
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.
3 secret(s) detected. 7 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.
REDACTED
What to do
Resolve the 3 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 issue-level).
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
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 244 required Go module(s) use a banned license. Licences were read per module version from the licence files pkg.go.dev detects (via api.deps.dev), over every module this repository's REDACTED requires, direct and indirect, at the version the build uses. Go records no test-only scope at module level, so modules only this repository's own tests import are included. 2 of them carry no licence file that matches a known SPDX licence; that is missing data, not a violation, and none of them is charged.
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.
Top hotspots: internal/kubernautagent/prompt/history.go (7×16=112) Repeated repair below the complexity floor: internal/kubernautagent/investigator/investigator.go (21 of 29 changes were fixes); internal/kubernautagent/investigator/investigator_loop.go (14 of 21 changes were fixes); internal/kubernautagent/investigator/investigator_discovery.go (13 of 18 changes were fixes)
Resolve the 76 Repeated repair finding(s) in Churn × Complexity Hotspots — start with REDACTED (3), types.go (2), investigator.go. — One of this dimension's main actionable groups (76 warning-level).
Resolve the 1 Hotspot finding(s) in Churn × Complexity Hotspots — start with history.go. — One of this dimension's main actionable groups (1 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.
49 deducted task-comment markers across 200263 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.
Resolve the 43 TodoComment finding(s) in Explicit Debt — start with manager.go (5), dlq_near_capacity_warning_test.go (4), deduplication_helpers.go (4). — One of this dimension's main actionable groups (43 warning-level).
Resolve the 6 XxxComment finding(s) in Explicit Debt — start with manager.go (3), routing_integration_test.go (2), doc.go. — One of this dimension's main actionable groups (6 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
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. 1156 document(s) read across 1 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality8.4 / 10Strong✓ 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.
376 of 434 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.
ADR lacks an enforcement field · ×368docs/architecture/decisions/001-crd-api-group-rationale.md:1detected by adr-integrity
ADR declares no status · ×44docs/architecture/decisions/011-remediationprocessor-br-migration.md:1detected by adr-integrity
ADR has no Context section · ×11docs/architecture/decisions/ADR-E2E-001-DEPLOYMENT-PATTERNS.md:1detected by adr-integrity
ADR has no Decision and Consequences section · ×7docs/architecture/decisions/011-remediationprocessor-br-migration.md:1detected by adr-integrity
ADR links a record that does not exist · ×7docs/architecture/decisions/ADR-023-tekton-from-v1.md:8detected by adr-integrity
+ 6 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 368 ADR lacks an enforcement field finding(s) in ADR Quality — start with 001-crd-api-group-rationale.md, 002-e2e-gitops-strategy.md, 003-gitops-priority-order.md. — One of this dimension's main actionable groups (368 recommendation-level).
Resolve the 44 ADR declares no status finding(s) in ADR Quality — start with 011-remediationprocessor-br-migration.md, 013-remediationorchestrator-br-migration.md, ADR-036-authentication-authorization-strategy.md. — One of this dimension's main actionable groups (44 recommendation-level).
Resolve the 11 ADR has no Context section finding(s) in ADR Quality — start with ADR-E2E-001-DEPLOYMENT-PATTERNS.md, DD-010-postgresql-driver-migration.md, DD-AIANALYSIS-2586-independent-confidence.md. — One of this dimension's main actionable groups (11 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
5 naming inconsistencies among 1126 declarations measured against a convention their peers follow.
`WorkflowId` spells `Id` where 1087 names in the project spell it `ID`api/aianalysis/v1alpha1/aianalysis_types.go:302
`DefaultRetryMS` spells `MS` where 43 names in the project spell it `Ms`pkg/apifrontend/streaming/sse.go:19
`watchTerminalEventsSafetyNetNs` spells `Ns` where 42 names in the project spell it `NS`pkg/apifrontend/tools/ka_investigate_bridge.go:460
`requireGET` spells `GET` where 43 names in the project spell it `Get`pkg/fleet/fmc/handler.go:208
`KeyDurationMS` spells `MS` where 43 names in the project spell it `Ms`pkg/log/fields.go:61
✓ On the Gold path — maintain.
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D22 · Internal API Consistency9.5 / 10Stronggated by 5 serious findings✓ Tool-verified
What it measures: Whether the internal API surface is consistent and coherent.
Method: Call-shape rules (A1-A9) over the structured code model of the intentionally exposed C# surface: members of one type, overloads of one name and the same slot across sibling types are compared, and a member that makes a caller use a different convention for the same kind of operation is flagged. Deterministic, no model. Advisory.
5 API inconsistencies among 1038 exposed members measured against a convention their peers follow.
`aianalysis.NewPermanentError` takes (message, reason) where its 5 siblings take (reason, message)pkg/aianalysis/handler.go:182
`severity.NewTriager` takes functional options (`opts ...Option`) where its 3 sibling constructors take a config structpkg/apifrontend/severity/triage.go:95
`tools.BuildProgressSnapshot` returns a map (`map[K]V`) where its 3 siblings return a slice (`[]T`)pkg/apifrontend/tools/execution_progress.go:21
`Server.RegisterAdapter` takes no context.Context; its 3 sibling operations take onepkg/gateway/signal_ingestion.go:68
`executor.ConvertParameters` returns a slice (`[]T`) where its 3 siblings return a map (`map[K]V`)pkg/workflowexecution/executor/tekton.go:341
What to do
Resolve the 1 `aianalysis.NewPermanentError` takes (message, reason) where its 5… finding(s) in Internal API Consistency — start with handler.go. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 `severity.NewTriager` takes functional options (`opts ...Option`) where… finding(s) in Internal API Consistency — start with triage.go. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 `tools.BuildProgressSnapshot` returns a map (`map[K]V`) where its 3… finding(s) in Internal API Consistency — start with execution_progress.go. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d22_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether domain types (IDs, enums, value objects) leak across bounded-context boundaries.
Method: Cross-context domain-type leakage via Roslyn structural classification (strongly-typed IDs / value objects) over every public surface. Exhaustive, deterministic, type-level aggregate-boundary check.
Coverage: Bounded contexts derived from NAMESPACE prefix (or graph-inferred where available); cross-boundary domain-type leakage then checked exhaustively over every public member of every type.
1 of 6 build units (Go) 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.
Do you agree with this assessment?
D27 · Navigability8.6 / 10Strong✓ Tool-verified
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.
39 % of calls cross a namespace and 2 % go through an interface, but 32 % of collaborators are co-located — so following a call takes several hops. 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.
8 finding(s): 0 critical, 8 high, 0 medium, 0 low. 3 detection(s) in paths this repository declares as reviewed specimen content (its credential-scanner allowlist) were excluded. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
REDACTED
What to do
Resolve the 6 High secret finding(s) in Secrets (history) — start with REDACTED (2), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (6 issue-level).
Resolve the 2 REDACTED finding(s) in Secrets (history) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 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).
37 finding(s): 0 critical, 35 high, 2 medium, 0 low. semgrep hit a parse error in 11 file(s) — `docs/development/e2e-testing/troubleshoot-networking-helios08.sh` (lines 317–401), `docs/development/e2e-testing/validate-baremetal-setup-root.sh` (line 609), `docs/development/e2e-testing/validate-complete-e2e-environment.sh` (line 654), `docs/spikes/multi-cluster-mcp-gateway/spike-s3-auth-security/manifests/auth-policy.yaml`, `docs/spikes/multi-cluster-mcp-gateway/spike-s3-auth-security/manifests/backend-policy.yaml`, … (+6 more) — 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 11 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
+ 4 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 11 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED (3), REDACTED (3). — One of this dimension's main actionable groups (11 issue-level).
Resolve the 9 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (9 issue-level).
Resolve the 8 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (7), REDACTED. — One of this dimension's main actionable groups (8 issue-level).
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.
Resolve the 1 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Medium vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 3 High IaC finding(s) in IaC & Container Security — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Resolve the 1 Critical IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 2 Medium IaC finding(s) in IaC & Container Security — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
3 of 722 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is pkg/apifrontend/resilience/k8s_dynamic.go. Counted over 722 of the 893 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
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 Boundary-crossing change coupling finding(s) in Change Coupling — start with reconciler.go. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 3 Change coupling finding(s) in Change Coupling — start with parser.go, investigator_rca.go, request_builder.go. — One of this dimension's main actionable groups (3 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.
Build pipeline generates provenance, signs artifacts and produces an SBOM.
REDACTED
REDACTED
REDACTED
What to do
Resolve the 3 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
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 6 platform declaration(s) and 0 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.
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 singleton services avoid mutable shared instance state that concurrent callers would race on.
Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.
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.
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.
Other · Domain Modelling — Whether aggregates reference each other by identity (id) rather than by direct object reference — the core DDD consistency-boundary rule.
Method: Roslyn (DDD-gated): aggregate roots identified by convention; each aggregate field checked for direct references to other aggregates versus id-only. Deterministic, DDD-native.
Coverage: Population: aggregate roots identified by AggregateRoot/IAggregateRoot base/interface NAME convention; reference-by-identity then checked exhaustively within that set — a root not using those names is invisible.
Do you agree with this assessment?
DM10 · One transaction, one aggregate10.0 / 10Exemplary○ Nothing flagged
Other · Domain Modelling — Whether a single operation mutates more than one aggregate root. An aggregate is a consistency boundary, so saving two together fuses them into one — the second's invariants come to depend on the first's transaction, and the pair can no longer be separated. Reads of other aggregates are not counted.
Method: Neutral body surface (DDD-gated): every method body scanned for repository WRITE calls (Add/Update/Save/Remove/Delete/Insert/Store and their async forms), keyed on the ARGUMENT type rather than the repository type — three `IRepository<T>` writes collapse to one repository but are three distinct aggregates. Reads (Get/Find/Load/Query) are excluded, so loading another aggregate for context never counts. Score is offending methods over methods that write at all. Deterministic.
Other · Domain Modelling — Whether an aggregate can be constructed in a state its own rules forbid — a public constructor that takes a raw primitive, stores it, and validates nothing, with no factory beside it. A constructor taking only value objects is not counted: each parameter has already validated itself.
Method: Neutral surface (DDD-gated): each non-abstract entity/aggregate checked for a PUBLIC constructor taking at least one RAW PRIMITIVE parameter whose body contains no guard token (throw / Guard. / Ensure. / ArgumentException / CheckRule / an XException.ThrowIf* helper). C#: a static factory beside a public constructor does not exempt it, and a public parameterless constructor followed by public raw-primitive setters that refuse nothing is charged when the type also declares a validating way in (a guarded constructor or a guarding static method returning the type); TypeScript: a static Create/Of/From/New factory exempts the type. A constructor taking only value objects is never charged -- measured: 64 of 87 unguarded public constructors on the C# corpus take value objects only, so ignoring parameter types would be 73% false positives. One finding per entity. Deterministic.
Do you agree with this assessment?
DM4 · Rich vs anemic model8.2 / 10Strong✓ Tool-verified
Other · Domain Modelling — Whether aggregates/entities carry the behaviour that protects their invariants, rather than being data bags driven by external services.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.
`RemediationAudit` is an aggregate/entity with 19 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — pkg/datastorage/models/audit.go:30
`AIAnalysisAudit` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — pkg/datastorage/models/audit.go:54
`WorkflowAudit` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — pkg/datastorage/models/audit.go:69
`ExecutionAudit` is an aggregate/entity with 13 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — pkg/datastorage/models/audit.go:84
`NotificationAudit` is an aggregate/entity with 13 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — pkg/datastorage/models/notification_audit.go:38
`RemediationWorkflow` is an aggregate/entity with 41 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — pkg/datastorage/models/workflow.go:60
What to do
Move business rules onto the aggregates/entities they govern so invariants are enforced at the source, not in anemic services.
Other · Domain Modelling — Whether entities protect their state — private/init-only setters, and collections handed out as read-only views rather than the mutable backing collection — instead of exposing writable state that bypasses invariants. Softened when a rehydration framework (Marten/EF) is present.
Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
`Reconciler` exposes publicly writable state (Scheme, Recorder, Metrics, PrometheusClient, AlertManagerClient, AuditManager, and 2 more). — internal/controller/effectivenessmonitor/reconciler.go:62
`Reconciler` exposes publicly writable state (Metrics, Recorder, StatusManager). — internal/controller/remediationorchestrator/reconciler.go:70
`NotificationAudit` exposes publicly writable state (ID, RemediationID, NotificationID, Recipient, Channel, MessageSummary, and 7 more). — pkg/datastorage/models/notification_audit.go:38
`RemediationWorkflow` exposes publicly writable state (WorkflowID, WorkflowName, Version, SchemaVersion, Name, Description, and 35 more). — pkg/datastorage/models/workflow.go:60
What to do
Make entity setters private/init-only and hand collections out as IReadOnlyList/IReadOnlyCollection over a private backing field; change state only through methods that enforce the invariants (Marten/EF can bind via constructor or private setters).
Other · Domain Modelling — Whether repositories are per aggregate root (not per child entity) and keep the persistence query handle behind the contract, so the root's invariants can't be bypassed.
Method: Roslyn (DDD-gated): repository abstraction detection; repositories over non-aggregate-root entities flagged, and (C#/VB) repository INTERFACES whose members return a live persistence query handle (IQueryable/DbSet/IMongoQueryable) — implementations and specification evaluators are out of population by design, since composing a query internally is what an implementation is for. Deterministic, DDD-native.
Coverage: Population: repositories + aggregate roots by NAME convention; per-root repository rule checked within the set.
Other · Domain Modelling — Whether one domain rule is decided — or one measurement produced — in more than one place, rather than living on the type that owns it.
Method: Neutral body surface plus Roslyn (DDD-gated), two arms. DECISION (Roslyn only): a predicate over a domain type's members judged in two or more types, where none of those decisions live on the owning type — operands of comparisons and relational property patterns only, so a member merely passed as an argument is not judged. DERIVATION: a plain all-numeric carrier of ≥2 members, with no base type and exactly one constructor, CONSTRUCTED as the result of a method (returned or assigned, never inline as an argument) in two or more types other than its own — the same measurement produced twice, which centralising the judgement does not fix. DERIVATION runs on every language whose frontend declares the produced-or-passed fact per construction (Roslyn and the Java sidecar today); a target with only the derivation arm carries an engine gap naming the decision arm as not assessed, and a frontend that declares nothing keeps the dimension not measured rather than clean. Single-member rules, test code and generated code are out of population for both. Advisory.
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.
`docs/architecture/APPROVED_MICROSERVICES_ARCHITECTURE.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `effectivenessmonitor`, `fleetmetadatacache`, `remediationorchestrator`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/architecture/APPROVED_MICROSERVICES_ARCHITECTURE.md:173
`docs/architecture/KUBERNAUT_ARCHITECTURE_OVERVIEW.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `apifrontend`, `authwebhook`, `effectivenessmonitor`, `fleetmetadatacache`, `notification`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/architecture/KUBERNAUT_ARCHITECTURE_OVERVIEW.md:41
`docs/architecture/KUBERNAUT_CRD_ARCHITECTURE.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `authwebhook`, `fleetmetadatacache`, `notification`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/architecture/KUBERNAUT_CRD_ARCHITECTURE.md:685
`docs/architecture/SERVICE_DEPENDENCY_MAP.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `apifrontend`, `authwebhook`, `effectivenessmonitor`, `fleetmetadatacache`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/architecture/SERVICE_DEPENDENCY_MAP.md:59
`docs/architecture/decisions/ADR-032-data-access-layer-isolation.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `apifrontend`, `authwebhook`, `fleetmetadatacache`, `kubernautagent`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/architecture/decisions/ADR-032-data-access-layer-isolation.md:309
`docs/architecture/decisions/ADR-EM-001-effectiveness-monitor-service-integration.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `apifrontend`, `authwebhook`, `fleetmetadatacache`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/architecture/decisions/ADR-EM-001-effectiveness-monitor-service-integration.md:86
`docs/architecture/decisions/DD-WORKFLOW-017-workflow-lifecycle-component-interactions.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `apifrontend`, `effectivenessmonitor`, `fleetmetadatacache`, `gateway`, `notification`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/architecture/decisions/DD-WORKFLOW-017-workflow-lifecycle-component-interactions.md:163
`docs/architecture/diagrams/kubernaut-layered-architecture.svg` draws the system's parts, and the drawing no longer matches the code: it leaves out `apifrontend`, `authwebhook`, `fleetmetadatacache`, `signalprocessing`, `workflowexecution`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/architecture/diagrams/kubernaut-layered-architecture.svg:3
`docs/architecture/references/visual-diagrams-master.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `apifrontend`, `authwebhook`, `effectivenessmonitor`, `fleetmetadatacache`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/architecture/references/visual-diagrams-master.md:13
`docs/presentations/svg/04-architecture.svg` draws the system's parts, and the drawing no longer matches the code: it leaves out `authwebhook`, `fleetmetadatacache`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/presentations/svg/04-architecture.svg:33
`docs/services/apifrontend/design/ARCHITECTURE.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `authwebhook`, `effectivenessmonitor`, `fleetmetadatacache`, `gateway`, `workflowexecution`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/services/apifrontend/design/ARCHITECTURE.md:29
`docs/services/crd-controllers/02-aianalysis/integration-points.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `apifrontend`, `authwebhook`, `datastorage`, `effectivenessmonitor`, `fleetmetadatacache`, `gateway`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/services/crd-controllers/02-aianalysis/integration-points.md:36
`docs/services/crd-controllers/02-aianalysis/overview.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `apifrontend`, `authwebhook`, `effectivenessmonitor`, `fleetmetadatacache`, `gateway`, `notification`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/services/crd-controllers/02-aianalysis/overview.md:58
`docs/services/crd-controllers/05-remediationorchestrator/overview.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `apifrontend`, `authwebhook`, `effectivenessmonitor`, `fleetmetadatacache`, `kubernautagent`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/services/crd-controllers/05-remediationorchestrator/overview.md:102
What to do
Update docs/architecture/APPROVED_MICROSERVICES_ARCHITECTURE.md so it draws the parts the code has today: add effectivenessmonitor, fleetmetadatacache, remediationorchestrator.
Update docs/architecture/KUBERNAUT_ARCHITECTURE_OVERVIEW.md so it draws the parts the code has today: add apifrontend, authwebhook, effectivenessmonitor, fleetmetadatacache, notification.
Update docs/architecture/KUBERNAUT_CRD_ARCHITECTURE.md so it draws the parts the code has today: add authwebhook, fleetmetadatacache, notification.
Update docs/architecture/SERVICE_DEPENDENCY_MAP.md so it draws the parts the code has today: add apifrontend, authwebhook, effectivenessmonitor, fleetmetadatacache.
Update docs/architecture/decisions/ADR-032-data-access-layer-isolation.md so it draws the parts the code has today: add apifrontend, authwebhook, fleetmetadatacache, kubernautagent.
Update docs/architecture/decisions/ADR-EM-001-effectiveness-monitor-service-integration.md so it draws the parts the code has today: add apifrontend, authwebhook, fleetmetadatacache.
Update docs/architecture/decisions/DD-WORKFLOW-017-workflow-lifecycle-component-interactions.md so it draws the parts the code has today: add apifrontend, effectivenessmonitor, fleetmetadatacache, gateway, notification.
Update docs/architecture/diagrams/kubernaut-layered-architecture.svg so it draws the parts the code has today: add apifrontend, authwebhook, fleetmetadatacache, signalprocessing, workflowexecution.
Update docs/architecture/references/visual-diagrams-master.md so it draws the parts the code has today: add apifrontend, authwebhook, effectivenessmonitor, fleetmetadatacache.
Update docs/presentations/svg/04-architecture.svg so it draws the parts the code has today: add authwebhook, fleetmetadatacache.
Update docs/services/apifrontend/design/ARCHITECTURE.md so it draws the parts the code has today: add authwebhook, effectivenessmonitor, fleetmetadatacache, gateway, workflowexecution.
Update docs/services/crd-controllers/02-aianalysis/integration-points.md so it draws the parts the code has today: add apifrontend, authwebhook, datastorage, effectivenessmonitor, fleetmetadatacache, gateway.
Update docs/services/crd-controllers/02-aianalysis/overview.md so it draws the parts the code has today: add apifrontend, authwebhook, effectivenessmonitor, fleetmetadatacache, gateway, notification.
Update docs/services/crd-controllers/05-remediationorchestrator/overview.md so it draws the parts the code has today: add apifrontend, authwebhook, effectivenessmonitor, fleetmetadatacache, kubernautagent.
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.
docs/README.md links to `value-proposition/README.md`, but `docs/value-proposition/README.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:66
docs/README.md links to `value-proposition/TECHNICAL_SCENARIOS.md`, but `docs/value-proposition/TECHNICAL_SCENARIOS.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:68
docs/README.md links to `value-proposition/V1_VS_V2_CAPABILITIES.md`, but `docs/value-proposition/V1_VS_V2_CAPABILITIES.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:69
docs/README.md links to `development/getting-started/setup/PGVECTOR_SETUP_GUIDE.md`, but `docs/development/getting-started/setup/PGVECTOR_SETUP_GUIDE.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:85
docs/README.md links to `architecture/AI_CONTEXT_ORCHESTRATION_ARCHITECTURE.md`, but `docs/architecture/AI_CONTEXT_ORCHESTRATION_ARCHITECTURE.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:91
docs/README.md links to `architecture/analysis/OSCILLATION_DETECTION_ALGORITHMS.md`, but `docs/architecture/analysis/OSCILLATION_DETECTION_ALGORITHMS.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:102
docs/README.md links to `TESTING_FRAMEWORK.md`, but `docs/TESTING_FRAMEWORK.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:114
docs/README.md links to `development/E2E_TESTING_PLAN.md`, but `docs/development/E2E_TESTING_PLAN.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:115
docs/README.md links to `development/e2e-testing/QUICK_START.md`, but `docs/development/e2e-testing/QUICK_START.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:127
docs/README.md links to `development/e2e-testing/KCLI_QUICK_START.md`, but `docs/development/e2e-testing/KCLI_QUICK_START.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:128
docs/README.md links to `api/testutil/README.md`, but `docs/api/testutil/README.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:136
docs/README.md links to `status/AI_INTEGRATION_VALIDATION.md`, but `docs/status/AI_INTEGRATION_VALIDATION.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:143
docs/README.md links to `status/TODO.md`, but `docs/status/TODO.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:145
docs/README.md links to `specialized/pattern-engine/PATTERN_ENGINE_IMPROVEMENTS.md`, but `docs/specialized/pattern-engine/PATTERN_ENGINE_IMPROVEMENTS.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:187
docs/README.md links to `specialized/pattern-engine/PATTERN_ENGINE_HIGH_RISK_MITIGATION.md`, but `docs/specialized/pattern-engine/PATTERN_ENGINE_HIGH_RISK_MITIGATION.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:188
docs/README.md links to `specialized/pattern-engine/PATTERN_ENGINE_MEDIUM_RISK_MITIGATION.md`, but `docs/specialized/pattern-engine/PATTERN_ENGINE_MEDIUM_RISK_MITIGATION.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:189
docs/README.md links to `specialized/testing-analysis/COMPREHENSIVE_BRITTLENESS_SOLUTION.md`, but `docs/specialized/testing-analysis/COMPREHENSIVE_BRITTLENESS_SOLUTION.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:191
docs/README.md links to `specialized/testing-analysis/BRITTLENESS_ANALYSIS_AND_SOLUTIONS.md`, but `docs/specialized/testing-analysis/BRITTLENESS_ANALYSIS_AND_SOLUTIONS.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:192
docs/README.md links to `specialized/integration-notes/README_INTELLIGENT_WORKFLOW_BUILDER.md`, but `docs/specialized/integration-notes/README_INTELLIGENT_WORKFLOW_BUILDER.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:194
docs/README.md links to `value-proposition/`, but `docs/value-proposition` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:203
docs/README.md links to `ARCHITECTURE.md`, but `docs/ARCHITECTURE.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:206
docs/README.md links to `status/`, but `docs/status` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:208
docs/README.md links to `planning/`, but `docs/planning` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:209
docs/README.md links to `specialized/`, but `docs/specialized` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/README.md:210
docs/architecture/README.md links to `KUBERNAUT_IMPLEMENTATION_ROADMAP.md`, but `docs/architecture/KUBERNAUT_IMPLEMENTATION_ROADMAP.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/architecture/README.md:42
docs/architecture/README.md links to `AI_CONTEXT_ORCHESTRATION_ARCHITECTURE.md`, but `docs/architecture/AI_CONTEXT_ORCHESTRATION_ARCHITECTURE.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/architecture/README.md:103
docs/architecture/README.md links to `../implementation/`, but `docs/implementation` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/architecture/README.md:237
docs/architecture/README.md links to `../strategic/`, but `docs/strategic` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/architecture/README.md:238
docs/architecture/README.md links to `../concepts/`, but `docs/concepts` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/architecture/README.md:239
docs/development/README.md links to `./CRITICAL_PATH_IMPLEMENTATION_PLAN.md`, but `docs/development/CRITICAL_PATH_IMPLEMENTATION_PLAN.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/development/README.md:10
docs/operations/README.md links to `../DOCUMENTATION_STRUCTURE.md`, but `docs/DOCUMENTATION_STRUCTURE.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/operations/README.md:5
docs/operations/README.md links to `../troubleshooting/`, but `docs/troubleshooting` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/operations/README.md:47
What to do
Reconcile the README with reality: docs/README.md links to `value-proposition/README.md`, but `docs/value-proposition/README.md` does not exist; docs/README.md links to `value-proposition/TECHNICAL_SCENARIOS.md`, but `docs/value-proposition/TECHNICAL_SCENARIOS.md` does not exist; docs/README.md links to `value-proposition/V1_VS_V2_CAPABILITIES.md`, but `docs/value-proposition/V1_VS_V2_CAPABILITIES.md` does not exist; docs/README.md links to `development/getting-started/setup/PGVECTOR_SETUP_GUIDE.md`, but `docs/development/getting-started/setup/PGVECTOR_SETUP_GUIDE.md` does not exist; docs/README.md links to `architecture/AI_CONTEXT_ORCHESTRATION_ARCHITECTURE.md`, but `docs/architecture/AI_CONTEXT_ORCHESTRATION_ARCHITECTURE.md` does not exist.
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.
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.
Do you agree with this assessment?
P5 · DR & Backup7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
Enable purge protection / soft-delete (and prevent_destroy on critical resources) so data stores can't be lost to an accidental or malicious delete.
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.
`http.Get(` 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. (×9) — docs/architecture/spikes/hitl-permission/main.go:611, docs/architecture/spikes/hitl-permission/main.go:657, docs/architecture/spikes/run-state-persistence/main.go:369, …
`http.Post(` 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. (×9) — docs/architecture/spikes/hitl-permission/main.go:627, docs/architecture/spikes/hitl-permission/main.go:645, docs/architecture/spikes/run-state-persistence/main.go:608, …
`http.DefaultClient` 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. — docs/architecture/spikes/shadow-acp/main.go:847
What to do
Give every `http.Client` an explicit `Timeout` (never call `http.Get`/`http.Post` or `http.DefaultClient`, which have none), or build each request with `http.NewRequestWithContext` under a `context.WithTimeout`; add retry with back-off (`hashicorp/go-retryablehttp`) and a breaker (`sony/gobreaker`) around dependencies that fail.
Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.
Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. Exhaustive, deterministic.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
this function literal changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `SSL_CERT_FILE` environment variable (set at line 330, cleared at line 332) and the `SSL_CERT_DIR` environment variable (set at line 335, cleared at line 337) and the `TLS_CA_FILE` environment variable (set at line 340, cleared at line 342) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, so anything that leaves the body in between — an error, an early return, a crash — skips it: the process then keeps the overwritten value for the rest of its life, and every later relative path, child-process launch or configuration read in ANY code resolves against it. That failure is silent and remote from its cause — the function that breaks is not the function that moved the value. The window is not private while it is open either: the working directory and the environment are per-process, so every concurrent thread or Go process in it sees the moved value too. The durable fix is not to widen the restore but to stop mutating the global: give the child its own directory and environment (`exec.Cmd.Dir`, `exec.Cmd.Env`), or build absolute paths with `filepath.Join`. Where the global genuinely must move, put the restore in a `defer` right after the change, so it runs on every return and on a panic. — pkg/shared/tls/tls.go:328
What to do
Each finding names the statement that changes the process-global value and the statement that puts it back. Confirm from the two that nothing between them is protected — then prefer removing the mutation over widening the restore: a working directory or an environment passed to the operation that needs it (the `cwd=` and `env=` arguments of `subprocess.run`/`Popen`) is scoped to that operation, which is what the save-and-restore was trying to approximate. Where the global genuinely must move, `contextlib.chdir`, `contextlib.redirect_stdout` or a `try`/`finally` is the least that makes the restore unconditional. In Go the same holds for `os.Chdir` and `os.Setenv`: give the child `exec.Cmd.Dir`/`Env`, or `defer` the restore.
Other · Code Health — Whether functions that make a cancellable request accept or pass on a context.Context (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 34/53 functions that make a cancellable request (net/http, net.Dial) accept a context.Context or pass one on, so a request keeps running after whatever wanted it has given up — a cancelled request, a shutdown, an expired deadline. Take `ctx context.Context` as the first parameter and build the request with it (`http.NewRequestWithContext`, `DialContext`); where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`waitForHealth` calls `http.Get(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. (×3) — docs/architecture/spikes/shadow-acp/main.go:469, docs/architecture/spikes/run-state-persistence/main.go:679, docs/architecture/spikes/hitl-permission/main.go:609
`createSyncRun` calls `http.Post(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. (×2) — docs/architecture/spikes/shadow-acp/main.go:751, docs/architecture/spikes/run-state-persistence/main.go:601
`createSyncRunWithSession` calls `http.Post(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — docs/architecture/spikes/shadow-acp/main.go:768
`createAsyncRun` calls `http.Post(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — docs/architecture/spikes/shadow-acp/main.go:786
`resumeRun` calls `http.Post(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. (×2) — docs/architecture/spikes/shadow-acp/main.go:803, docs/architecture/spikes/hitl-permission/main.go:637
`streamRun` calls `http.Post(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — docs/architecture/spikes/shadow-acp/main.go:818
`cancelRun` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — docs/architecture/spikes/shadow-acp/main.go:845
`getRun` calls `http.Get(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. (×3) — docs/architecture/spikes/shadow-acp/main.go:858, docs/architecture/spikes/run-state-persistence/main.go:618, docs/architecture/spikes/hitl-permission/main.go:656
`evaluateWithShadow` calls `http.Post(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — docs/architecture/spikes/shadow-acp/main.go:869
`testGetRunAfterRestart` calls `http.Get(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — docs/architecture/spikes/run-state-persistence/main.go:340
`testOptionAvsOptionC` calls `http.Get(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — docs/architecture/spikes/run-state-persistence/main.go:496
`streamRunWithError` calls `http.NewRequestWithContext(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — docs/architecture/spikes/run-state-persistence/main.go:629
`createRun` calls `http.Post(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — docs/architecture/spikes/hitl-permission/main.go:621
What to do
Thread a context.Context through functions that make requests, so the work stops when its caller gives up.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated8.0 / 10Strong✓ Tool-verified
Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen. Whether a `for … range` leaves the slice or map it is walking alone — Go raises nothing, but the walk and the collection part: a range evaluates its slice once, so an element appended in the body is never visited and a removal by reslicing (`s = append(s[:i], s[i+1:]...)`, `slices.Delete`) shifts the next element under the index, which is then skipped while the last is read twice; a reslice, a reassignment or a sort leaves every later `s[i]` naming another element; and a map's order is unspecified, so deleting another key (or clearing the map) changes from run to run which entries the loop still sees.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
`schema` is walked by the `for … range` at line 143, and line 147 appends to `schema`. A range evaluates its slice once and walks the length it had when the loop began, so the elements appended here are never visited by this loop — work queued for it is silently dropped. — pkg/remediationapprovalrequest/parameters.go:143
What to do
Each finding names the two lines that cannot both stand — the `for` over the collection (or its `keys()`/`values()`/`items()` view), and the call inside the body that changes its size. Confirm from those two, then pick one: walk a snapshot (`for k in list(d):`, `for x in s.copy():`); build the result instead of editing in place (`d = {k: v for k, v in d.items() if keep(v)}`); collect what needs removing and remove it after the loop; or — where only the first match was ever meant — `break` straight after the change, which is the one shape that is already safe. In Go: Each finding names the two lines that cannot both stand — the `for … range` over the collection, and the change to it in the body. Confirm from those two, then pick one: build the result instead of editing the walked collection (`var kept []T` … `kept = append(kept, v)`, or `kept := s[:0]` and assign `s = kept` after the loop; `slices.DeleteFunc(s, drop)` in one call); for a worklist that must visit what it adds, loop `for len(queue) > 0` or by index (`for i := 0; i < len(s); i++`); walk a copy (`range slices.Clone(s)`, `range slices.Collect(maps.Keys(m))`) and change the original; delete only the CURRENT key (`delete(m, k)`), which the specification allows; or — where only the first match was ever meant — `break` straight after the change.
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.
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.
`ca, _ := os.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/ca.crt")` writes the call's error to `_` and then uses `ca` as if the call succeeded. When `os.ReadFile` fails, `ca` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `ca` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — pkg/workflowexecution/executor/ansible.go:736
`respBody, _ := io.ReadAll(resp.Body)` writes the call's error to `_` and then uses `respBody` as if the call succeeded. When `io.ReadAll` fails, `respBody` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `respBody` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. (×10) — pkg/workflowexecution/executor/awx_client.go:89, pkg/workflowexecution/executor/awx_client.go:119, pkg/workflowexecution/executor/awx_client.go:147, …
`payload, _ := buildExecutionStartedPayloadChecked(wfe, pipelineRunName, resourceNamespaces...)` writes the call's error to `_` and then uses `payload` as if the call succeeded. When `buildExecutionStartedPayloadChecked` fails, `payload` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `payload` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — pkg/workflowexecution/audit/manager.go:388
`payload, _ := buildWorkflowExecutionAuditPayloadChecked(wfe)` writes the call's error to `_` and then uses `payload` as if the call succeeded. When `buildWorkflowExecutionAuditPayloadChecked` fails, `payload` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `payload` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — pkg/workflowexecution/audit/manager.go:543
`bodyBytes, _ := io.ReadAll(resp.Body)` writes the call's error to `_` and then uses `bodyBytes` as if the call succeeded. When `io.ReadAll` fails, `bodyBytes` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `bodyBytes` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — pkg/shared/llm/openaicompat/client.go:138
`if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×9) — pkg/shared/llm/openaicompat/reasoning.go:205, pkg/shared/llm/openaicompat/reasoning.go:211, pkg/kubernautagent/tools/sanitization/secret.go:77, …
`ji, _ := json.Marshal(normalized[i])` writes the call's error to `_` and then uses `ji` as if the call succeeded. When `json.Marshal` fails, `ji` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `ji` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — pkg/shared/hash/canonical.go:88
`jj, _ := json.Marshal(normalized[j])` writes the call's error to `_` and then uses `jj` as if the call succeeded. When `json.Marshal` fails, `jj` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `jj` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — pkg/shared/hash/canonical.go:89
`body, _ := io.ReadAll(resp.Body)` writes the call's error to `_` and then uses `body` as if the call succeeded. When `io.ReadAll` fails, `body` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `body` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. (×2) — pkg/notification/delivery/pagerduty.go:89, pkg/notification/delivery/teams.go:81
`if closeErr := encoder.Close(); closeErr != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — pkg/kubernautagent/tools/sanitization/secret.go:95
`if err := encoder.Close(); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — pkg/kubernautagent/tools/sanitization/secret.go:101
`if err := json.Unmarshal(raw, &obj); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — pkg/kubernautagent/tools/sanitization/secret.go:186
`if err := json.Unmarshal(kindRaw, &kind); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×2) — pkg/kubernautagent/tools/sanitization/secret.go:207, pkg/kubernautagent/tools/sanitization/secret.go:219
`if err := json.Unmarshal(fieldRaw, &m); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — pkg/kubernautagent/tools/sanitization/secret.go:233
`if err := json.Unmarshal(itemsRaw, &items); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — pkg/kubernautagent/tools/sanitization/secret.go:266
`if err := json.Unmarshal(item, &itemObj); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — pkg/kubernautagent/tools/sanitization/secret.go:272
`if err := json.Unmarshal([]byte(body), &resp); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — pkg/kubernautagent/tools/prometheus/tools.go:250
`if err := json.Unmarshal(dataRaw, &items); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — pkg/kubernautagent/tools/prometheus/tools.go:258
`if fetchErr != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — pkg/kubernautagent/tools/logs/fetch_pod_logs.go:105
`if parseErr != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — pkg/kubernautagent/tools/k8s/resolver.go:179
`if kindErr != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — pkg/kubernautagent/tools/k8s/resolver.go:241
What to do
Discarded error (assigned to `_`, then its result used)
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 `package.json` 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 19 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — docs/architecture/spikes/goose-mcp-roundtrip/mcp_server.py:19
`info` at line 34 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — docs/architecture/spikes/goose-mcp-roundtrip/mcp_server.py:34
`info` at line 49 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — docs/architecture/spikes/goose-mcp-roundtrip/mcp_server.py:49
`Info` at line 701 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — pkg/workflowexecution/executor/ansible.go:701
`Info` at line 287 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — pkg/signalprocessing/enricher/k8s_enricher.go:287
`Error` at line 292 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Error("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Error("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Error("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — pkg/signalprocessing/enricher/k8s_enricher.go:292
`Info` at line 130 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — pkg/remediationorchestrator/creator/notification.go:130
`Info` at line 158 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. (×2) — pkg/remediationorchestrator/creator/notification.go:158, internal/kubernautagent/investigator/investigator_phases.go:158
`Error` at line 161 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Error("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Error("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Error("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — pkg/remediationorchestrator/creator/notification.go:161
`Info` at line 72 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — pkg/remediationorchestrator/aggregator/status.go:72
`Error` at line 74 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Error("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Error("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Error("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — pkg/remediationorchestrator/aggregator/status.go:74
`Info` at line 700 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — pkg/gateway/server.go:700
`Info` at line 114 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — internal/kubernautagent/tools/custom/resource_context.go:114
`Info` at line 152 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — internal/kubernautagent/tools/custom/resource_context.go:152
`Info` at line 449 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — internal/kubernautagent/mcp/tools/investigate_discovery.go:449
`Info` at line 122 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — internal/kubernautagent/investigator/investigator_anomaly_scope.go:122
`Info` at line 203 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — internal/kubernautagent/investigator/investigator_gates.go:203
`Info` at line 217 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — internal/kubernautagent/investigator/investigator_gates.go:217
`Info` at line 223 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — internal/kubernautagent/investigator/investigator_gates.go:223
`Error` at line 561 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Error("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Error("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Error("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — internal/controller/workflowexecution/workflowexecution_status_marking.go:561
`Info` at line 397 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — cmd/fleetmetadatacache/main.go:397
`Error` at line 429 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Error("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Error("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Error("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — cmd/fleetmetadatacache/main.go:429
`Info` at line 123 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — cmd/apifrontend/mcp_a2a_handlers.go:123
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 — 4 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.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 11 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 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.
Not included — 60 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.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — Not applicable: this repository's Go 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.
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
AX8 Test isolation — no test/production split to check
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — the image ran but published no HTTP port — nothing to crawl (EXPOSE the web port to unlock runtime evidence) 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.
D10 Test Quality — ~574332 lines of test source are present (.go) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D16 Bus Factor — single-maintainer 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.
D24 Comment Value — 9 of 17 comment blocks were not judged (9 in a language other than English): redundancy is judged by word overlap with the code's identifiers, which cannot be measured across languages.
D25 ADR Conformance — 1 binding ADR(s) state their decision in a language our ADR prohibition grammar does not read (undetermined); they were not checked.
D32 Data Compliance (PII/GDPR) — 3 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
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.
DM12 Ambient inputs in the domain — no domain-layer types detected — ambient-input check not applicable
DM2 Strongly-typed ids — no id-bearing domain types detected — strongly-typed-id adoption not assessable
DM3 Integration-event coupling — no integration events detected — coupling check not applicable
DM6 Domain ↔ infrastructure boundary — no domain-layer types detected — domain↔infrastructure boundary check not applicable
DM8 Value-object opportunities — not scored — the deterministic rule found 0 candidate clump(s); its rows are withheld until it has a measured precision of 95 % (a sample of fewer than 10 rows cannot show one)
ED1 Event-Driven — not scored — this repository shows only 1 of the 3 signals this lens looks for (31 event-sourced shape(s) (event folds / event-recording aggregates))
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Fold determinism — no Apply/When folds detected — fold-determinism check not applicable
ES2 Immutable events — no persisted event types detected — immutability check not applicable
ES3 PII in the event store — no persisted event types detected — PII-in-events check not applicable
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model 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
P12 CI test-gate honesty — 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.
P9 Domain vs controller coverage — coverage data present for 838 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.
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.
PF3 Async & latency hygiene — Not applicable: Go has no async/await function colour, so there is no asynchronous code for a blocking call to stall.
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.
X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X12 Unreachable branch — X12 reached only 1% of this repository's production lines — go (199,184 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
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
X14 Bypassable address classification — 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
X16 Unfloored truncation loop — not analysed — these correctness checks read a source model 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
X17 Uncapped recursion over a caller-supplied document — not analysed — these correctness checks read a source model 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
X18 Disposal-pattern correctness — not analysed — these correctness checks read a source model 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
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.
X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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 analysed — these correctness checks read a source model 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
X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X29 Per-element action decided by a fixed element — not analysed — these correctness checks read a source model 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
X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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.
X5 Nullable reference types — not analysed — these correctness checks read a source model 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
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.
Boundary-crossing change coupling: reconciler.go ↔ effectivenessassessment.go internal/controller/effectivenessmonitor/reconciler.go:1— `internal/controller/effectivenessmonitor/reconciler.go` (context internal) and `pkg/remediationorchestrator/creator/effectivenessassessment.go` (context pkg) sit in DIFFERENT parts of the tree yet change together 53% of the time (8 of the 15 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `975a8baf` refactor(#277): rename HashCheckDelay→HashComputeDelay in Go producti…; `2f6f2aa9` feat(#277): implement AlertCheckDelay, HashCheckDelay, and proactive …; `9cef4fa1` feat(#251): implement async target detection and hash deferral — run `git show` on any of them.
Repeated repair: internal/kubernautagent/investigator/investigator.go internal/kubernautagent/investigator/investigator.go:622— internal/kubernautagent/investigator/investigator.go changed 29 times in last 90 days and 21 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is investigator.preserveRCAContinuationEvidence at line 622), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(kubernaut-agent): preserve target on workflow cancellation”; “fix(kubernautagent): separate interactive terminal decision IDs”; “fix(kubernautagent): preserve RCA retry protocol state (#2586)”; “fix: preserve RCA confidence through approval and audit”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- internal/kubernautagent/investigator/investigator.go`: 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.
Repeated repair: internal/kubernautagent/investigator/investigator_loop.go internal/kubernautagent/investigator/investigator_loop.go:668— internal/kubernautagent/investigator/investigator_loop.go changed 21 times in last 90 days and 14 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is investigator.auditToolResultProjection at line 668), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(kubernautagent): preserve RCA retry protocol state (#2586)”; “fix(ka): close remaining bounded output review findings”; “fix(ka): remove legacy audit list fallback”; “fix(ka): persist bounded legacy jq audit summaries”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- internal/kubernautagent/investigator/investigator_loop.go`: 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.
Repeated repair: internal/kubernautagent/investigator/investigator_discovery.go internal/kubernautagent/investigator/investigator_discovery.go:41— internal/kubernautagent/investigator/investigator_discovery.go changed 18 times in last 90 days and 13 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is Investigator.RunWorkflowDiscoveryFromRCA at line 41), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(kubernaut-agent): validate signal-derived workflow targets”; “fix(kubernautagent): separate interactive terminal decision IDs”; “fix(investigator): persist interactive RCA completion audit”; “fix(kubernaut-agent): revalidate enriched workflow target”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- internal/kubernautagent/investigator/investigator_discovery.go`: 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.
Repeated repair: pkg/apifrontend/tools/ka_investigate_mcp.go pkg/apifrontend/tools/ka_investigate_mcp.go:474— pkg/apifrontend/tools/ka_investigate_mcp.go changed 18 times in last 90 days and 13 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is tools.resolveInvestigationRR at line 474), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: preserve RCA confidence through approval and audit”; “fix(apifrontend): replace provisional RCA fallbacks with status”; “fix(apifrontend): reject active investigations before readiness waits”; “fix(fleet): enforce cluster attribution for triage”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- pkg/apifrontend/tools/ka_investigate_mcp.go`: 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.
Repeated repair: internal/controller/workflowexecution/workflowexecution_pending.go internal/controller/workflowexecution/workflowexecution_pending.go:304— internal/controller/workflowexecution/workflowexecution_pending.go changed 16 times in last 90 days and 13 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is WorkflowExecutionReconciler.recordPendingSelectionAudit at line 304), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: bound workflow identity retries”; “fix: use shared default for catalog requeues”; “fix: jitter workflow identity requeues”; “fix: requeue transient workflow catalog lookups”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- internal/controller/workflowexecution/workflowexecution_pending.go`: 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.
Repeated repair: internal/kubernautagent/investigator/investigator_phases.go internal/kubernautagent/investigator/investigator_phases.go:66— internal/kubernautagent/investigator/investigator_phases.go changed 15 times in last 90 days and 11 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is investigator.MergePhase1Fallbacks at line 66), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: preserve structured fleet list output”; “fix(investigator): preserve existing RCA confidence”; “fix: preserve RCA confidence through approval and audit”; “fix(kubernaut-agent): validate target GVK before workflow selection”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- internal/kubernautagent/investigator/investigator_phases.go`: 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.
Repeated repair: pkg/apifrontend/agent/phase_guard.go pkg/apifrontend/agent/phase_guard.go:400— pkg/apifrontend/agent/phase_guard.go changed 15 times in last 90 days and 11 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is agent.recordInvestigateGroundingState at line 400), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: preserve RCA confidence through approval and audit”; “fix(apifrontend): replace provisional RCA fallbacks with status”; “fix(apifrontend): preserve trusted severity across turns”; “fix(apifrontend): require explicit severity evidence”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- pkg/apifrontend/agent/phase_guard.go`: 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.
Repeated repair: internal/kubernautagent/agentsession/mapping.go internal/kubernautagent/agentsession/mapping.go:128— internal/kubernautagent/agentsession/mapping.go changed 17 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is agentsession.MapInvestigationResultToAgentSessionResult at line 128), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: preserve RCA confidence through approval and audit”; “fix: validate frozen approval parameters”; “fix: preserve typed investigation outcome precedence”; “fix: close history-aware safety and provenance gaps”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- internal/kubernautagent/agentsession/mapping.go`: 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.
Repeated repair: internal/kubernautagent/investigator/investigator_workflow_selection.go internal/kubernautagent/investigator/investigator_workflow_selection.go:38— internal/kubernautagent/investigator/investigator_workflow_selection.go changed 16 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is Investigator.runWorkflowSelection at line 38), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: close approval validation audit gaps”; “fix(ka): preserve discovery failure on retry budget overflow”; “fix(ka): preserve bounded audit and RCA contracts”; “fix(ka): classify post-discovery budget exhaustion”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- internal/kubernautagent/investigator/investigator_workflow_selection.go`: 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.
Repeated repair: pkg/workflowexecution/executor/job.go pkg/workflowexecution/executor/job.go:524— pkg/workflowexecution/executor/job.go changed 13 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is JobExecutor.Create at line 524), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(workflowexecution): honor authoritative target resource”; “fix(workflowexecution): harden RR Job identity migration”; “fix(workflowexecution): preserve recorded Job identity during reentry”; “fix(workflowexecution): derive Job names from RR names”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- pkg/workflowexecution/executor/job.go`: 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.
Repeated repair: cmd/kubernautagent/toolregistry.go cmd/kubernautagent/toolregistry.go:469— cmd/kubernautagent/toolregistry.go changed 17 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is main.newFleetRetryObserver at line 469), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(fleet): resolve tool prefixes by gateway type”; “fix(ka): classify post-discovery budget exhaustion”; “fix(k8s): bound bulk tool results at source”; “fix(kubernautagent): fence recovered attempt callbacks”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- cmd/kubernautagent/toolregistry.go`: 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.
Repeated repair: internal/kubernautagent/investigator/investigator_audit.go internal/kubernautagent/investigator/investigator_audit.go:270— internal/kubernautagent/investigator/investigator_audit.go changed 13 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is investigator.populateDecisionEvent at line 270), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(kubernautagent): separate interactive terminal decision IDs”; “fix: preserve RCA confidence through approval and audit”; “fix(kubernaut-agent): validate target GVK before workflow selection”; “fix(ka): scope phase 3 handoff and context budget”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- internal/kubernautagent/investigator/investigator_audit.go`: 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.
Repeated repair: pkg/apifrontend/tools/crd_tools.go pkg/apifrontend/tools/crd_tools.go:57— pkg/apifrontend/tools/crd_tools.go changed 13 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is tools.HandleListRemediations at line 57), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(apifrontend): expose independent approval confidence fields”; “fix: satisfy deprecation comment lint”; “fix: preserve RCA confidence through approval and audit”; “fix: close approval audit and target gaps”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- pkg/apifrontend/tools/crd_tools.go`: 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.
Repeated repair: pkg/kubernautagent/types/types.go pkg/kubernautagent/types/types.go:475— pkg/kubernautagent/types/types.go changed 15 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is SignalContext.ComponentGVK at line 475), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: preserve RCA confidence through approval and audit”; “fix(kubernaut-agent): validate target GVK before workflow selection”; “fix: preserve validated target API versions”; “fix(ka): scope phase 3 handoff and context budget”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- pkg/kubernautagent/types/types.go`: 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.
Repeated repair: cmd/apifrontend/backend_deps.go cmd/apifrontend/backend_deps.go:215— cmd/apifrontend/backend_deps.go changed 12 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is main.buildPolicyReadDeps at line 215), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: register workflow scheme in apifrontend”; “fix(apifrontend): read console policy metadata from runtime config”; “fix(apifrontend): require explicit severity evidence”; “fix(apifrontend): fail closed when scope checker is unavailable”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- cmd/apifrontend/backend_deps.go`: 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.
Repeated repair: internal/kubernautagent/investigator/investigator_gates.go internal/kubernautagent/investigator/investigator_gates.go:567— internal/kubernautagent/investigator/investigator_gates.go changed 12 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is investigator.resourceListItemsWellFormed at line 567), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: preserve structured fleet list output”; “fix: preserve RCA confidence through approval and audit”; “fix(kubernaut-agent): validate target GVK before workflow selection”; “fix: validate non-empty mapper API versions”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- internal/kubernautagent/investigator/investigator_gates.go`: 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.
Repeated repair: internal/controller/workflowexecution/workflowexecution_controller.go internal/controller/workflowexecution/workflowexecution_controller.go:286— internal/controller/workflowexecution/workflowexecution_controller.go changed 11 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is WorkflowExecutionReconciler.Reconcile at line 286), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(workflowexecution): preserve dispatched workflow snapshots”; “fix(workflowexecution): harden RR Job identity migration”; “fix(workflowexecution): derive Job names from RR names”; “fix(workflowexecution): reuse Ansible engine constant”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- internal/controller/workflowexecution/workflowexecution_controller.go`: 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.
Repeated repair: internal/kubernautagent/mcp/tools/select_workflow.go internal/kubernautagent/mcp/tools/select_workflow.go:400— internal/kubernautagent/mcp/tools/select_workflow.go changed 11 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is SelectWorkflowTool.Handle at line 400), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(kubernaut-agent): validate target GVK before workflow selection”; “fix: close history-aware safety and provenance gaps”; “fix(interactive): preserve selected workflow parameters”; “fix(kubernautagent): reject empty fleet overlays”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- internal/kubernautagent/mcp/tools/select_workflow.go`: 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.
Repeated repair: internal/kubernautagent/agentsession/dispatcher.go internal/kubernautagent/agentsession/dispatcher.go:971— internal/kubernautagent/agentsession/dispatcher.go changed 12 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is Dispatcher.dispatchLeaseNeedsReclaim at line 971), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(kubernautagent): retry transient lease reads”; “fix(kubernautagent): fence recovered attempt callbacks”; “fix(kubernautagent): harden epoch lease recovery”; “fix(kubernautagent): recover AgentSessions after restart”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- internal/kubernautagent/agentsession/dispatcher.go`: 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.
Repeated repair: pkg/authwebhook/remediationapprovalrequest_handler.go pkg/authwebhook/remediationapprovalrequest_handler.go:212— pkg/authwebhook/remediationapprovalrequest_handler.go changed 9 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is RemediationApprovalRequestAuthHandler.handleHumanDecision at line 212), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: audit denied approval overrides”; “fix: validate frozen approval parameters”; “fix: close RAR approval safety races”; “fix: address approval safety review findings”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- pkg/authwebhook/remediationapprovalrequest_handler.go`: 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.
Repeated repair: internal/kubernautagent/investigator/evidence_handoff.go internal/kubernautagent/investigator/evidence_handoff.go:206— internal/kubernautagent/investigator/evidence_handoff.go changed 9 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is Investigator.freezeEvidenceHandoff at line 206), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ka): close remaining bounded output review findings”; “fix(ka): classify post-discovery budget exhaustion”; “fix(ka): close review findings for bounded contexts”; “fix(ka): scope phase 3 handoff and context budget”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- internal/kubernautagent/investigator/evidence_handoff.go`: 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.
Repeated repair: pkg/apifrontend/handler/mcp_bridge.go pkg/apifrontend/handler/mcp_bridge.go:348— pkg/apifrontend/handler/mcp_bridge.go changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is handler.registerInteractiveTools at line 348), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: close approval validation audit gaps”; “fix(apifrontend): emit schema-valid MCP denial audits”; “fix(interactive): preserve fleet context across session flows”; “fix(apifrontend): fail closed when scope checker is unavailable”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- pkg/apifrontend/handler/mcp_bridge.go`: 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.
Repeated repair: internal/kubernautagent/investigator/investigator_tools.go internal/kubernautagent/investigator/investigator_tools.go:225— internal/kubernautagent/investigator/investigator_tools.go changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is Investigator.toolDefinitionsForPhase at line 225), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(kubernaut-agent): validate target GVK before workflow selection”; “fix(ka): scope phase 3 handoff and context budget”; “fix: close history-aware safety and provenance gaps”; “fix(ci): repair scoped history-selection gate findings”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- internal/kubernautagent/investigator/investigator_tools.go`: 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.
Repeated repair: internal/kubernautagent/mcp/tools/investigate_discovery.go internal/kubernautagent/mcp/tools/investigate_discovery.go:272— internal/kubernautagent/mcp/tools/investigate_discovery.go changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is InvestigateTool.resolveRCAForDiscovery at line 272), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(kubernaut-agent): validate target GVK before workflow selection”; “fix(kubernautagent): preserve signal context during RCA extraction”; “fix(kubernautagent): prefer interactive RCA after user turn”; “fix(kubernautagent): repair management-aware workflow discovery”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- internal/kubernautagent/mcp/tools/investigate_discovery.go`: 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.
Repeated repair: cmd/kubernautagent/routes.go cmd/kubernautagent/routes.go:59— cmd/kubernautagent/routes.go changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is main.newAuthMiddleware at line 59), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: wait for late AgentSession dispatch before escalation”; “fix(kubernautagent): preserve signal context through sessions”; “fix(interactive): preserve fleet context across session flows”; “fix(kubernautagent): prescope fleet overlay during discovery”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- cmd/kubernautagent/routes.go`: 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.
TodoComment test/integration/signalprocessing/audit_integration_test.go:151— // TODO: Add sort_order parameter to DataStorage API for more efficient queries — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/integration/gateway/29_k8s_api_failure_integration_test.go:281— // Phase 2 (TODO - TDD GREEN): — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/integration/gateway/29_k8s_api_failure_integration_test.go:287— // Phase 3 (TODO - TDD REFACTOR): — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/integration/gateway/34_status_deduplication_integration_test.go:59— // TODO: This test requires investigation of Gateway's deduplication behavior in integration tier — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/integration/datastorage/dlq_near_capacity_warning_test.go:121— // TODO: When metrics implemented, verify: — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/integration/datastorage/dlq_near_capacity_warning_test.go:166— // TODO: When logging/metrics implemented, verify: — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/integration/datastorage/dlq_near_capacity_warning_test.go:214— // TODO: When logging/metrics implemented, verify: — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/integration/datastorage/dlq_near_capacity_warning_test.go:261— // TODO: When logging/metrics implemented, verify: — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/integration/datastorage/full_reconstruction_integration_test.go:457— // TODO: Implement parser for orchestrator.lifecycle.failed events to extract error_details — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/integration/authwebhook/suite_test.go:355— //nolint:staticcheck // TODO: migrate to admission.WithValidator — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/integration/aianalysis/audit_flow_integration_test.go:713— // TODO: Once InvestigationData field is added to status, populate it here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/infrastructure/workflowexecution_e2e_hybrid.go:635— // TODO: Re-enable after switching to upstream Go builder (Solution B) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/e2e/remediationorchestrator/notification_cascade_e2e_test.go:46— // See test/e2e/remediationorchestrator/suite_test.go lines 142-147 for TODO. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/e2e/remediationorchestrator/routing_cooldown_e2e_test.go:33— // See test/e2e/remediationorchestrator/suite_test.go lines 142-147 for TODO. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/e2e/notification/notification_e2e_suite_test.go:124— // TODO: Fix podman `kind get clusters` hang for automated cleanup — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/e2e/kubernautagent/incident_analysis_test.go:373— // EnrichmentResults: TODO - complex raw-JSON construction — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/e2e/gateway/24_audit_signal_data_test.go:121— // TODO (GW Team): Use for K8s operations — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/e2e/gateway/36_deduplication_state_test.go:406— // v1.1 TODO: After DD-015, verify TWO CRDs exist with different timestamps
TodoComment test/e2e/gateway/deduplication_helpers.go:153— // TODO (GW Team): Properly refactor tests to use E2E patterns — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/e2e/gateway/deduplication_helpers.go:156— // TODO (GW Team): These are temporary stubs to make tests compile. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/e2e/gateway/deduplication_helpers.go:176— // TODO (GW Team): Replace calls with direct HTTP requests to gatewayURL — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/e2e/gateway/deduplication_helpers.go:260— // TODO (GW Team): Additional stubs for compilation — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/e2e/datastorage/15_http_api_test.go:93— // TODO(E2E): Expect(dbRecord.Recipient).To(Equal(validAudit.Recipient)) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/signalprocessing/interfaces.go:27— // TODO: Migrate existing interfaces here (Phase 2 refactoring) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/signalprocessing/interfaces.go:45— // TODO: Move existing implementations to implement this interface (Phase 2 refactoring) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
Duplicated block (7 lines × 2) cmd/datastorage/main.go:675— cmd/datastorage/main.go:675-681 | cmd/remediationorchestrator/main.go:817-823 — 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 (7 lines × 2) cmd/kubernautagent/llm_builder.go:81— cmd/kubernautagent/llm_builder.go:81-87 | cmd/kubernautagent/llm_builder.go:185-191 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `cmd/kubernautagent/llm_builder.go:198` calls `WithBaseURL` and `cmd/kubernautagent/llm_builder.go:89` 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 (7 lines × 2) cmd/kubernautagent/llm_builder.go:107— cmd/kubernautagent/llm_builder.go:107-113 | cmd/kubernautagent/llm_builder.go:135-141 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `cmd/kubernautagent/llm_builder.go:151` calls `WithHTTPOptions` and `cmd/kubernautagent/llm_builder.go:115` 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 (7 lines × 2) internal/controller/apifrontend/lease_sync.go:71— internal/controller/apifrontend/lease_sync.go:71-77 | internal/controller/apifrontend/ttl.go:80-86 — 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. 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 (7 lines × 2) internal/controller/signalprocessing/signalprocessing_categorizing.go:150— internal/controller/signalprocessing/signalprocessing_categorizing.go:150-156 | internal/controller/signalprocessing/signalprocessing_categorizing.go:166-172 — 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 `internal/controller/signalprocessing/signalprocessing_categorizing.go:150` 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 (7 lines × 2) internal/kubernautagent/agentsession/dispatcher.go:1025— internal/kubernautagent/agentsession/dispatcher.go:1025-1031 | internal/kubernautagent/agentsession/dispatcher.go:1150-1156 — 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 `internal/kubernautagent/agentsession/dispatcher.go:1025` 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, `internal/kubernautagent/agentsession/dispatcher.go:1023` calls `V`, `Info` and `internal/kubernautagent/agentsession/dispatcher.go:1149` does not — after which the two agree again for 3 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 (7 lines × 2) internal/kubernautagent/mcp/tools/investigate_autonomous.go:45— internal/kubernautagent/mcp/tools/investigate_autonomous.go:45-51 | internal/kubernautagent/mcp/tools/investigate_takeover.go:208-214 — 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) internal/kubernautagent/tools/custom/discovery_audit.go:121— internal/kubernautagent/tools/custom/discovery_audit.go:121-127 | internal/kubernautagent/tools/custom/discovery_audit.go:152-158 — 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 `internal/kubernautagent/tools/custom/discovery_audit.go:121` 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 (7 lines × 2) internal/kubernautagent/tools/custom/discovery_audit.go:219— internal/kubernautagent/tools/custom/discovery_audit.go:219-225 | internal/kubernautagent/tools/custom/discovery_audit.go:231-237 — 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.
Duplicated block (7 lines × 2) pkg/aianalysis/audit/audit.go:274— pkg/aianalysis/audit/audit.go:274-281 | pkg/aianalysis/audit/audit.go:638-644 — 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.
Duplicated block (7 lines × 2) pkg/authwebhook/startup_reconciler.go:219— pkg/authwebhook/startup_reconciler.go:219-225 | pkg/authwebhook/startup_reconciler.go:247-253 — 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 `pkg/authwebhook/startup_reconciler.go:219` 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 (7 lines × 2) pkg/datastorage/repository/audit_events_batch.go:201— pkg/datastorage/repository/audit_events_batch.go:201-207 | pkg/datastorage/repository/audit_events_create.go:56-65 — 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) pkg/remediationorchestrator/creator/aianalysis.go:150— pkg/remediationorchestrator/creator/aianalysis.go:150-156 | pkg/remediationorchestrator/creator/signalprocessing.go:143-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/remediationorchestrator/creator/aianalysis.go:150` 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 (7 lines × 2) pkg/remediationorchestrator/routing/blocking.go:984— pkg/remediationorchestrator/routing/blocking.go:984-990 | pkg/remediationorchestrator/routing/blocking.go:1084-1090 — 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 `pkg/remediationorchestrator/routing/blocking.go:984` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/remediationorchestrator/routing/blocking.go:1081` calls `Duration` and `pkg/remediationorchestrator/routing/blocking.go:980` 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 (7 lines × 2) pkg/signalprocessing/audit/client.go:556— pkg/signalprocessing/audit/client.go:556-562 | pkg/workflowexecution/audit/manager.go:794-800 — 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 `pkg/signalprocessing/audit/client.go:556` 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 (7 lines × 2) cmd/gateway/main.go:176— cmd/gateway/main.go:176-182 | cmd/kubernautagent/main.go:275-281 — 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (7 lines × 2) docs/architecture/spikes/acp-enforcement/enforcement.go:199— docs/architecture/spikes/acp-enforcement/enforcement.go:199-205 | internal/kubernautagent/investigator/anomaly.go:178-184 — 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Check import visibility before settling on that home: `internal/kubernautagent/investigator/anomaly.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
Duplicated block (7 lines × 2) internal/kubernautagent/enrichment/k8s_adapter.go:246— internal/kubernautagent/enrichment/k8s_adapter.go:246-252 | pkg/kubernautagent/tools/k8s/resolver.go:195-201 — 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. Check import visibility before settling on that home: `internal/kubernautagent/enrichment/k8s_adapter.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
Duplicated block (7 lines × 2) pkg/apifrontend/auth/trusted_source.go:77— pkg/apifrontend/auth/trusted_source.go:77-83 | pkg/gateway/middleware/trusted_realip.go:83-89 — 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 (7 lines × 2) pkg/apifrontend/resilience/retry.go:169— pkg/apifrontend/resilience/retry.go:169-175 | pkg/shared/transport/retry.go:202-208 — 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 (7 lines × 2) pkg/gateway/processing/distributed_lock.go:186— pkg/gateway/processing/distributed_lock.go:186-192 | pkg/remediationorchestrator/locking/distributed_lock.go:109-115 — before extracting anything, compare `pkg/gateway/processing/distributed_lock.go` and `pkg/remediationorchestrator/locking/distributed_lock.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) pkg/kubernautagent/llm/anthropicfamily/client.go:212— pkg/kubernautagent/llm/anthropicfamily/client.go:212-218 | pkg/kubernautagent/llm/geminifamily/client.go:120-126 — 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 (7 lines × 2) pkg/remediationapprovalrequest/conditions.go:127— pkg/remediationapprovalrequest/conditions.go:127-133 | pkg/remediationrequest/conditions.go:175-181 — `pkg/remediationapprovalrequest/conditions.go` and `pkg/remediationrequest/conditions.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 30 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 2) pkg/kubernautagent/llm/anthropicfamily/client.go:312— pkg/kubernautagent/llm/anthropicfamily/client.go:312-318 | pkg/kubernautagent/llm/openai/client.go:141-147 — 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 (7 lines × 2) internal/controller/remediationorchestrator/timeout_handling.go:117— internal/controller/remediationorchestrator/timeout_handling.go:117-123 | internal/controller/remediationorchestrator/timeout_management.go:358-364 — 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 `internal/controller/remediationorchestrator/timeout_handling.go:117` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `internal/controller/remediationorchestrator/timeout_handling.go:112` calls `WithLabelValues`, `Inc` and `internal/controller/remediationorchestrator/timeout_management.go:353` 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 (6 lines × 2) cmd/effectivenessmonitor/main.go:717— cmd/effectivenessmonitor/main.go:717-722 | cmd/workflowexecution/main.go:601-606 — 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. 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 (6 lines × 2) docs/architecture/spikes/run-state-persistence/main.go:602— docs/architecture/spikes/run-state-persistence/main.go:602-607 | docs/architecture/spikes/shadow-acp/main.go:752-757 — 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 (6 lines × 2) docs/architecture/spikes/run-state-persistence/main.go:630— docs/architecture/spikes/run-state-persistence/main.go:630-635 | docs/architecture/spikes/shadow-acp/main.go:819-824 — 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 (6 lines × 2) internal/kubernautagent/investigator/investigator_rca.go:296— internal/kubernautagent/investigator/investigator_rca.go:296-301 | internal/kubernautagent/investigator/investigator_workflow_selection.go:692-697 — 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 (6 lines × 2) internal/kubernautagent/mcp/adapters/adapters.go:54— internal/kubernautagent/mcp/adapters/adapters.go:54-59 | internal/kubernautagent/mcp/adapters/adapters.go:131-136 — 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 `internal/kubernautagent/mcp/adapters/adapters.go:54` 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 (6 lines × 2) pkg/gateway/middleware/event_freshness.go:61— pkg/gateway/middleware/event_freshness.go:61-66 | pkg/gateway/middleware/timestamp.go:71-77 — 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 `pkg/gateway/middleware/event_freshness.go:61` 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 (6 lines × 2) pkg/signalprocessing/evaluator/evaluator.go:247— pkg/signalprocessing/evaluator/evaluator.go:247-252 | pkg/signalprocessing/evaluator/evaluator.go:302-307 — 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 `pkg/signalprocessing/evaluator/evaluator.go:247` 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 (6 lines × 2) internal/kubernautagent/investigator/evidence_handoff.go:360— internal/kubernautagent/investigator/evidence_handoff.go:360-365 | internal/kubernautagent/investigator/evidence_handoff.go:378-383 — 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 `internal/kubernautagent/investigator/evidence_handoff.go:360` 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 (6 lines × 2) pkg/datastorage/server/remediation_history_logic.go:378— pkg/datastorage/server/remediation_history_logic.go:378-383 | pkg/datastorage/server/remediation_history_logic.go:516-521 — 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.
Duplicated block (6 lines × 2) pkg/signalprocessing/audit/client.go:165— pkg/signalprocessing/audit/client.go:165-170 | pkg/signalprocessing/audit/client.go:284-289 — 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.
Duplicated block (6 lines × 2) pkg/apifrontend/resilience/retry.go:153— pkg/apifrontend/resilience/retry.go:153-158 | pkg/shared/transport/retry.go:195-200 — 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 (6 lines × 2) pkg/datastorage/repository/audit_events_query.go:282— pkg/datastorage/repository/audit_events_query.go:282-287 | pkg/datastorage/repository/notification_audit_repository.go:188-193 — 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 (6 lines × 2) pkg/fleet/registry/eaigw_registry.go:126— pkg/fleet/registry/eaigw_registry.go:126-131 | pkg/fleet/registry/kuadrant_registry.go:86-91 — before extracting anything, compare `pkg/fleet/registry/eaigw_registry.go` and `pkg/fleet/registry/kuadrant_registry.go` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 114 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (6 lines × 2) pkg/fleet/registry/eaigw_registry.go:145— pkg/fleet/registry/eaigw_registry.go:145-150 | pkg/fleet/registry/kuadrant_registry.go:103-108 — before extracting anything, compare `pkg/fleet/registry/eaigw_registry.go` and `pkg/fleet/registry/kuadrant_registry.go` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 114 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `error` to `w *EAIGWRegistry) markWatchUnhealthy(err` in one and `w *KuadrantRegistry) markWatchUnhealthy(err` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 2) internal/controller/effectivenessmonitor/reconciler.go:301— internal/controller/effectivenessmonitor/reconciler.go:301-306 | internal/controller/remediationorchestrator/config_accessors.go:71-76 — 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 (6 lines × 2) internal/kubernautagent/enrichment/k8s_adapter.go:313— internal/kubernautagent/enrichment/k8s_adapter.go:313-318 | pkg/kubernautagent/tools/k8s/resolver.go:306-311 — 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. Check import visibility before settling on that home: `internal/kubernautagent/enrichment/k8s_adapter.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
Duplicated block (6 lines × 2) pkg/apifrontend/logging/logging.go:49— pkg/apifrontend/logging/logging.go:49-54 | pkg/gateway/middleware/request_id.go:145-151 — 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 (6 lines × 2) internal/controller/remediationorchestrator/analyzing_handler.go:270— internal/controller/remediationorchestrator/analyzing_handler.go:270-275 | internal/controller/remediationorchestrator/pending_handler.go:86-93 — 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 `internal/controller/remediationorchestrator/analyzing_handler.go:270` 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. 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 (6 lines × 2) internal/kubernautagent/investigator/investigator_gates.go:333— internal/kubernautagent/investigator/investigator_gates.go:333-339 | internal/kubernautagent/investigator/investigator_gates.go:1686-1691 — 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.
Duplicated block (6 lines × 2) internal/kubernautagent/investigator/investigator.go:1274— internal/kubernautagent/investigator/investigator.go:1274-1279 | internal/kubernautagent/investigator/investigator_discovery.go:440-446 — 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 `internal/kubernautagent/investigator/investigator_discovery.go:440` 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. 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 (6 lines × 2) pkg/gateway/audit_emission.go:120— pkg/gateway/audit_emission.go:120-125 | pkg/signalprocessing/audit/client.go:555-560 — 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 `pkg/gateway/audit_emission.go:120` 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 (6 lines × 2) internal/kubernautagent/prompt/builder.go:317— internal/kubernautagent/prompt/builder.go:317-322 | internal/kubernautagent/prompt/history.go:154-159 — 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 `internal/kubernautagent/prompt/builder.go:317` 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 (6 lines × 2) pkg/signalprocessing/evaluator/evaluator.go:252— pkg/signalprocessing/evaluator/evaluator.go:252-257 | pkg/signalprocessing/evaluator/evaluator.go:401-406 — 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 `pkg/signalprocessing/evaluator/evaluator.go:252` 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 (6 lines × 2) pkg/aianalysis/handlers/analyzing.go:178— pkg/aianalysis/handlers/analyzing.go:178-183 | pkg/aianalysis/handlers/analyzing.go:234-239 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/aianalysis/handlers/analyzing.go:177` calls `Errorf` and `pkg/aianalysis/handlers/analyzing.go:231` 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 (6 lines × 2) pkg/apifrontend/session/service.go:454— pkg/apifrontend/session/service.go:454-459 | pkg/apifrontend/session/service.go:535-540 — 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.
Duplicated block (9 lines × 2) cmd/kubernautagent/llm_builder.go:303— cmd/kubernautagent/llm_builder.go:303-311 | pkg/apifrontend/launcher/model.go:357-365 — 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 `cmd/kubernautagent/llm_builder.go:303` 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 (9 lines × 2) cmd/signalprocessing/main.go:294— cmd/signalprocessing/main.go:294-302 | cmd/workflowexecution/main.go:480-488 — 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 `cmd/signalprocessing/main.go:294` 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 (9 lines × 2) docs/architecture/spikes/hitl-permission/main.go:657— docs/architecture/spikes/hitl-permission/main.go:657-665 | docs/architecture/spikes/run-state-persistence/main.go:619-627 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) docs/spikes/oas-runtime/internal/runtime/agent.go:364— docs/spikes/oas-runtime/internal/runtime/agent.go:364-372 | docs/spikes/oas-runtime/internal/runtime/agent.go:416-424 — 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 `docs/spikes/oas-runtime/internal/runtime/agent.go:364` 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 (9 lines × 2) internal/kubernautagent/enrichment/ds_adapter.go:142— internal/kubernautagent/enrichment/ds_adapter.go:142-150 | internal/kubernautagent/enrichment/ds_adapter.go:212-220 — 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 `internal/kubernautagent/enrichment/ds_adapter.go:142` 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 (9 lines × 2) internal/kubernautagent/mcp/tools/investigate_autonomous.go:78— internal/kubernautagent/mcp/tools/investigate_autonomous.go:78-86 | internal/kubernautagent/mcp/tools/investigate_start.go:32-40 — 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 (9 lines × 2) internal/kubernautagent/session/manager_interactive.go:259— internal/kubernautagent/session/manager_interactive.go:259-268 | internal/kubernautagent/session/manager_interactive.go:312-320 — 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.
Duplicated block (9 lines × 2) pkg/aianalysis/audit/audit.go:317— pkg/aianalysis/audit/audit.go:317-325 | pkg/aianalysis/audit/audit.go:425-433 — 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.
Duplicated block (9 lines × 2) pkg/datastorage/server/remediation_history_logic.go:366— pkg/datastorage/server/remediation_history_logic.go:366-374 | pkg/datastorage/server/remediation_history_logic.go:507-515 — 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 `pkg/datastorage/server/remediation_history_logic.go:366` 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 (9 lines × 2) pkg/datastorage/server/server_lifecycle.go:54— pkg/datastorage/server/server_lifecycle.go:54-62 | pkg/gateway/server.go:461-469 — 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 `pkg/datastorage/server/server_lifecycle.go:54` 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. 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 (9 lines × 2) pkg/notification/audit/manager.go:83— pkg/notification/audit/manager.go:83-91 | pkg/notification/delivery/log.go:153-161 — 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 (9 lines × 2) pkg/remediationorchestrator/audit/manager.go:310— pkg/remediationorchestrator/audit/manager.go:310-318 | pkg/remediationorchestrator/audit/manager.go:475-483 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/remediationorchestrator/audit/manager.go:484` calls `SetDuration` and `pkg/remediationorchestrator/audit/manager.go:320` 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 (9 lines × 2) internal/kubernautagent/enrichment/k8s_adapter.go:212— internal/kubernautagent/enrichment/k8s_adapter.go:212-220 | pkg/kubernautagent/tools/k8s/resolver.go:323-331 — 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 `internal/kubernautagent/enrichment/k8s_adapter.go:212` 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. Check import visibility before settling on that home: `internal/kubernautagent/enrichment/k8s_adapter.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/kubernautagent/tools/k8s/resolver.go:332` calls `notifySecretAccess` and `internal/kubernautagent/enrichment/k8s_adapter.go:221` 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 (9 lines × 2) cmd/gateway/main.go:162— cmd/gateway/main.go:162-170 | cmd/kubernautagent/main.go:260-268 — 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 (9 lines × 2) internal/config/effectivenessmonitor/config.go:231— internal/config/effectivenessmonitor/config.go:231-239 | internal/config/remediationorchestrator/config.go:393-401 — 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 (9 lines × 2) pkg/fleet/mcpclient/client.go:316— pkg/fleet/mcpclient/client.go:316-324 | pkg/fleet/mcpclient/writer.go:99-107 — 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 (9 lines × 2) pkg/fleet/registry/eaigw_registry.go:115— pkg/fleet/registry/eaigw_registry.go:115-123 | pkg/fleet/registry/kuadrant_registry.go:76-84 — before extracting anything, compare `pkg/fleet/registry/eaigw_registry.go` and `pkg/fleet/registry/kuadrant_registry.go` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 114 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (9 lines × 2) internal/kubernautagent/investigator/investigator_audit.go:719— internal/kubernautagent/investigator/investigator_audit.go:719-727 | pkg/apifrontend/security/redact.go:103-111 — 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. Check import visibility before settling on that home: `internal/kubernautagent/investigator/investigator_audit.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
Duplicated block (9 lines × 2) pkg/fleet/fmc/valkey_writer.go:47— pkg/fleet/fmc/valkey_writer.go:47-55 | pkg/fleet/scopecache/valkey_reader.go:46-54 — 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 (9 lines × 2) pkg/datastorage/dlq/client_consumer.go:269— pkg/datastorage/dlq/client_consumer.go:269-278 | pkg/datastorage/dlq/client_consumer.go:320-328 — 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.
Duplicated block (9 lines × 2) pkg/signalprocessing/audit/client.go:237— pkg/signalprocessing/audit/client.go:237-245 | pkg/signalprocessing/audit/client.go:427-435 — 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 (9 lines × 2) internal/kubernautagent/credentials/resolver.go:50— internal/kubernautagent/credentials/resolver.go:50-58 | internal/kubernautagent/credentials/resolver.go:69-77 — 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 `internal/kubernautagent/credentials/resolver.go:50` 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 after the matched lines, `internal/kubernautagent/credentials/resolver.go:60` calls `ReadDir` and `internal/kubernautagent/credentials/resolver.go:78` 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 (9 lines × 2) cmd/signalprocessing/main.go:305— cmd/signalprocessing/main.go:305-313 | cmd/workflowexecution/main.go:491-499 — 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 `cmd/signalprocessing/main.go:305` 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 (9 lines × 2) pkg/apifrontend/auth/jwt.go:468— pkg/apifrontend/auth/jwt.go:468-476 | pkg/apifrontend/auth/jwt.go:507-515 — 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 `pkg/apifrontend/auth/jwt.go:468` 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. 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 (9 lines × 2) pkg/kubernautagent/tools/k8s/resolver.go:416— pkg/kubernautagent/tools/k8s/resolver.go:416-424 | pkg/kubernautagent/tools/k8s/resolver.go:458-466 — 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 `pkg/kubernautagent/tools/k8s/resolver.go:416` 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 (10 lines × 2) cmd/kubernautagent/toolregistry.go:546— cmd/kubernautagent/toolregistry.go:546-555 | cmd/workflowexecution/main.go:643-652 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) docs/spikes/oas-runtime/internal/runtime/agent.go:98— docs/spikes/oas-runtime/internal/runtime/agent.go:98-107 | docs/spikes/oas-runtime/internal/runtime/agent.go:161-170 — 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 `docs/spikes/oas-runtime/internal/runtime/agent.go:98` 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 (10 lines × 2) internal/controller/remediationorchestrator/audit_events.go:257— internal/controller/remediationorchestrator/audit_events.go:257-266 | internal/controller/remediationorchestrator/audit_events.go:281-290 — 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.
Duplicated block (10 lines × 2) internal/kubernautagent/alignment/evaluator.go:170— internal/kubernautagent/alignment/evaluator.go:170-179 | internal/kubernautagent/alignment/grounding.go:46-55 — 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 `internal/kubernautagent/alignment/evaluator.go:170` 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. 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 (10 lines × 2) internal/kubernautagent/session/manager.go:220— internal/kubernautagent/session/manager.go:220-229 | internal/kubernautagent/session/manager_interactive.go:62-71 — 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 (10 lines × 2) pkg/aianalysis/handlers/response_processor.go:867— pkg/aianalysis/handlers/response_processor.go:867-876 | pkg/aianalysis/handlers/response_processor.go:919-928 — 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 `pkg/aianalysis/handlers/response_processor.go:867` 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 (10 lines × 2) pkg/datastorage/repository/audit_events_query.go:142— pkg/datastorage/repository/audit_events_query.go:142-151 | pkg/datastorage/repository/audit_export.go:223-232 — 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 `pkg/datastorage/repository/audit_events_query.go:142` 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. 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 (10 lines × 2) pkg/gateway/audit_emission.go:334— pkg/gateway/audit_emission.go:334-343 | pkg/gateway/audit_emission.go:433-442 — 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 `pkg/gateway/audit_emission.go:334` 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 (10 lines × 2) pkg/gateway/processing/distributed_lock.go:125— pkg/gateway/processing/distributed_lock.go:125-134 | pkg/remediationorchestrator/locking/distributed_lock.go:142-151 — before extracting anything, compare `pkg/gateway/processing/distributed_lock.go` and `pkg/remediationorchestrator/locking/distributed_lock.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/gateway/processing/distributed_lock.go:125` 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. 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 (10 lines × 2) pkg/kubernautagent/tools/alertmanager/client.go:83— pkg/kubernautagent/tools/alertmanager/client.go:83-92 | pkg/kubernautagent/tools/prometheus/client.go:103-112 — 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 `pkg/kubernautagent/tools/alertmanager/client.go:83` 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 (10 lines × 2) REDACTED:49— REDACTED:49-58 | REDACTED:122-131 — 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 `REDACTED:49` 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 (10 lines × 2) REDACTED:219— REDACTED:219-228 | REDACTED:240-249 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) internal/controller/remediationorchestrator/analyzing_handler.go:374— internal/controller/remediationorchestrator/analyzing_handler.go:374-383 | internal/controller/remediationorchestrator/awaiting_approval_handler.go:395-404 — 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 `internal/controller/remediationorchestrator/analyzing_handler.go:374` 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 (10 lines × 2) api/agentsession/v1alpha1/groupversion_info.go:31— api/agentsession/v1alpha1/groupversion_info.go:31-40 | api/investigationsession/v1alpha1/groupversion_info.go:28-37 — before extracting anything, compare `api/agentsession/v1alpha1/groupversion_info.go` and `api/investigationsession/v1alpha1/groupversion_info.go` as WHOLE FILES: 84% 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) pkg/apifrontend/auth/middleware.go:235— pkg/apifrontend/auth/middleware.go:235-244 | pkg/shared/auth/middleware.go:284-293 — 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 (10 lines × 2) docs/architecture/spikes/run-state-persistence/main.go:412— docs/architecture/spikes/run-state-persistence/main.go:412-422 | docs/architecture/spikes/run-state-persistence/main.go:452-461 — 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.
Duplicated block (10 lines × 2) pkg/aianalysis/handlers/response_processor.go:888— pkg/aianalysis/handlers/response_processor.go:888-897 | pkg/aianalysis/handlers/response_processor.go:941-950 — 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 `pkg/aianalysis/handlers/response_processor.go:888` 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 (10 lines × 2) internal/controller/notification/notificationrequest_controller.go:492— internal/controller/notification/notificationrequest_controller.go:492-501 | internal/controller/notification/notificationrequest_controller.go:546-555 — 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 `internal/controller/notification/notificationrequest_controller.go:492` 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 (10 lines × 2) cmd/apifrontend/backend_deps.go:833— cmd/apifrontend/backend_deps.go:833-842 | cmd/apifrontend/backend_deps.go:852-861 — 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 `cmd/apifrontend/backend_deps.go:833` 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. 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 (10 lines × 2) internal/kubernautagent/tools/custom/tools.go:178— internal/kubernautagent/tools/custom/tools.go:178-187 | internal/kubernautagent/tools/custom/tools.go:322-331 — 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 `internal/kubernautagent/tools/custom/tools.go:178` 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. 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 (10 lines × 2) pkg/remediationorchestrator/routing/blocking.go:260— pkg/remediationorchestrator/routing/blocking.go:260-269 | pkg/remediationorchestrator/routing/blocking.go:337-346 — 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 (10 lines × 2) internal/kubernautagent/tools/custom/tools.go:190— internal/kubernautagent/tools/custom/tools.go:190-199 | internal/kubernautagent/tools/custom/tools.go:334-343 — 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 `internal/kubernautagent/tools/custom/tools.go:190` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Swallowed exception (caught, then discarded) pkg/shared/llm/openaicompat/reasoning.go:205— `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/shared/llm/openaicompat/reasoning.go:211— `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/kubernautagent/tools/sanitization/secret.go:77— `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/kubernautagent/tools/sanitization/secret.go:95— `if closeErr := encoder.Close(); closeErr != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/kubernautagent/tools/sanitization/secret.go:101— `if err := encoder.Close(); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/kubernautagent/tools/sanitization/secret.go:186— `if err := json.Unmarshal(raw, &obj); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/kubernautagent/tools/sanitization/secret.go:207— `if err := json.Unmarshal(kindRaw, &kind); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/kubernautagent/tools/sanitization/secret.go:219— `if err := json.Unmarshal(kindRaw, &kind); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/kubernautagent/tools/sanitization/secret.go:233— `if err := json.Unmarshal(fieldRaw, &m); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/kubernautagent/tools/sanitization/secret.go:237— `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/kubernautagent/tools/sanitization/secret.go:244— `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/kubernautagent/tools/sanitization/secret.go:254— `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/kubernautagent/tools/sanitization/secret.go:266— `if err := json.Unmarshal(itemsRaw, &items); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/kubernautagent/tools/sanitization/secret.go:272— `if err := json.Unmarshal(item, &itemObj); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/kubernautagent/tools/sanitization/secret.go:286— `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/kubernautagent/tools/sanitization/secret.go:291— `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/kubernautagent/tools/prometheus/tools.go:250— `if err := json.Unmarshal([]byte(body), &resp); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/kubernautagent/tools/prometheus/tools.go:258— `if err := json.Unmarshal(dataRaw, &items); err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/kubernautagent/tools/prometheus/tools.go:270— `if err != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/kubernautagent/tools/logs/fetch_pod_logs.go:105— `if fetchErr != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/kubernautagent/tools/k8s/resolver.go:179— `if parseErr != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/kubernautagent/tools/k8s/resolver.go:241— `if kindErr != nil` 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, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
FileTooLong: investigator/investigator_gates.go internal/kubernautagent/investigator/investigator_gates.go— FileTooLong — 1266 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 766 over it, 2.53× 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: creator/notification.go pkg/remediationorchestrator/creator/notification.go— FileTooLong — 836 significant lines (blank, comment-only and punctuation-only lines excluded), about 68% of them inside a single declaration: NotificationCreator (27 blocks, 74-1348). The bar is 500 significant lines; this is 336 over it, 1.67× 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: investigator/investigator.go internal/kubernautagent/investigator/investigator.go— FileTooLong — 835 significant lines (blank, comment-only and punctuation-only lines excluded), about 60% of them inside a single declaration: Investigator (21 blocks, 300-1471). The bar is 500 significant lines; this is 335 over it, 1.67× 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: tools/crd_tools.go pkg/apifrontend/tools/crd_tools.go— FileTooLong — 722 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 222 over it, 1.44× 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: handlers/response_processor.go pkg/aianalysis/handlers/response_processor.go— FileTooLong — 709 significant lines (blank, comment-only and punctuation-only lines excluded), about 62% of them inside a single declaration: ResponseProcessor (21 blocks, 68-1186). The bar is 500 significant lines; this is 209 over it, 1.42× 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: audit/manager.go pkg/remediationorchestrator/audit/manager.go— FileTooLong — 670 significant lines (blank, comment-only and punctuation-only lines excluded), about 70% of them inside a single declaration: Manager (17 blocks, 108-1066). The bar is 500 significant lines; this is 170 over it, 1.34× 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: notification/notificationrequest_controller.go internal/controller/notification/notificationrequest_controller.go— FileTooLong — 664 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: NotificationRequestReconciler (32 blocks, 53-1449). The bar is 500 significant lines; this is 164 over it, 1.33× 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: apifrontend/main.go cmd/apifrontend/main.go— FileTooLong — 651 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 151 over it, 1.30× 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: routing/blocking.go pkg/remediationorchestrator/routing/blocking.go— FileTooLong — 625 significant lines (blank, comment-only and punctuation-only lines excluded), about 80% of them inside a single declaration: RoutingEngine (25 blocks, 92-1372). The bar is 500 significant lines; this is 125 over it, 1.25× 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: investigator/investigator_loop.go internal/kubernautagent/investigator/investigator_loop.go— FileTooLong — 618 significant lines (blank, comment-only and punctuation-only lines excluded), about 62% of them inside a single declaration: Investigator (18 blocks, 42-1036). The bar is 500 significant lines; this is 118 over it, 1.24× 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: shadow-acp/main.go docs/architecture/spikes/shadow-acp/main.go— FileTooLong — 612 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 112 over it, 1.22× 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: agentsession/dispatcher.go internal/kubernautagent/agentsession/dispatcher.go— FileTooLong — 583 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: Dispatcher (31 blocks, 117-1159). The bar is 500 significant lines; this is 83 over it, 1.17× 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: tools/ka_investigate_mcp.go pkg/apifrontend/tools/ka_investigate_mcp.go— FileTooLong — 578 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 78 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: executor/job.go pkg/workflowexecution/executor/job.go— FileTooLong — 575 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 75 over it, 1.15× 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: apifrontend/backend_deps.go cmd/apifrontend/backend_deps.go— FileTooLong — 563 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 63 over it, 1.13× 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: audit/store_adapter.go pkg/apifrontend/audit/store_adapter.go— FileTooLong — 560 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 60 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: investigator/investigator_audit.go internal/kubernautagent/investigator/investigator_audit.go— FileTooLong — 526 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 26 over it, 1.05× 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: executor/ansible.go pkg/workflowexecution/executor/ansible.go— FileTooLong — 518 significant lines (blank, comment-only and punctuation-only lines excluded), about 67% of them inside a single declaration: AnsibleExecutor (19 blocks, 190-866). The bar is 500 significant lines; this is 18 over it, 1.04× 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: types/typed_parameter.go pkg/shared/types/typed_parameter.go— FileTooLong — 503 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3 over it, 1.01× 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.
Outbound HTTP without resilience docs/architecture/spikes/hitl-permission/main.go:611— `http.Get(` 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 docs/architecture/spikes/hitl-permission/main.go:627— `http.Post(` 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 docs/architecture/spikes/hitl-permission/main.go:645— `http.Post(` 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 docs/architecture/spikes/hitl-permission/main.go:657— `http.Get(` 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 docs/architecture/spikes/run-state-persistence/main.go:369— `http.Get(` 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 docs/architecture/spikes/run-state-persistence/main.go:512— `http.Get(` 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 docs/architecture/spikes/run-state-persistence/main.go:522— `http.Get(` 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 docs/architecture/spikes/run-state-persistence/main.go:608— `http.Post(` 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 docs/architecture/spikes/run-state-persistence/main.go:619— `http.Get(` 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 docs/architecture/spikes/run-state-persistence/main.go:681— `http.Get(` 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 docs/architecture/spikes/shadow-acp/main.go:471— `http.Get(` 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 docs/architecture/spikes/shadow-acp/main.go:758— `http.Post(` 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 docs/architecture/spikes/shadow-acp/main.go:776— `http.Post(` 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 docs/architecture/spikes/shadow-acp/main.go:793— `http.Post(` 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 docs/architecture/spikes/shadow-acp/main.go:808— `http.Post(` 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 docs/architecture/spikes/shadow-acp/main.go:825— `http.Post(` 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 docs/architecture/spikes/shadow-acp/main.go:847— `http.DefaultClient` 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 docs/architecture/spikes/shadow-acp/main.go:859— `http.Get(` 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 docs/architecture/spikes/shadow-acp/main.go:879— `http.Post(` 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.
X2 · Cancellation propagation· Function without context.Context · ×19
Function without context.Context: waitForHealth docs/architecture/spikes/shadow-acp/main.go:469— `waitForHealth` calls `http.Get(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: createSyncRun docs/architecture/spikes/shadow-acp/main.go:751— `createSyncRun` calls `http.Post(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: createSyncRunWithSession docs/architecture/spikes/shadow-acp/main.go:768— `createSyncRunWithSession` calls `http.Post(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: createAsyncRun docs/architecture/spikes/shadow-acp/main.go:786— `createAsyncRun` calls `http.Post(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: resumeRun docs/architecture/spikes/shadow-acp/main.go:803— `resumeRun` calls `http.Post(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: streamRun docs/architecture/spikes/shadow-acp/main.go:818— `streamRun` calls `http.Post(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: cancelRun docs/architecture/spikes/shadow-acp/main.go:845— `cancelRun` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: getRun docs/architecture/spikes/shadow-acp/main.go:858— `getRun` calls `http.Get(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: evaluateWithShadow docs/architecture/spikes/shadow-acp/main.go:869— `evaluateWithShadow` calls `http.Post(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: testGetRunAfterRestart docs/architecture/spikes/run-state-persistence/main.go:340— `testGetRunAfterRestart` calls `http.Get(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: testOptionAvsOptionC docs/architecture/spikes/run-state-persistence/main.go:496— `testOptionAvsOptionC` calls `http.Get(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: createSyncRun docs/architecture/spikes/run-state-persistence/main.go:601— `createSyncRun` calls `http.Post(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: getRun docs/architecture/spikes/run-state-persistence/main.go:618— `getRun` calls `http.Get(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: streamRunWithError docs/architecture/spikes/run-state-persistence/main.go:629— `streamRunWithError` calls `http.NewRequestWithContext(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: waitForHealth docs/architecture/spikes/run-state-persistence/main.go:679— `waitForHealth` calls `http.Get(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: waitForHealth docs/architecture/spikes/hitl-permission/main.go:609— `waitForHealth` calls `http.Get(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: createRun docs/architecture/spikes/hitl-permission/main.go:621— `createRun` calls `http.Post(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: resumeRun docs/architecture/spikes/hitl-permission/main.go:637— `resumeRun` calls `http.Post(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: getRun docs/architecture/spikes/hitl-permission/main.go:656— `getRun` calls `http.Get(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
X3 · Exception handling· Discarded error (assigned to `_`, then its result used) · ×18
Discarded error (assigned to `_`, then its result used) pkg/workflowexecution/executor/ansible.go:736— `ca, _ := os.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/ca.crt")` writes the call's error to `_` and then uses `ca` as if the call succeeded. When `os.ReadFile` fails, `ca` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `ca` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) pkg/workflowexecution/executor/awx_client.go:89— `respBody, _ := io.ReadAll(resp.Body)` writes the call's error to `_` and then uses `respBody` as if the call succeeded. When `io.ReadAll` fails, `respBody` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `respBody` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) pkg/workflowexecution/executor/awx_client.go:119— `respBody, _ := io.ReadAll(resp.Body)` writes the call's error to `_` and then uses `respBody` as if the call succeeded. When `io.ReadAll` fails, `respBody` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `respBody` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) pkg/workflowexecution/executor/awx_client.go:147— `respBody, _ := io.ReadAll(resp.Body)` writes the call's error to `_` and then uses `respBody` as if the call succeeded. When `io.ReadAll` fails, `respBody` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `respBody` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) pkg/workflowexecution/executor/awx_client.go:174— `respBody, _ := io.ReadAll(resp.Body)` writes the call's error to `_` and then uses `respBody` as if the call succeeded. When `io.ReadAll` fails, `respBody` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `respBody` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) pkg/workflowexecution/executor/awx_client.go:228— `respBody, _ := io.ReadAll(resp.Body)` writes the call's error to `_` and then uses `respBody` as if the call succeeded. When `io.ReadAll` fails, `respBody` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `respBody` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) pkg/workflowexecution/executor/awx_client.go:263— `respBody, _ := io.ReadAll(resp.Body)` writes the call's error to `_` and then uses `respBody` as if the call succeeded. When `io.ReadAll` fails, `respBody` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `respBody` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) pkg/workflowexecution/executor/awx_client.go:317— `respBody, _ := io.ReadAll(resp.Body)` writes the call's error to `_` and then uses `respBody` as if the call succeeded. When `io.ReadAll` fails, `respBody` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `respBody` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) pkg/workflowexecution/executor/awx_client.go:347— `respBody, _ := io.ReadAll(resp.Body)` writes the call's error to `_` and then uses `respBody` as if the call succeeded. When `io.ReadAll` fails, `respBody` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `respBody` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) pkg/workflowexecution/executor/awx_client.go:383— `respBody, _ := io.ReadAll(resp.Body)` writes the call's error to `_` and then uses `respBody` as if the call succeeded. When `io.ReadAll` fails, `respBody` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `respBody` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) pkg/workflowexecution/executor/awx_client.go:413— `respBody, _ := io.ReadAll(resp.Body)` writes the call's error to `_` and then uses `respBody` as if the call succeeded. When `io.ReadAll` fails, `respBody` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `respBody` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) pkg/workflowexecution/audit/manager.go:388— `payload, _ := buildExecutionStartedPayloadChecked(wfe, pipelineRunName, resourceNamespaces...)` writes the call's error to `_` and then uses `payload` as if the call succeeded. When `buildExecutionStartedPayloadChecked` fails, `payload` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `payload` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) pkg/workflowexecution/audit/manager.go:543— `payload, _ := buildWorkflowExecutionAuditPayloadChecked(wfe)` writes the call's error to `_` and then uses `payload` as if the call succeeded. When `buildWorkflowExecutionAuditPayloadChecked` fails, `payload` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `payload` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) pkg/shared/llm/openaicompat/client.go:138— `bodyBytes, _ := io.ReadAll(resp.Body)` writes the call's error to `_` and then uses `bodyBytes` as if the call succeeded. When `io.ReadAll` fails, `bodyBytes` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `bodyBytes` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) pkg/shared/hash/canonical.go:88— `ji, _ := json.Marshal(normalized[i])` writes the call's error to `_` and then uses `ji` as if the call succeeded. When `json.Marshal` fails, `ji` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `ji` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) pkg/shared/hash/canonical.go:89— `jj, _ := json.Marshal(normalized[j])` writes the call's error to `_` and then uses `jj` as if the call succeeded. When `json.Marshal` fails, `jj` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `jj` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) pkg/notification/delivery/pagerduty.go:89— `body, _ := io.ReadAll(resp.Body)` writes the call's error to `_` and then uses `body` as if the call succeeded. When `io.ReadAll` fails, `body` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `body` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) pkg/notification/delivery/teams.go:81— `body, _ := io.ReadAll(resp.Body)` writes the call's error to `_` and then uses `body` as if the call succeeded. When `io.ReadAll` fails, `body` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `body` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Duplicated block (11 lines × 2) internal/kubernautagent/agentsession/mapping.go:321— internal/kubernautagent/agentsession/mapping.go:321-331 | pkg/aianalysis/handlers/evidence_status.go:33-43 — 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 `internal/kubernautagent/agentsession/mapping.go:321` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Check import visibility before settling on that home: `internal/kubernautagent/agentsession/mapping.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
Duplicated block (11 lines × 2) internal/kubernautagent/enrichment/ds_adapter.go:175— internal/kubernautagent/enrichment/ds_adapter.go:175-185 | internal/kubernautagent/enrichment/ds_adapter.go:227-237 — 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.
Duplicated block (11 lines × 2) internal/kubernautagent/investigator/investigator_rca.go:165— internal/kubernautagent/investigator/investigator_rca.go:165-175 | internal/kubernautagent/investigator/investigator_workflow_selection.go:279-289 — 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 `internal/kubernautagent/investigator/investigator_rca.go:165` 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 (11 lines × 2) internal/kubernautagent/session/manager.go:176— internal/kubernautagent/session/manager.go:176-186 | internal/kubernautagent/session/manager_interactive.go:33-43 — 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 (11 lines × 2) pkg/apifrontend/ka/mcp_sdk_client.go:482— pkg/apifrontend/ka/mcp_sdk_client.go:482-492 | pkg/apifrontend/ka/pooled_mcp_client.go:336-346 — 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 (11 lines × 2) pkg/apifrontend/launcher/openai/adapter.go:92— pkg/apifrontend/launcher/openai/adapter.go:92-102 | pkg/kubernautagent/llm/openai/client.go:104-114 — 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 (11 lines × 2) pkg/apifrontend/tools/af_alerts.go:124— pkg/apifrontend/tools/af_alerts.go:124-134 | pkg/apifrontend/tools/af_alerts.go:272-282 — 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.
Duplicated block (11 lines × 2) pkg/authwebhook/actiontype_handler.go:204— pkg/authwebhook/actiontype_handler.go:204-214 | pkg/authwebhook/remediationworkflow_handler.go:453-463 — 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 `pkg/authwebhook/actiontype_handler.go:204` 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (11 lines × 2) pkg/gateway/middleware/alertmanager_freshness.go:108— pkg/gateway/middleware/alertmanager_freshness.go:108-118 | pkg/gateway/middleware/timestamp.go:89-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 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 (11 lines × 2) pkg/gateway/middleware/event_freshness.go:140— pkg/gateway/middleware/event_freshness.go:140-150 | pkg/gateway/middleware/timestamp.go:152-162 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) pkg/kubernautagent/types/evidence.go:244— pkg/kubernautagent/types/evidence.go:244-254 | pkg/kubernautagent/types/evidence.go:272-282 — 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 `pkg/kubernautagent/types/evidence.go:244` 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) pkg/shared/tls/tls.go:406— pkg/shared/tls/tls.go:406-416 | pkg/shared/tls/tls.go:440-450 — 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 `pkg/shared/tls/tls.go:406` 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. 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 (11 lines × 2) pkg/apifrontend/resilience/retry.go:88— pkg/apifrontend/resilience/retry.go:88-98 | pkg/shared/transport/retry.go:131-141 — 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 (11 lines × 2) pkg/fleet/mcpclient/reader_factory.go:42— pkg/fleet/mcpclient/reader_factory.go:42-52 | pkg/workflowexecution/executor/client_factory.go:100-110 — 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 (11 lines × 2) internal/kubernautagent/tools/custom/tools.go:241— internal/kubernautagent/tools/custom/tools.go:241-251 | internal/kubernautagent/tools/custom/tools.go:374-384 — 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 `internal/kubernautagent/tools/custom/tools.go:241` 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. 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 (11 lines × 2) docs/architecture/spikes/shadow-acp/main.go:215— docs/architecture/spikes/shadow-acp/main.go:215-225 | docs/architecture/spikes/shadow-acp/main.go:259-269 — 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.
Duplicated block (11 lines × 2) pkg/datastorage/dlq/client_consumer.go:249— pkg/datastorage/dlq/client_consumer.go:249-259 | pkg/datastorage/dlq/client_consumer.go:303-313 — 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 `pkg/datastorage/dlq/client_consumer.go:249` 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) cmd/authwebhook/main.go:226— cmd/authwebhook/main.go:226-233 | cmd/signalprocessing/main.go:532-539 — 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 (8 lines × 2) internal/controller/remediationorchestrator/audit_events.go:578— internal/controller/remediationorchestrator/audit_events.go:578-585 | internal/controller/remediationorchestrator/audit_events.go:622-629 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/controller/remediationorchestrator/audit_events.go:586` calls `SetDuration` and `internal/controller/remediationorchestrator/audit_events.go:631` 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 lines × 2) internal/kubernautagent/investigator/investigator_audit.go:52— internal/kubernautagent/investigator/investigator_audit.go:52-59 | internal/kubernautagent/investigator/investigator_audit.go:86-93 — 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 `internal/kubernautagent/investigator/investigator_audit.go:52` 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) internal/kubernautagent/investigator/investigator_gates.go:847— internal/kubernautagent/investigator/investigator_gates.go:847-854 | internal/kubernautagent/investigator/investigator_gates.go:1005-1012 — 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 `internal/kubernautagent/investigator/investigator_gates.go:847` 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 (8 lines × 2) internal/kubernautagent/server/audit_middleware.go:70— internal/kubernautagent/server/audit_middleware.go:70-77 | internal/kubernautagent/server/audit_middleware.go:81-88 — 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.
Duplicated block (8 lines × 2) internal/kubernautagent/workflowcatalog/cache.go:148— internal/kubernautagent/workflowcatalog/cache.go:148-155 | pkg/gateway/server_constructors.go:312-319 — 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 `internal/kubernautagent/workflowcatalog/cache.go:148` 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. Check import visibility before settling on that home: `internal/kubernautagent/workflowcatalog/cache.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
Duplicated block (8 lines × 2) pkg/aianalysis/audit/audit.go:184— pkg/aianalysis/audit/audit.go:184-191 | pkg/aianalysis/audit/audit.go:707-714 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/aianalysis/audit/audit.go:703` calls `toOptErrorDetails` and `pkg/aianalysis/audit/audit.go:180` does not — after which the two agree again for 3 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 lines × 2) pkg/apifrontend/resilience/k8s_dynamic.go:111— pkg/apifrontend/resilience/k8s_dynamic.go:111-118 | pkg/apifrontend/resilience/k8s_dynamic.go:217-224 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (8 lines × 2) pkg/apifrontend/tools/crd_tools_session.go:313— pkg/apifrontend/tools/crd_tools_session.go:313-320 | pkg/apifrontend/tools/ka_investigate_mcp.go:1135-1142 — 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 `pkg/apifrontend/tools/crd_tools_session.go:313` 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. 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 (8 lines × 2) pkg/fleet/mcpclient/writer.go:151— pkg/fleet/mcpclient/writer.go:151-158 | pkg/fleet/mcpclient/writer.go:243-250 — 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.
Duplicated block (8 lines × 2) pkg/kubernautagent/llm/geminifamily/client.go:239— pkg/kubernautagent/llm/geminifamily/client.go:239-246 | pkg/kubernautagent/llm/geminifamily/client.go:261-268 — 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 (8 lines × 2) pkg/kubernautagent/tools/k8s/jq.go:57— pkg/kubernautagent/tools/k8s/jq.go:57-64 | pkg/kubernautagent/tools/k8s/jq.go:83-90 — 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 (8 lines × 2) pkg/kubernautagent/tools/alertmanager/client.go:95— pkg/kubernautagent/tools/alertmanager/client.go:95-102 | pkg/kubernautagent/tools/prometheus/client.go:115-122 — 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 `pkg/kubernautagent/tools/alertmanager/client.go:95` 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (8 lines × 2) pkg/gateway/adapters/testing_exports.go:37— pkg/gateway/adapters/testing_exports.go:37-45 | pkg/gateway/adapters/testing_exports.go:117-124 — 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 `pkg/gateway/adapters/testing_exports.go:37` 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) docs/architecture/spikes/run-state-persistence/main.go:609— docs/architecture/spikes/run-state-persistence/main.go:609-616 | docs/architecture/spikes/shadow-acp/main.go:777-784 — 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 `docs/architecture/spikes/run-state-persistence/main.go:609` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (8 lines × 2) pkg/workflowexecution/executor/awx_client.go:106— pkg/workflowexecution/executor/awx_client.go:106-113 | pkg/workflowexecution/executor/awx_client.go:400-407 — 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 `pkg/workflowexecution/executor/awx_client.go:106` 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) docs/architecture/spikes/hitl-permission/main.go:628— docs/architecture/spikes/hitl-permission/main.go:628-635 | docs/architecture/spikes/shadow-acp/main.go:794-801 — 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 `docs/architecture/spikes/hitl-permission/main.go:628` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×15
Edited copy of a member (13 corresponding lines) internal/kubernautagent/investigator/investigator_loop.go:496— internal/kubernautagent/investigator/investigator_loop.go:496-513 | internal/kubernautagent/investigator/investigator_tools.go:172-184 — 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.
Edited copy of a member (13 corresponding lines) internal/kubernautagent/mcp/adapters/adapters.go:52— internal/kubernautagent/mcp/adapters/adapters.go:52-64 | internal/kubernautagent/mcp/adapters/adapters.go:129-141 — 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.
Edited copy of a member (13 corresponding lines) pkg/datastorage/server/middleware/maxbytes.go:62— pkg/datastorage/server/middleware/maxbytes.go:62-74 | pkg/datastorage/server/middleware/ratelimit.go:171-183 — 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.
Edited copy of a member (13 corresponding lines) internal/kubernautagent/audit/ds_payloads.go:410— internal/kubernautagent/audit/ds_payloads.go:410-423 | internal/kubernautagent/audit/ds_payloads.go:425-437 — 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.
Edited copy of a member (13 corresponding lines) pkg/apifrontend/severity/anthropic.go:205— pkg/apifrontend/severity/anthropic.go:205-217 | pkg/kubernautagent/llm/anthropicfamily/client.go:587-599 — 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.
Edited copy of a member (13 corresponding lines) pkg/apifrontend/agent/phase_guard.go:592— pkg/apifrontend/agent/phase_guard.go:592-604 | pkg/apifrontend/agent/phase_guard.go:761-776 — 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.
Edited copy of a member (13 corresponding lines) internal/kubernautagent/investigator/token_scope.go:86— internal/kubernautagent/investigator/token_scope.go:86-98 | internal/kubernautagent/investigator/token_scope.go:102-114 — 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.
Edited copy of a member (13 corresponding lines) pkg/datastorage/dlq/client.go:305— pkg/datastorage/dlq/client.go:305-319 | pkg/datastorage/dlq/client_consumer.go:340-352 — 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.
Edited copy of a member (13 corresponding lines) pkg/apifrontend/policyread/kubernetes_sources.go:252— pkg/apifrontend/policyread/kubernetes_sources.go:252-264 | pkg/apifrontend/policyread/local_inventory.go:249-261 — 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.
Edited copy of a member (13 corresponding lines) pkg/fleet/mcpclient/client.go:184— pkg/fleet/mcpclient/client.go:184-196 | pkg/fleet/mcpclient/writer.go:76-88 — 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.
Edited copy of a member (13 corresponding lines) internal/controller/signalprocessing/signalprocessing_categorizing.go:192— internal/controller/signalprocessing/signalprocessing_categorizing.go:192-204 | internal/controller/signalprocessing/signalprocessing_categorizing.go:209-221 — 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.
Edited copy of a member (13 corresponding lines) pkg/gateway/adapters/resource_registry.go:291— pkg/gateway/adapters/resource_registry.go:291-303 | pkg/gateway/adapters/resource_registry.go:359-371 — 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.
Edited copy of a member (13 corresponding lines) pkg/apifrontend/tlswiring/tlswiring.go:189— pkg/apifrontend/tlswiring/tlswiring.go:189-202 | pkg/shared/tls/tls.go:102-114 — 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.
Edited copy of a member (13 corresponding lines) internal/kubernautagent/audit/ds_response_mapping.go:81— internal/kubernautagent/audit/ds_response_mapping.go:81-93 | pkg/aianalysis/handlers/generated_helpers.go:36-51 — 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.
Edited copy of a member (13 corresponding lines) pkg/apifrontend/auth/middleware.go:178— pkg/apifrontend/auth/middleware.go:178-190 | pkg/apifrontend/tools/ka_investigate_mcp.go:175-187 — 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 copy of a member (7 corresponding lines) · ×13
Edited copy of a member (7 corresponding lines) pkg/gateway/server.go:602— pkg/gateway/server.go:602-611 | pkg/datastorage/server/handlers.go:78-84 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) internal/kubernautagent/config/config.go:31— internal/kubernautagent/config/config.go:31-37 | pkg/apifrontend/config/config.go:380-389 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) internal/kubernautagent/config/config.go:40— internal/kubernautagent/config/config.go:40-46 | pkg/notification/config/config.go:154-161 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) pkg/effectivenessmonitor/client/tls.go:32— pkg/effectivenessmonitor/client/tls.go:32-41 | pkg/shared/tls/ca_reloader.go:140-146 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) pkg/kubernautagent/tools/alertmanager/tools.go:78— pkg/kubernautagent/tools/alertmanager/tools.go:78-84 | pkg/kubernautagent/tools/prometheus/tools.go:219-225 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) internal/kubernautagent/mcp/timeout_manager.go:127— internal/kubernautagent/mcp/timeout_manager.go:127-133 | internal/kubernautagent/session/store.go:243-249 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) internal/kubernautagent/mcp/timeout_manager.go:139— internal/kubernautagent/mcp/timeout_manager.go:139-145 | internal/kubernautagent/session/store.go:252-258 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) internal/kubernautagent/investigator/investigator_gates.go:1334— internal/kubernautagent/investigator/investigator_gates.go:1334-1340 | internal/kubernautagent/workflowcatalog/metadata.go:87-93 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) pkg/datastorage/models/workflow_schema.go:531— pkg/datastorage/models/workflow_schema.go:531-537 | pkg/datastorage/repository/audit_events_batch.go:45-52 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) internal/kubernautagent/mcp/session_manager.go:679— internal/kubernautagent/mcp/session_manager.go:679-687 | pkg/workflowexecution/executor/tekton.go:357-363 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) pkg/fleet/mcpclient/resilience.go:609— pkg/fleet/mcpclient/resilience.go:609-617 | pkg/kubernautagent/llm/openai/client.go:64-70 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) pkg/remediationapprovalrequest/conditions.go:147— pkg/remediationapprovalrequest/conditions.go:147-153 | pkg/remediationrequest/conditions.go:195-201 — These two members are one piece of code written twice and then edited apart: 7 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 (7 corresponding lines) pkg/remediationapprovalrequest/conditions.go:180— pkg/remediationapprovalrequest/conditions.go:180-186 | pkg/remediationrequest/conditions.go:215-221 — These two members are one piece of code written twice and then edited apart: 7 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 (13 lines × 2) cmd/aianalysis/main.go:244— cmd/aianalysis/main.go:244-256 | cmd/signalprocessing/main.go:193-205 — 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 `cmd/aianalysis/main.go:244` 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) docs/architecture/spikes/run-state-persistence/main.go:647— docs/architecture/spikes/run-state-persistence/main.go:647-659 | docs/architecture/spikes/shadow-acp/main.go:829-841 — 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (13 lines × 2) internal/controller/effectivenessmonitor/target_resources.go:276— internal/controller/effectivenessmonitor/target_resources.go:276-288 | internal/controller/remediationorchestrator/pre_remediation_hash.go:174-186 — 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 `internal/controller/effectivenessmonitor/target_resources.go:276` 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 (13 lines × 2) internal/kubernautagent/enrichment/k8s_adapter.go:284— internal/kubernautagent/enrichment/k8s_adapter.go:284-296 | pkg/kubernautagent/tools/k8s/resolver.go:238-250 — 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 `internal/kubernautagent/enrichment/k8s_adapter.go:284` 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. Check import visibility before settling on that home: `internal/kubernautagent/enrichment/k8s_adapter.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
Duplicated block (13 lines × 2) internal/kubernautagent/prompt/history.go:744— internal/kubernautagent/prompt/history.go:744-756 | internal/kubernautagent/prompt/history.go:758-770 — 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.
Duplicated block (13 lines × 2) pkg/apifrontend/ratelimit/ratelimit.go:52— pkg/apifrontend/ratelimit/ratelimit.go:52-64 | pkg/datastorage/server/middleware/ratelimit.go:82-94 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) pkg/datastorage/reconstruction/parser.go:202— pkg/datastorage/reconstruction/parser.go:202-214 | pkg/datastorage/reconstruction/parser.go:224-236 — 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.
Duplicated block (13 lines × 2) pkg/effectivenessmonitor/client/ca_reloader.go:108— pkg/effectivenessmonitor/client/ca_reloader.go:108-120 | pkg/effectivenessmonitor/client/tls.go:65-77 — 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 (13 lines × 2) pkg/fleet/registry/eaigw_registry.go:357— pkg/fleet/registry/eaigw_registry.go:357-369 | pkg/fleet/registry/kuadrant_registry.go:276-288 — before extracting anything, compare `pkg/fleet/registry/eaigw_registry.go` and `pkg/fleet/registry/kuadrant_registry.go` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 114 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) pkg/gateway/adapters/prometheus_adapter.go:240— pkg/gateway/adapters/prometheus_adapter.go:240-252 | pkg/gateway/adapters/prometheus_adapter.go:317-329 — 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 lines × 2) pkg/gateway/middleware/alertmanager_freshness.go:125— pkg/gateway/middleware/alertmanager_freshness.go:125-137 | pkg/gateway/middleware/event_freshness.go:77-89 — 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 (13 lines × 2) pkg/notification/audit/manager.go:284— pkg/notification/audit/manager.go:284-296 | pkg/notification/audit/manager.go:344-356 — 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.
Duplicated block (13 lines × 2) internal/kubernautagent/alignment/observer.go:201— internal/kubernautagent/alignment/observer.go:201-213 | internal/kubernautagent/alignment/observer.go:267-279 — 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 `internal/kubernautagent/alignment/observer.go:201` 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (12 lines × 2) docs/architecture/spikes/hitl-permission/main.go:311— docs/architecture/spikes/hitl-permission/main.go:311-322 | docs/architecture/spikes/hitl-permission/main.go:469-480 — 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.
Duplicated block (12 lines × 2) docs/architecture/spikes/run-state-persistence/main.go:217— docs/architecture/spikes/run-state-persistence/main.go:217-228 | docs/architecture/spikes/shadow-acp/main.go:269-280 — 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 (12 lines × 2) internal/controller/remediationorchestrator/notification_creation.go:182— internal/controller/remediationorchestrator/notification_creation.go:182-193 | pkg/remediationorchestrator/handler/aianalysis.go:81-92 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Check import visibility before settling on that home: `internal/controller/remediationorchestrator/notification_creation.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
Duplicated block (12 lines × 2) internal/kubernautagent/audit/ds_payloads.go:307— internal/kubernautagent/audit/ds_payloads.go:307-318 | internal/kubernautagent/audit/ds_payloads.go:325-336 — 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 `internal/kubernautagent/audit/ds_payloads.go:307` 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 (12 lines × 2) pkg/apifrontend/tools/af_alerts.go:226— pkg/apifrontend/tools/af_alerts.go:226-237 | pkg/apifrontend/tools/af_alerts.go:319-330 — 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 `pkg/apifrontend/tools/af_alerts.go:226` 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 (12 lines × 2) pkg/workflowexecution/audit/manager.go:415— pkg/workflowexecution/audit/manager.go:415-426 | pkg/workflowexecution/audit/manager.go:598-609 — 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 `pkg/workflowexecution/audit/manager.go:415` 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. 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 (12 lines × 2) pkg/authwebhook/actiontype_handler.go:68— pkg/authwebhook/actiontype_handler.go:68-79 | pkg/authwebhook/remediationworkflow_handler.go:119-130 — 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 (12 lines × 2) pkg/fleet/mcpclient/reader_factory.go:64— pkg/fleet/mcpclient/reader_factory.go:64-75 | pkg/workflowexecution/executor/client_factory.go:125-136 — 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 (12 lines × 2) pkg/aianalysis/rego/evaluator.go:398— pkg/aianalysis/rego/evaluator.go:398-414 | pkg/signalprocessing/evaluator/evaluator.go:170-181 — 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 `pkg/aianalysis/rego/evaluator.go:398` 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. 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 (12 lines × 2) pkg/audit/store.go:472— pkg/audit/store.go:472-484 | pkg/audit/store.go:536-547 — 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 `pkg/audit/store.go:472` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: `pkg/audit/store.go:472` is reached only past a guard at line 461 that tests `state.batch` and leaves the function early, and `pkg/audit/store.go:536` reads `state.batch` with no such check. What separates these copies is not which lines they run but which PRECONDITION they enforce, so one of them is operating on state the other one refuses. Decide which is intended BEFORE unifying them — extract the shared part and whichever copy is missing the check keeps running unchecked, and if the guard is the correct behaviour then that hole is already live.
Duplicated block (12 lines × 2) internal/controller/notification/notificationrequest_controller.go:512— internal/controller/notification/notificationrequest_controller.go:512-524 | internal/controller/notification/notificationrequest_controller.go:567-578 — 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 `internal/controller/notification/notificationrequest_controller.go:512` 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 (12 lines × 2) pkg/authwebhook/remediationrequest_handler.go:140— pkg/authwebhook/remediationrequest_handler.go:140-151 | pkg/authwebhook/workflowexecution_handler.go:123-134 — 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 `pkg/authwebhook/remediationrequest_handler.go:140` 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. 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.
TooManyMethods: Investigator internal/kubernautagent/investigator/investigator.go:300— TooManyMethods — 123 methods, declared across 15 files: investigator/investigator.go (20), investigator/investigator_loop.go (18), investigator/investigator_gates.go (15), investigator/investigator_workflow_selection.go (12), +11 more file(s). The bar is 30 methods; this is 93 over it, 4.10× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Reconciler internal/controller/remediationorchestrator/reconciler.go:70— TooManyMethods — 119 methods, declared across 16 files: remediationorchestrator/reconciler_callbacks.go (18), remediationorchestrator/audit_events.go (14), remediationorchestrator/config_accessors.go (12), remediationorchestrator/terminal_transitions.go (11), +12 more file(s). The bar is 30 methods; this is 89 over it, 3.97× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Server pkg/datastorage/server/server.go:54— TooManyMethods — 63 methods, declared across 12 files: server/audit_events_handler.go (11), server/audit_events_batch_handler.go (8), server/handlers.go (8), server/server_lifecycle.go (8), +8 more file(s). The bar is 30 methods; this is 33 over it, 2.10× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Reconciler internal/controller/effectivenessmonitor/reconciler.go:62— TooManyMethods — 60 methods, declared across 11 files: effectivenessmonitor/events.go (12), effectivenessmonitor/reconcile_components.go (10), effectivenessmonitor/completion.go (9), effectivenessmonitor/target_resources.go (7), +7 more file(s). The bar is 30 methods; this is 30 over it, 2.00× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: WorkflowExecutionReconciler internal/controller/workflowexecution/workflowexecution_controller.go:104— TooManyMethods — 57 methods, declared across 7 files: workflowexecution/workflowexecution_lifecycle.go (14), workflowexecution/workflowexecution_pending.go (12), workflowexecution/workflowexecution_status_marking.go (11), workflowexecution/workflowexecution_controller.go (8), +3 more file(s). The bar is 30 methods; this is 27 over it, 1.90× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Server pkg/gateway/server.go:123— TooManyMethods — 48 methods, declared across 7 files: gateway/server.go (18), gateway/signal_ingestion.go (10), gateway/audit_emission.go (5), gateway/server_constructors.go (4), +3 more file(s). The bar is 30 methods; this is 18 over it, 1.60× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: NotificationRequestReconciler internal/controller/notification/notificationrequest_controller.go:53— TooManyMethods — 47 methods, declared across 3 files: notification/notificationrequest_controller.go (31), notification/retry_circuit_breaker_handler.go (8), notification/routing_handler.go (8). The bar is 30 methods; this is 17 over it, 1.57× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Manager internal/kubernautagent/session/manager.go:75— TooManyMethods — 45 methods, declared across 4 files: session/manager_query.go (17), session/manager.go (11), session/manager_interactive.go (9), session/manager_events.go (8). The bar is 30 methods; this is 15 over it, 1.50× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: InvestigateTool internal/kubernautagent/mcp/tools/investigate.go:296— TooManyMethods — 43 methods, declared across 5 files: tools/investigate_autonomous.go (11), tools/investigate_start.go (11), tools/investigate_discovery.go (10), tools/investigate.go (6), +1 more file(s). The bar is 30 methods; this is 13 over it, 1.43× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Dispatcher internal/kubernautagent/agentsession/dispatcher.go:117— TooManyMethods — 34 methods, declared across 2 files: agentsession/dispatcher.go (30), agentsession/status_writer.go (4). The bar is 30 methods; this is 4 over it, 1.13× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SignalProcessingReconciler internal/controller/signalprocessing/signalprocessing_controller.go:65— TooManyMethods — 32 methods, declared across 6 files: signalprocessing/signalprocessing_controller.go (9), signalprocessing/signalprocessing_classifying.go (8), signalprocessing/signalprocessing_enriching.go (6), signalprocessing/signalprocessing_categorizing.go (5), +2 more file(s). The bar is 30 methods; this is 2 over it, 1.07× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×11
Edited copy of a member (11 corresponding lines) cmd/apifrontend/backend_deps.go:712— cmd/apifrontend/backend_deps.go:712-722 | cmd/signalprocessing/main.go:463-479 — 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.
Edited copy of a member (11 corresponding lines) pkg/apifrontend/handler/status_handler.go:214— pkg/apifrontend/handler/status_handler.go:214-224 | pkg/apifrontend/handler/status_handler.go:356-369 — 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.
Edited copy of a member (11 corresponding lines) pkg/datastorage/reconstruction/query.go:339— pkg/datastorage/reconstruction/query.go:339-349 | pkg/datastorage/reconstruction/query.go:361-371 — 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.
Edited copy of a member (11 corresponding lines) internal/kubernautagent/investigator/investigator_gates.go:878— internal/kubernautagent/investigator/investigator_gates.go:878-888 | internal/kubernautagent/investigator/investigator_gates.go:1038-1048 — 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.
Edited copy of a member (11 corresponding lines) internal/kubernautagent/mcp/tools/agentsession_checker.go:46— internal/kubernautagent/mcp/tools/agentsession_checker.go:46-57 | internal/kubernautagent/mcp/tools/rr_checker.go:42-52 — 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.
Edited copy of a member (11 corresponding lines) pkg/apifrontend/audit/store_adapter.go:516— pkg/apifrontend/audit/store_adapter.go:516-526 | pkg/apifrontend/audit/store_adapter.go:528-538 — 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.
Edited copy of a member (11 corresponding lines) internal/kubernautagent/audit/ds_payloads.go:389— internal/kubernautagent/audit/ds_payloads.go:389-399 | internal/kubernautagent/audit/ds_payloads.go:528-538 — 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.
Edited copy of a member (11 corresponding lines) pkg/kubernautagent/llm/transport/resolver.go:45— pkg/kubernautagent/llm/transport/resolver.go:45-55 | pkg/shared/types/llm.go:431-441 — 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.
Edited copy of a member (11 corresponding lines) pkg/fleet/registry/eaigw_registry.go:262— pkg/fleet/registry/eaigw_registry.go:262-272 | pkg/fleet/registry/kuadrant_registry.go:153-163 — 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.
Edited copy of a member (11 corresponding lines) internal/kubernautagent/mcp/notification_bus.go:76— internal/kubernautagent/mcp/notification_bus.go:76-86 | internal/kubernautagent/mcp/timeout_manager.go:149-160 — 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.
Edited copy of a member (11 corresponding lines) pkg/apifrontend/launcher/part_converter.go:338— pkg/apifrontend/launcher/part_converter.go:338-348 | pkg/apifrontend/session/reinvoke.go:175-185 — 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 (10 corresponding lines) · ×11
Edited copy of a member (10 corresponding lines) pkg/http/cors/cors.go:130— pkg/http/cors/cors.go:130-139 | pkg/http/cors/cors.go:165-174 — 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) pkg/aianalysis/handlers/request_builder.go:135— pkg/aianalysis/handlers/request_builder.go:135-144 | internal/kubernautagent/agentsession/mapping.go:395-404 — 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) pkg/fleet/mcpclient/client.go:163— pkg/fleet/mcpclient/client.go:163-172 | pkg/fleet/mcpclient/writer.go:58-67 — 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) pkg/apifrontend/tools/discover_cache.go:29— pkg/apifrontend/tools/discover_cache.go:29-38 | pkg/signalprocessing/cache/cache.go:57-66 — 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) pkg/apifrontend/severity/triage.go:95— pkg/apifrontend/severity/triage.go:95-109 | pkg/apifrontend/launcher/streaming_executor.go:57-66 — 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) internal/kubernautagent/prompt/builder.go:427— internal/kubernautagent/prompt/builder.go:427-436 | pkg/apifrontend/tools/af_alerts.go:361-370 — 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) cmd/aianalysis/main.go:70— cmd/aianalysis/main.go:70-82 | cmd/workflowexecution/main.go:73-82 — 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) internal/kubernautagent/audit/ds_response_mapping.go:204— internal/kubernautagent/audit/ds_response_mapping.go:204-213 | pkg/apifrontend/launcher/part_converter.go:545-555 — 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) internal/controller/notification/routing_handler.go:131— internal/controller/notification/routing_handler.go:131-141 | pkg/apifrontend/auth/jwt.go:427-436 — 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) pkg/notification/phase/manager.go:105— pkg/notification/phase/manager.go:105-114 | pkg/remediationorchestrator/phase/manager.go:48-57 — 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) internal/kubernautagent/mcp/session_manager.go:195— internal/kubernautagent/mcp/session_manager.go:195-206 | pkg/datastorage/repository/audit_events_repository.go:252-261 — 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.
Duplicated block (14 lines × 2) cmd/aianalysis/main.go:165— cmd/aianalysis/main.go:165-178 | cmd/signalprocessing/main.go:166-179 — 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 `cmd/aianalysis/main.go:165` 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) internal/kubernautagent/llm/transport/oauth2_credentials.go:44— internal/kubernautagent/llm/transport/oauth2_credentials.go:44-57 | pkg/fleet/mcpclient/auth.go:45-58 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Check import visibility before settling on that home: `internal/kubernautagent/llm/transport/oauth2_credentials.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
Duplicated block (14 lines × 2) internal/kubernautagent/mcp/tools/select_workflow.go:148— internal/kubernautagent/mcp/tools/select_workflow.go:148-161 | pkg/apifrontend/tools/ka_tools.go:310-323 — 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 `internal/kubernautagent/mcp/tools/select_workflow.go:148` 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. 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. Check import visibility before settling on that home: `internal/kubernautagent/mcp/tools/select_workflow.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/kubernautagent/mcp/tools/select_workflow.go:164` calls `actingUserOverride` and `pkg/apifrontend/tools/ka_tools.go:326` 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 (14 lines × 2) internal/kubernautagent/session/manager_interactive.go:194— internal/kubernautagent/session/manager_interactive.go:194-207 | internal/kubernautagent/session/manager_interactive.go:248-261 — 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.
Duplicated block (14 lines × 2) pkg/apifrontend/ratelimit/ratelimit.go:35— pkg/apifrontend/ratelimit/ratelimit.go:35-48 | pkg/datastorage/server/middleware/ratelimit.go:64-77 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (14 lines × 2) pkg/datastorage/repository/sql/builder.go:201— pkg/datastorage/repository/sql/builder.go:201-214 | pkg/datastorage/repository/sql/builder.go:254-267 — 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.
Duplicated block (14 lines × 2) pkg/fleet/registry/eaigw_registry.go:314— pkg/fleet/registry/eaigw_registry.go:314-327 | pkg/fleet/registry/kuadrant_registry.go:233-246 — before extracting anything, compare `pkg/fleet/registry/eaigw_registry.go` and `pkg/fleet/registry/kuadrant_registry.go` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 114 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 `pkg/fleet/registry/eaigw_registry.go:314` 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) pkg/remediationapprovalrequest/conditions.go:101— pkg/remediationapprovalrequest/conditions.go:101-114 | pkg/remediationrequest/conditions.go:149-162 — `pkg/remediationapprovalrequest/conditions.go` and `pkg/remediationrequest/conditions.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 30 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (14 lines × 2) pkg/datastorage/dlq/client.go:209— pkg/datastorage/dlq/client.go:209-222 | pkg/datastorage/dlq/client.go:267-280 — 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 `pkg/datastorage/dlq/client.go:209` 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 (14 lines × 2) pkg/apifrontend/policyread/kubernetes_sources.go:210— pkg/apifrontend/policyread/kubernetes_sources.go:210-223 | pkg/apifrontend/policyread/kubernetes_sources.go:237-250 — 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 `pkg/apifrontend/policyread/kubernetes_sources.go:210` 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.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×9
Edited copy of a member (20 corresponding lines) internal/kubernautagent/investigator/investigator_audit.go:49— internal/kubernautagent/investigator/investigator_audit.go:49-68 | internal/kubernautagent/investigator/investigator_audit.go:83-102 — These two members are one piece of code written twice and then edited apart: 20 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 (20 corresponding lines) pkg/fleet/mcpclient/resilience.go:276— pkg/fleet/mcpclient/resilience.go:276-295 | pkg/fleet/mcpclient/resilience.go:298-317 — These two members are one piece of code written twice and then edited apart: 20 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 (20 corresponding lines) pkg/remediationorchestrator/handler/aianalysis.go:445— pkg/remediationorchestrator/handler/aianalysis.go:445-464 | pkg/remediationorchestrator/handler/aianalysis.go:544-569 — These two members are one piece of code written twice and then edited apart: 20 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 (20 corresponding lines) internal/controller/effectivenessmonitor/completion.go:35— internal/controller/effectivenessmonitor/completion.go:35-55 | internal/controller/effectivenessmonitor/completion.go:89-108 — These two members are one piece of code written twice and then edited apart: 20 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 (20 corresponding lines) pkg/datastorage/audit/config_reload_event.go:39— pkg/datastorage/audit/config_reload_event.go:39-58 | pkg/datastorage/audit/config_reload_event.go:63-87 — These two members are one piece of code written twice and then edited apart: 20 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 (20 corresponding lines) cmd/apifrontend/backend_deps.go:787— cmd/apifrontend/backend_deps.go:787-806 | cmd/kubernautagent/llm_builder.go:48-74 — These two members are one piece of code written twice and then edited apart: 20 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 (20 corresponding lines) cmd/notification/main.go:810— cmd/notification/main.go:810-831 | cmd/workflowexecution/main.go:439-458 — These two members are one piece of code written twice and then edited apart: 20 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 (20 corresponding lines) pkg/kubernautagent/tools/logs/fetch_pod_logs.go:200— pkg/kubernautagent/tools/logs/fetch_pod_logs.go:200-219 | pkg/kubernautagent/tools/logs/fetch_pod_logs.go:221-240 — These two members are one piece of code written twice and then edited apart: 20 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 (20 corresponding lines) pkg/apifrontend/handler/status_handler.go:445— pkg/apifrontend/handler/status_handler.go:445-467 | pkg/apifrontend/handler/status_handler.go:469-488 — These two members are one piece of code written twice and then edited apart: 20 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) · ×9
Edited copy of a member (17 corresponding lines) internal/kubernautagent/audit/ds_payloads.go:304— internal/kubernautagent/audit/ds_payloads.go:304-320 | internal/kubernautagent/audit/ds_payloads.go:322-338 — 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.
Edited copy of a member (17 corresponding lines) pkg/fleet/mcpclient/discover.go:77— pkg/fleet/mcpclient/discover.go:77-100 | pkg/fleet/mcpclient/discover.go:147-163 — 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.
Edited copy of a member (17 corresponding lines) pkg/datastorage/server/remediation_history_logic.go:341— pkg/datastorage/server/remediation_history_logic.go:341-357 | pkg/datastorage/server/remediation_history_logic.go:483-499 — 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.
Edited copy of a member (17 corresponding lines) pkg/fleet/registry/eaigw_registry.go:96— pkg/fleet/registry/eaigw_registry.go:96-112 | pkg/fleet/registry/kuadrant_registry.go:58-74 — 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.
Edited copy of a member (17 corresponding lines) pkg/gateway/http_errors.go:56— pkg/gateway/http_errors.go:56-83 | pkg/gateway/middleware/content_type.go:48-64 — 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.
Edited copy of a member (17 corresponding lines) pkg/effectivenessmonitor/startup/readiness.go:91— pkg/effectivenessmonitor/startup/readiness.go:91-107 | pkg/effectivenessmonitor/startup/readiness.go:113-129 — 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.
Edited copy of a member (17 corresponding lines) pkg/aianalysis/handlers/generated_helpers.go:54— pkg/aianalysis/handlers/generated_helpers.go:54-70 | pkg/apifrontend/auth/jwt.go:447-463 — 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.
Edited copy of a member (17 corresponding lines) pkg/apifrontend/auth/jwt.go:292— pkg/apifrontend/auth/jwt.go:292-308 | pkg/apifrontend/auth/jwt.go:310-326 — 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.
Edited copy of a member (17 corresponding lines) pkg/datastorage/models/workflow_labels.go:201— pkg/datastorage/models/workflow_labels.go:201-217 | pkg/shared/types/enrichment.go:221-238 — 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 (14 corresponding lines) · ×9
Edited copy of a member (14 corresponding lines) pkg/kubernautagent/llm/instrumented_client.go:63— pkg/kubernautagent/llm/instrumented_client.go:63-81 | pkg/kubernautagent/llm/instrumented_client.go:84-97 — These two members are one piece of code written twice and then edited apart: 14 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 (14 corresponding lines) pkg/shared/types/typed_parameter.go:698— pkg/shared/types/typed_parameter.go:698-711 | pkg/shared/types/typed_parameter.go:713-726 — These two members are one piece of code written twice and then edited apart: 14 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 (14 corresponding lines) pkg/apifrontend/ratelimit/ratelimit.go:207— pkg/apifrontend/ratelimit/ratelimit.go:207-220 | pkg/apifrontend/ratelimit/ratelimit.go:264-277 — These two members are one piece of code written twice and then edited apart: 14 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 (14 corresponding lines) internal/kubernautagent/server/ratelimit.go:111— internal/kubernautagent/server/ratelimit.go:111-124 | internal/kubernautagent/server/user_ratelimit.go:83-96 — These two members are one piece of code written twice and then edited apart: 14 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 (14 corresponding lines) pkg/fleet/mcpclient/auth.go:110— pkg/fleet/mcpclient/auth.go:110-123 | pkg/fleet/mcpclient/reloadable_auth.go:220-237 — These two members are one piece of code written twice and then edited apart: 14 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 (14 corresponding lines) cmd/effectivenessmonitor/main.go:219— cmd/effectivenessmonitor/main.go:219-232 | cmd/workflowexecution/main.go:346-365 — These two members are one piece of code written twice and then edited apart: 14 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 (14 corresponding lines) pkg/shared/hash/configmap.go:92— pkg/shared/hash/configmap.go:92-105 | pkg/shared/hash/configmap.go:150-163 — These two members are one piece of code written twice and then edited apart: 14 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 (14 corresponding lines) pkg/apifrontend/agent/root.go:522— pkg/apifrontend/agent/root.go:522-535 | pkg/apifrontend/handler/mcp_bridge.go:835-848 — These two members are one piece of code written twice and then edited apart: 14 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 (14 corresponding lines) cmd/gateway/main.go:125— cmd/gateway/main.go:125-138 | cmd/notification/main.go:202-219 — These two members are one piece of code written twice and then edited apart: 14 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· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×8
Members sharing a duplicated core (4 members, 50+ identical tokens) cmd/effectivenessmonitor/main.go:322— cmd/effectivenessmonitor/main.go:322-342 | cmd/notification/main.go:432-452 | cmd/remediationorchestrator/main.go:347-397 | cmd/workflowexecution/main.go:370-402 — These 4 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 4 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 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) internal/kubernautagent/server/ratelimit.go:126— internal/kubernautagent/server/ratelimit.go:126-144 | internal/kubernautagent/server/user_ratelimit.go:98-116 | pkg/apifrontend/ratelimit/ratelimit.go:83-101 | pkg/datastorage/server/middleware/ratelimit.go:101-119 — These 4 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 4 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 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) pkg/aianalysis/audit/audit.go:222— pkg/aianalysis/audit/audit.go:222-257 | pkg/aianalysis/audit/audit.go:337-381 | pkg/aianalysis/audit/audit.go:545-567 | pkg/aianalysis/audit/audit.go:576-603 — These 4 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 4 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 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) pkg/aianalysis/status/manager.go:61— pkg/aianalysis/status/manager.go:61-82 | pkg/remediationorchestrator/status/manager.go:66-86 | pkg/signalprocessing/status/manager.go:80-101 | pkg/workflowexecution/status/manager.go:58-77 — These 4 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 4 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 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) pkg/authwebhook/config/config.go:97— pkg/authwebhook/config/config.go:97-114 | pkg/fleet/fmc/config/config.go:153-170 | pkg/gateway/config/config.go:438-465 | pkg/workflowexecution/config/config.go:213-230 — These 4 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 4 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 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) pkg/datastorage/dlq/client.go:200— pkg/datastorage/dlq/client.go:200-244 | pkg/datastorage/dlq/client.go:249-302 | pkg/datastorage/dlq/client_consumer.go:243-287 | pkg/datastorage/dlq/client_consumer.go:293-337 — These 4 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 4 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 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) pkg/signalprocessing/audit/client.go:221— pkg/signalprocessing/audit/client.go:221-259 | pkg/signalprocessing/audit/client.go:390-449 | pkg/signalprocessing/audit/client.go:452-500 | pkg/signalprocessing/audit/client.go:503-540 — These 4 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 4 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 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) pkg/workflowexecution/audit/manager.go:212— pkg/workflowexecution/audit/manager.go:212-278 | pkg/workflowexecution/audit/manager.go:297-355 | pkg/workflowexecution/audit/manager.go:437-518 | pkg/workflowexecution/audit/manager.go:702-770 — These 4 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 4 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 4 times.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×8
Edited copy of a member (15 corresponding lines) pkg/gateway/adapters/prometheus_adapter.go:391— pkg/gateway/adapters/prometheus_adapter.go:391-405 | pkg/gateway/adapters/prometheus_adapter.go:417-434 — 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.
Edited copy of a member (15 corresponding lines) pkg/fleet/registry/eaigw_registry.go:154— pkg/fleet/registry/eaigw_registry.go:154-168 | pkg/fleet/registry/kuadrant_registry.go:112-126 — 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.
Edited copy of a member (15 corresponding lines) pkg/apifrontend/audit/store_adapter.go:434— pkg/apifrontend/audit/store_adapter.go:434-448 | pkg/apifrontend/audit/store_adapter.go:450-466 — 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.
Edited copy of a member (15 corresponding lines) internal/kubernautagent/alignment/llmproxy.go:41— internal/kubernautagent/alignment/llmproxy.go:41-57 | internal/kubernautagent/alignment/llmproxy.go:61-75 — 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.
Edited copy of a member (15 corresponding lines) internal/kubernautagent/mcp/tools/select_workflow.go:758— internal/kubernautagent/mcp/tools/select_workflow.go:758-773 | pkg/aianalysis/handlers/response_processor.go:640-654 — 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.
Edited copy of a member (15 corresponding lines) pkg/gateway/server_constructors.go:710— pkg/gateway/server_constructors.go:710-728 | pkg/gateway/server_constructors.go:734-748 — 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.
Edited copy of a member (15 corresponding lines) pkg/datastorage/repository/audit_events_hashchain.go:94— pkg/datastorage/repository/audit_events_hashchain.go:94-110 | pkg/datastorage/repository/audit_events_hashchain.go:120-134 — 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.
Edited copy of a member (15 corresponding lines) pkg/apifrontend/agent/phase_guard.go:867— pkg/apifrontend/agent/phase_guard.go:867-881 | pkg/apifrontend/launcher/completion_coordinator.go:138-152 — 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.
Duplicated block (15 lines × 2) cmd/gateway/main.go:632— cmd/gateway/main.go:632-646 | cmd/kubernautagent/bootstrap.go:648-662 — 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 `cmd/gateway/main.go:632` 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) cmd/notification/main.go:779— cmd/notification/main.go:779-793 | cmd/workflowexecution/main.go:697-711 — 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 `cmd/notification/main.go:779` 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 (15 lines × 2) pkg/apifrontend/severity/llm.go:85— pkg/apifrontend/severity/llm.go:85-99 | pkg/apifrontend/severity/openai_compatible.go:84-98 — 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 `pkg/apifrontend/severity/llm.go:85` 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. 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 (15 lines × 2) pkg/kubernautagent/types/evidence.go:133— pkg/kubernautagent/types/evidence.go:133-147 | pkg/kubernautagent/types/evidence.go:150-164 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) pkg/remediationorchestrator/routing/blocking.go:251— pkg/remediationorchestrator/routing/blocking.go:251-265 | pkg/remediationorchestrator/routing/blocking.go:312-326 — 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 (15 lines × 2) pkg/shared/k8s/ownerchain/owner_resolver.go:67— pkg/shared/k8s/ownerchain/owner_resolver.go:67-81 | pkg/shared/scope/manager.go:86-100 — 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 (15 lines × 2) pkg/shared/types/typed_parameter.go:206— pkg/shared/types/typed_parameter.go:206-220 | pkg/shared/types/typed_parameter.go:299-313 — 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 `pkg/shared/types/typed_parameter.go:206` 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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/shared/types/typed_parameter.go:221` calls `IsNaN`, `IsInf`, `Errorf` and `pkg/shared/types/typed_parameter.go:314` 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 (15 lines × 2) pkg/remediationorchestrator/handler/aianalysis.go:332— pkg/remediationorchestrator/handler/aianalysis.go:332-348 | pkg/remediationorchestrator/handler/aianalysis.go:394-408 — 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 `pkg/remediationorchestrator/handler/aianalysis.go:332` 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 (5 lines × 2) internal/controller/workflowexecution/workflowexecution_pending.go:131— internal/controller/workflowexecution/workflowexecution_pending.go:131-135 | internal/controller/workflowexecution/workflowexecution_pending.go:139-143 — 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 `internal/controller/workflowexecution/workflowexecution_pending.go:131` 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. 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 (5 lines × 2) internal/kubernautagent/enrichment/enricher.go:154— internal/kubernautagent/enrichment/enricher.go:154-163 | internal/kubernautagent/tools/custom/resource_context.go:173-177 — 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 `internal/kubernautagent/enrichment/enricher.go:154` 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. 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 (5 lines × 2) internal/kubernautagent/enrichment/enricher.go:751— internal/kubernautagent/enrichment/enricher.go:751-755 | internal/kubernautagent/enrichment/enricher.go:785-789 — 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 `internal/kubernautagent/enrichment/enricher.go:751` 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 after the matched lines, `internal/kubernautagent/enrichment/enricher.go:793` calls `enrichmentFailureCode` and `internal/kubernautagent/enrichment/enricher.go:756` 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 (5 lines × 2) pkg/apifrontend/handler/mcp_bridge.go:592— pkg/apifrontend/handler/mcp_bridge.go:592-598 | pkg/apifrontend/handler/mcp_bridge.go:640-644 — 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 `pkg/apifrontend/handler/mcp_bridge.go:592` 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. 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 (5 lines × 2) pkg/notification/delivery/orchestrator.go:689— pkg/notification/delivery/orchestrator.go:689-693 | pkg/notification/delivery/orchestrator.go:703-707 — 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 `pkg/notification/delivery/orchestrator.go:689` 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) pkg/workflowexecution/executor/job.go:365— pkg/workflowexecution/executor/job.go:365-369 | pkg/workflowexecution/executor/job.go:507-511 — 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 `pkg/workflowexecution/executor/job.go:365` 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. 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 (5 lines × 2) pkg/apifrontend/handler/status_handler.go:97— pkg/apifrontend/handler/status_handler.go:97-101 | pkg/datastorage/server/server.go:177-181 — 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 (5 lines × 2) pkg/workflowexecution/executor/job.go:896— pkg/workflowexecution/executor/job.go:896-900 | pkg/workflowexecution/executor/tekton.go:193-197 — 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.
Low cohesion: Config (LCOM4 6) pkg/apifrontend/config/config.go:25— Config's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: MockMCPClient (LCOM4 6) pkg/apifrontend/ka/mcp_client.go:39— MockMCPClient's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ServerConfig (LCOM4 6) pkg/datastorage/config/config.go:85— ServerConfig's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: RemediationRequestStatus (LCOM4 5) api/remediation/v1alpha1/remediationrequest_types.go:459— RemediationRequestStatus's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: AIAnalysisStatus (LCOM4 4) api/aianalysis/v1alpha1/aianalysis_types.go:366— AIAnalysisStatus's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: WorkflowExecutionReconciler (LCOM4 4) internal/controller/workflowexecution/workflowexecution_controller.go:104— WorkflowExecutionReconciler's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Metrics (LCOM4 4) pkg/fleet/registry/metrics.go:35— Metrics's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Redactor (LCOM4 4) REDACTED:12— Redactor's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
ClassTooLong: NotificationRequestReconciler internal/controller/notification/notificationrequest_controller.go:53— ClassTooLong — 623 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods, 32 blocks, lines 53-1449. The bar is 400 significant lines; this is 223 over it, 1.56× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: NotificationCreator pkg/remediationorchestrator/creator/notification.go:74— ClassTooLong — 571 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods, 27 blocks, lines 74-1348. The bar is 400 significant lines; this is 171 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Dispatcher internal/kubernautagent/agentsession/dispatcher.go:117— ClassTooLong — 503 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods, 31 blocks, lines 117-1159. The bar is 400 significant lines; this is 103 over it, 1.26× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Investigator internal/kubernautagent/investigator/investigator.go:300— ClassTooLong — 500 significant lines (blank, comment-only and punctuation-only lines excluded), 123 methods, 21 blocks, lines 300-1471. The bar is 400 significant lines; this is 100 over it, 1.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: RoutingEngine pkg/remediationorchestrator/routing/blocking.go:92— ClassTooLong — 497 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods, 25 blocks, lines 92-1372. The bar is 400 significant lines; this is 97 over it, 1.24× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Manager pkg/remediationorchestrator/audit/manager.go:108— ClassTooLong — 467 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods, 17 blocks, lines 108-1066. The bar is 400 significant lines; this is 67 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ResponseProcessor pkg/aianalysis/handlers/response_processor.go:68— ClassTooLong — 440 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods, 21 blocks, lines 68-1186. The bar is 400 significant lines; this is 40 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×7
Edited copy of a member (22 corresponding lines) internal/controller/remediationorchestrator/audit_events.go:256— internal/controller/remediationorchestrator/audit_events.go:256-277 | internal/controller/remediationorchestrator/audit_events.go:280-301 — These two members are one piece of code written twice and then edited apart: 22 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 (22 corresponding lines) internal/kubernautagent/agentsession/dispatcher.go:716— internal/kubernautagent/agentsession/dispatcher.go:716-737 | internal/kubernautagent/agentsession/dispatcher.go:1045-1066 — These two members are one piece of code written twice and then edited apart: 22 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 (22 corresponding lines) internal/controller/remediationorchestrator/reconcile_loop.go:433— internal/controller/remediationorchestrator/reconcile_loop.go:433-454 | internal/controller/remediationorchestrator/reconcile_loop.go:456-477 — These two members are one piece of code written twice and then edited apart: 22 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 (22 corresponding lines) pkg/apifrontend/session/service.go:591— pkg/apifrontend/session/service.go:591-612 | pkg/apifrontend/session/service.go:741-762 — These two members are one piece of code written twice and then edited apart: 22 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 (22 corresponding lines) internal/kubernautagent/session/manager_query.go:101— internal/kubernautagent/session/manager_query.go:101-122 | internal/kubernautagent/session/manager_query.go:133-160 — These two members are one piece of code written twice and then edited apart: 22 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 (22 corresponding lines) pkg/apifrontend/severity/anthropic.go:65— pkg/apifrontend/severity/anthropic.go:65-86 | pkg/apifrontend/severity/llm.go:46-67 — These two members are one piece of code written twice and then edited apart: 22 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 (22 corresponding lines) pkg/remediationorchestrator/metrics/metrics.go:224— pkg/remediationorchestrator/metrics/metrics.go:224-246 | pkg/remediationorchestrator/metrics/metrics.go:251-272 — These two members are one piece of code written twice and then edited apart: 22 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 (12 corresponding lines) · ×7
Edited copy of a member (12 corresponding lines) internal/kubernautagent/enrichment/label_detector.go:271— internal/kubernautagent/enrichment/label_detector.go:271-285 | internal/kubernautagent/enrichment/label_detector.go:484-495 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) pkg/kubernautagent/tools/k8s/jq.go:56— pkg/kubernautagent/tools/k8s/jq.go:56-67 | pkg/kubernautagent/tools/k8s/jq.go:82-93 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) pkg/apifrontend/auth/jwks_cache.go:190— pkg/apifrontend/auth/jwks_cache.go:190-201 | pkg/apifrontend/auth/jwks_cache.go:206-217 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) pkg/apifrontend/severity/types.go:129— pkg/apifrontend/severity/types.go:129-140 | pkg/remediationorchestrator/creator/notification_extensions.go:79-90 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) pkg/fleet/acm/client.go:63— pkg/fleet/acm/client.go:63-74 | pkg/fleet/fmc/http_client.go:83-94 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) internal/kubernautagent/server/ratelimit.go:191— internal/kubernautagent/server/ratelimit.go:191-205 | pkg/gateway/middleware/trusted_realip.go:69-80 — These two members are one piece of code written twice and then edited apart: 12 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 (12 corresponding lines) pkg/datastorage/query/audit_events_builder.go:60— pkg/datastorage/query/audit_events_builder.go:60-73 | pkg/datastorage/server/handler.go:113-124 — These two members are one piece of code written twice and then edited apart: 12 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.
XxxComment test/integration/remediationorchestrator/routing_integration_test.go:74— // BR-RO-XXX: RecentlyRemediated blocking — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
XxxComment test/integration/remediationorchestrator/routing_integration_test.go:147— // BR-GATEWAY-XXX: DuplicateInProgress blocking — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
XxxComment pkg/shared/sanitization/doc.go:73— // - BR-STORAGE-XXX: Log sanitization (pending implementation) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
XxxComment pkg/shared/circuitbreaker/manager.go:67— // - BR-GATEWAY-XXX: K8s API protection (single-resource for Gateway) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
XxxComment pkg/remediationorchestrator/status/manager.go:89— // Satisfies BR-ORCH-XXX: CRD Lifecycle Management — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
XxxComment pkg/aianalysis/status/manager.go:85— // Satisfies BR-AI-XXX: CRD Lifecycle Management — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×6
Edited copy of a member (9 corresponding lines) internal/kubernautagent/investigator/fleet_overlay.go:163— internal/kubernautagent/investigator/fleet_overlay.go:163-171 | internal/kubernautagent/investigator/fleet_overlay.go:177-185 — 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.
Edited copy of a member (9 corresponding lines) pkg/apifrontend/resilience/k8s_dynamic.go:110— pkg/apifrontend/resilience/k8s_dynamic.go:110-118 | pkg/apifrontend/resilience/k8s_dynamic.go:216-224 — 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.
Edited copy of a member (9 corresponding lines) docs/architecture/spikes/shadow-acp/main.go:136— docs/architecture/spikes/shadow-acp/main.go:136-145 | docs/spikes/oas-runtime/internal/acp/server.go: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.
Edited copy of a member (9 corresponding lines) internal/controller/apifrontend/ttl.go:226— internal/controller/apifrontend/ttl.go:226-234 | pkg/apifrontend/session/service.go:322-331 — 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.
Edited copy of a member (9 corresponding lines) pkg/gateway/adapters/kubernetes_event_adapter.go:273— pkg/gateway/adapters/kubernetes_event_adapter.go:273-282 | pkg/gateway/adapters/prometheus_adapter.go:517-525 — 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.
Edited copy of a member (9 corresponding lines) internal/kubernautagent/mcp/tools/investigate.go:461— internal/kubernautagent/mcp/tools/investigate.go:461-469 | pkg/notification/delivery/orchestrator.go:672-681 — 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.
Duplicated block (16 lines × 2) cmd/gateway/main.go:581— cmd/gateway/main.go:581-596 | cmd/notification/main.go:789-804 — 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 `cmd/gateway/main.go:581` 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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `cmd/gateway/main.go:579` calls `EmitConfigReloadAudit` and `cmd/notification/main.go:788` 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 (16 lines × 2) internal/kubernautagent/enrichment/ds_adapter.go:193— internal/kubernautagent/enrichment/ds_adapter.go:193-208 | internal/kubernautagent/enrichment/ds_adapter.go:246-261 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16 lines × 2) internal/kubernautagent/investigator/investigator_audit.go:518— internal/kubernautagent/investigator/investigator_audit.go:518-533 | internal/kubernautagent/investigator/investigator_audit.go:546-561 — 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 `internal/kubernautagent/investigator/investigator_audit.go:518` 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 (16 lines × 2) pkg/fleet/mcpclient/gateway_binding_resolver.go:88— pkg/fleet/mcpclient/gateway_binding_resolver.go:88-103 | pkg/fleet/mcpclient/gateway_binding_resolver.go:134-149 — 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 `pkg/fleet/mcpclient/gateway_binding_resolver.go:88` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: `pkg/fleet/mcpclient/gateway_binding_resolver.go:134` is reached only past a guard at line 128 that tests `r.generations` and leaves the function early, and `pkg/fleet/mcpclient/gateway_binding_resolver.go:88` reads `r.generations` with no such check. What separates these copies is not which lines they run but which PRECONDITION they enforce, so one of them is operating on state the other one refuses. Decide which is intended BEFORE unifying them — extract the shared part and whichever copy is missing the check keeps running unchecked, and if the guard is the correct behaviour then that hole is already live.
Duplicated block (16 lines × 2) pkg/fleet/registry/eaigw_registry.go:175— pkg/fleet/registry/eaigw_registry.go:175-190 | pkg/fleet/registry/kuadrant_registry.go:133-148 — before extracting anything, compare `pkg/fleet/registry/eaigw_registry.go` and `pkg/fleet/registry/kuadrant_registry.go` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 114 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 `pkg/fleet/registry/eaigw_registry.go:175` 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 (16 lines × 2) pkg/kubernautagent/config/headers.go:56— pkg/kubernautagent/config/headers.go:56-71 | pkg/shared/types/llm.go:371-386 — 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 (7 lines × 3) pkg/fleet/registry/eaigw_registry.go:342— pkg/fleet/registry/eaigw_registry.go:342-349 | pkg/fleet/registry/kuadrant_registry.go:219-225 | pkg/fleet/registry/kuadrant_registry.go:261-268 — before extracting anything, compare `pkg/fleet/registry/eaigw_registry.go` and `pkg/fleet/registry/kuadrant_registry.go` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 114 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 `pkg/fleet/registry/eaigw_registry.go:342` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/fleet/registry/eaigw_registry.go:350` calls `NilSafeIncReconcile` and `pkg/fleet/registry/kuadrant_registry.go:226` does not — after which the two agree again for 3 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 (7 lines × 3) pkg/notification/audit/manager.go:182— pkg/notification/audit/manager.go:182-188 | pkg/notification/audit/manager.go:314-320 | pkg/notification/audit/manager.go:375-381 — 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 (7 lines × 3) pkg/shared/auth/composite_auth.go:51— pkg/shared/auth/composite_auth.go:51-57 | pkg/shared/auth/jwt_auth.go:158-164 | pkg/shared/auth/k8s_auth.go:40-46 — 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.
Duplicated block (7 lines × 3) pkg/datastorage/server/audit_events_batch_handler.go:80— pkg/datastorage/server/audit_events_batch_handler.go:80-86 | pkg/datastorage/server/audit_events_handler.go:93-100 | pkg/datastorage/server/audit_handlers.go:60-67 — 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (7 lines × 3) pkg/apifrontend/prometheus/client.go:56— pkg/apifrontend/prometheus/client.go:56-62 | pkg/apifrontend/prometheus/client.go:105-111 | pkg/apifrontend/prometheus/client.go:169-175 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/apifrontend/prometheus/client.go:56` 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (7 lines × 3) pkg/effectivenessmonitor/client/alertmanager_http.go:85— pkg/effectivenessmonitor/client/alertmanager_http.go:85-91 | pkg/effectivenessmonitor/client/prometheus_http.go:114-120 | pkg/fleet/fmc/http_client.go:205-211 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/effectivenessmonitor/client/alertmanager_http.go:85` 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×5
Edited copy of a member (26 corresponding lines) pkg/effectivenessmonitor/client/prometheus_http.go:51— pkg/effectivenessmonitor/client/prometheus_http.go:51-76 | pkg/effectivenessmonitor/client/prometheus_http.go:79-104 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) cmd/gateway/main.go:479— cmd/gateway/main.go:479-505 | cmd/remediationorchestrator/main.go:589-614 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) pkg/apifrontend/tools/kubectl_get.go:128— pkg/apifrontend/tools/kubectl_get.go:128-153 | pkg/apifrontend/tools/kubectl_list.go:82-107 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) pkg/remediationorchestrator/audit/manager.go:269— pkg/remediationorchestrator/audit/manager.go:269-294 | pkg/remediationorchestrator/audit/manager.go:305-330 — These two members are one piece of code written twice and then edited apart: 26 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 (26 corresponding lines) internal/controller/workflowexecution/workflowexecution_lifecycle.go:303— internal/controller/workflowexecution/workflowexecution_lifecycle.go:303-328 | internal/controller/workflowexecution/workflowexecution_lifecycle.go:515-540 — These two members are one piece of code written twice and then edited apart: 26 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 (19 corresponding lines) · ×5
Edited copy of a member (19 corresponding lines) internal/kubernautagent/audit/ds_payloads.go:144— internal/kubernautagent/audit/ds_payloads.go:144-166 | internal/kubernautagent/audit/ds_payloads.go:169-187 — These two members are one piece of code written twice and then edited apart: 19 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 (19 corresponding lines) pkg/fleet/registry/eaigw_registry.go:274— pkg/fleet/registry/eaigw_registry.go:274-292 | pkg/fleet/registry/kuadrant_registry.go:165-184 — These two members are one piece of code written twice and then edited apart: 19 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 (19 corresponding lines) pkg/kubernautagent/tools/k8s/tools.go:353— pkg/kubernautagent/tools/k8s/tools.go:353-376 | pkg/kubernautagent/tools/k8s/tools.go:487-505 — These two members are one piece of code written twice and then edited apart: 19 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 (19 corresponding lines) internal/controller/workflowexecution/workflowexecution_pending.go:83— internal/controller/workflowexecution/workflowexecution_pending.go:83-101 | internal/kubernautagent/agentsession/mapping.go:288-306 — These two members are one piece of code written twice and then edited apart: 19 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 (19 corresponding lines) pkg/apifrontend/session/service.go:473— pkg/apifrontend/session/service.go:473-491 | pkg/apifrontend/session/service.go:567-587 — These two members are one piece of code written twice and then edited apart: 19 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, 25+ corresponding lines) · ×5
Edited copies of one member (3 members, 25+ corresponding lines) cmd/datastorage/main.go:731— cmd/datastorage/main.go:731-764 | cmd/gateway/main.go:560-596 | cmd/workflowexecution/main.go:696-720 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 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.
Edited copies of one member (3 members, 25+ corresponding lines) pkg/aianalysis/status/manager.go:96— pkg/aianalysis/status/manager.go:96-121 | pkg/remediationorchestrator/status/manager.go:100-125 | pkg/workflowexecution/status/manager.go:90-114 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 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.
Edited copies of one member (3 members, 25+ corresponding lines) pkg/apifrontend/severity/anthropic.go:94— pkg/apifrontend/severity/anthropic.go:94-126 | pkg/apifrontend/severity/llm.go:75-99 | pkg/apifrontend/severity/openai_compatible.go:70-98 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 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.
Edited copies of one member (3 members, 25+ corresponding lines) pkg/audit/openapi_client_adapter.go:126— pkg/audit/openapi_client_adapter.go:126-176 | pkg/effectivenessmonitor/client/ds_querier.go:60-88 | pkg/remediationorchestrator/routing/ds_history_adapter.go:60-84 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 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.
Edited copies of one member (3 members, 25+ corresponding lines) pkg/authwebhook/actiontype_audit.go:35— pkg/authwebhook/actiontype_audit.go:35-65 | pkg/authwebhook/agentsession_handler.go:124-148 | pkg/authwebhook/agentsession_handler.go:151-175 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 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 (21 corresponding lines) · ×5
Edited copy of a member (21 corresponding lines) pkg/remediationorchestrator/handler/aianalysis.go:161— pkg/remediationorchestrator/handler/aianalysis.go:161-181 | pkg/remediationorchestrator/handler/aianalysis.go:360-383 — These two members are one piece of code written twice and then edited apart: 21 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 (21 corresponding lines) pkg/apifrontend/launcher/openai/adapter.go:90— pkg/apifrontend/launcher/openai/adapter.go:90-111 | pkg/kubernautagent/llm/openai/client.go:102-122 — These two members are one piece of code written twice and then edited apart: 21 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 (21 corresponding lines) internal/kubernautagent/investigator/investigator_audit.go:516— internal/kubernautagent/investigator/investigator_audit.go:516-536 | internal/kubernautagent/investigator/investigator_audit.go:541-565 — These two members are one piece of code written twice and then edited apart: 21 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 (21 corresponding lines) pkg/kubernautagent/types/evidence.go:233— pkg/kubernautagent/types/evidence.go:233-258 | pkg/kubernautagent/types/evidence.go:262-282 — These two members are one piece of code written twice and then edited apart: 21 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 (21 corresponding lines) pkg/datastorage/config/config_accessors.go:57— pkg/datastorage/config/config_accessors.go:57-77 | pkg/datastorage/config/config_accessors.go:82-102 — These two members are one piece of code written twice and then edited apart: 21 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 (18 corresponding lines) · ×5
Edited copy of a member (18 corresponding lines) internal/kubernautagent/audit/ds_workflow_catalog_payloads.go:73— internal/kubernautagent/audit/ds_workflow_catalog_payloads.go:73-90 | internal/kubernautagent/audit/ds_workflow_catalog_payloads.go:92-111 — These two members are one piece of code written twice and then edited apart: 18 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 (18 corresponding lines) pkg/aianalysis/rego/evaluator.go:390— pkg/aianalysis/rego/evaluator.go:390-414 | pkg/signalprocessing/evaluator/evaluator.go:164-181 — These two members are one piece of code written twice and then edited apart: 18 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 (18 corresponding lines) internal/kubernautagent/agentsession/mapping.go:606— internal/kubernautagent/agentsession/mapping.go:606-623 | pkg/aianalysis/handlers/response_processor.go:659-680 — These two members are one piece of code written twice and then edited apart: 18 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 (18 corresponding lines) internal/kubernautagent/investigator/investigation_metrics.go:203— internal/kubernautagent/investigator/investigation_metrics.go:203-220 | internal/kubernautagent/investigator/token_scope.go:132-149 — These two members are one piece of code written twice and then edited apart: 18 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 (18 corresponding lines) cmd/apifrontend/backend_deps.go:844— cmd/apifrontend/backend_deps.go:844-861 | pkg/apifrontend/launcher/model.go:235-255 — These two members are one piece of code written twice and then edited apart: 18 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 (8 corresponding lines) · ×5
Edited copy of a member (8 corresponding lines) pkg/apifrontend/handler/console_policyread.go:96— pkg/apifrontend/handler/console_policyread.go:96-103 | pkg/apifrontend/handler/console_policyread.go:121-128 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) internal/kubernautagent/audit/ds_response_mapping.go:28— internal/kubernautagent/audit/ds_response_mapping.go:28-35 | pkg/aianalysis/handlers/generated_helpers.go:23-33 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) internal/kubernautagent/audit/ds_response_mapping.go:72— internal/kubernautagent/audit/ds_response_mapping.go:72-79 | pkg/aianalysis/handlers/generated_helpers.go:73-83 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) pkg/apifrontend/agent/checkpoint_tool_filter.go:125— pkg/apifrontend/agent/checkpoint_tool_filter.go:125-132 | pkg/apifrontend/session/reinvoke.go:137-147 — These two members are one piece of code written twice and then edited apart: 8 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 (8 corresponding lines) pkg/apifrontend/agent/checkpoint_tool_filter.go:68— pkg/apifrontend/agent/checkpoint_tool_filter.go:68-75 | pkg/apifrontend/session/reinvoke.go:98-108 — These two members are one piece of code written twice and then edited apart: 8 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 (9 lines × 3) pkg/effectivenessmonitor/audit/manager.go:159— pkg/effectivenessmonitor/audit/manager.go:159-167 | pkg/effectivenessmonitor/audit/manager.go:497-505 | pkg/effectivenessmonitor/audit/manager.go:576-584 — 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 (9 lines × 3) docs/architecture/spikes/hitl-permission/main.go:77— docs/architecture/spikes/hitl-permission/main.go:77-85 | docs/architecture/spikes/run-state-persistence/main.go:91-99 | docs/architecture/spikes/shadow-acp/main.go:90-98 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (9 lines × 3) pkg/notification/delivery/pagerduty.go:73— pkg/notification/delivery/pagerduty.go:73-81 | pkg/notification/delivery/slack.go:75-88 | pkg/notification/delivery/teams.go:65-73 — 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. 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 (9 lines × 3) cmd/aianalysis/main.go:112— cmd/aianalysis/main.go:112-122 | cmd/remediationorchestrator/main.go:113-123 | cmd/signalprocessing/main.go:114-122 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/aianalysis/main.go:112` 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 (9 lines × 3) internal/controller/notification/notificationrequest_controller.go:1165— internal/controller/notification/notificationrequest_controller.go:1165-1174 | internal/controller/notification/notificationrequest_controller.go:1292-1300 | internal/controller/notification/notificationrequest_controller.go:1365-1373 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/controller/notification/notificationrequest_controller.go:1165` 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 (6 lines × 3) docs/architecture/spikes/hitl-permission/main.go:63— docs/architecture/spikes/hitl-permission/main.go:63-68 | docs/architecture/spikes/run-state-persistence/main.go:77-82 | docs/architecture/spikes/shadow-acp/main.go:76-81 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (6 lines × 3) docs/architecture/spikes/hitl-permission/main.go:70— docs/architecture/spikes/hitl-permission/main.go:70-75 | docs/architecture/spikes/run-state-persistence/main.go:84-89 | docs/architecture/spikes/shadow-acp/main.go:83-88 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (6 lines × 3) pkg/remediationorchestrator/creator/aianalysis.go:124— pkg/remediationorchestrator/creator/aianalysis.go:124-130 | pkg/remediationorchestrator/creator/effectivenessassessment.go:186-191 | pkg/remediationorchestrator/creator/signalprocessing.go:121-127 — 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 `pkg/remediationorchestrator/creator/aianalysis.go:124` 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 (6 lines × 3) pkg/aianalysis/status/manager.go:62— pkg/aianalysis/status/manager.go:62-68 | pkg/remediationorchestrator/status/manager.go:67-72 | pkg/signalprocessing/status/manager.go:81-87 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/aianalysis/status/manager.go:62` 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 (6 lines × 3) pkg/effectivenessmonitor/client/alertmanager_http.go:58— pkg/effectivenessmonitor/client/alertmanager_http.go:58-63 | pkg/effectivenessmonitor/client/prometheus_http.go:59-64 | pkg/effectivenessmonitor/client/prometheus_http.go:87-92 — 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.
TooManyFields: InvestigationResult pkg/kubernautagent/types/types.go:78— TooManyFields — 62 stored fields. The bar is 30 stored fields; this is 32 over it, 2.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: RemediationWorkflow pkg/datastorage/models/workflow.go:60— TooManyFields — 41 stored fields beside 4 methods. The bar is 30 stored fields; this is 11 over it, 1.37× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: AuditEvent pkg/datastorage/repository/audit_events_repository.go:146— TooManyFields — 33 stored fields. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Reconciler internal/controller/remediationorchestrator/reconciler.go:70— TooManyFields — 31 stored fields beside 119 methods. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×4
Edited copy of a member (32 corresponding lines) internal/kubernautagent/investigator/investigator_gates.go:845— internal/kubernautagent/investigator/investigator_gates.go:845-876 | internal/kubernautagent/investigator/investigator_gates.go:1000-1036 — These two members are one piece of code written twice and then edited apart: 32 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 (32 corresponding lines) pkg/signalprocessing/enricher/k8s_enricher.go:215— pkg/signalprocessing/enricher/k8s_enricher.go:215-256 | pkg/signalprocessing/enricher/k8s_enricher.go:273-304 — These two members are one piece of code written twice and then edited apart: 32 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 (32 corresponding lines) pkg/apifrontend/tools/crd_tools_session.go:66— pkg/apifrontend/tools/crd_tools_session.go:66-97 | pkg/apifrontend/tools/crd_tools_session.go:208-239 — These two members are one piece of code written twice and then edited apart: 32 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 (32 corresponding lines) pkg/audit/internal_client.go:111— pkg/audit/internal_client.go:111-151 | pkg/datastorage/repository/audit_events_batch.go:116-147 — These two members are one piece of code written twice and then edited apart: 32 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 (33 corresponding lines) · ×4
Edited copy of a member (33 corresponding lines) internal/kubernautagent/mcp/tools/select_workflow.go:125— internal/kubernautagent/mcp/tools/select_workflow.go:125-161 | pkg/apifrontend/tools/ka_tools.go:291-323 — These two members are one piece of code written twice and then edited apart: 33 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 (33 corresponding lines) pkg/fleet/mcpclient/gateway_binding_resolver.go:71— pkg/fleet/mcpclient/gateway_binding_resolver.go:71-103 | pkg/fleet/mcpclient/gateway_binding_resolver.go:105-149 — These two members are one piece of code written twice and then edited apart: 33 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 (33 corresponding lines) cmd/datastorage/main.go:673— cmd/datastorage/main.go:673-705 | cmd/gateway/main.go:612-646 — These two members are one piece of code written twice and then edited apart: 33 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 (33 corresponding lines) pkg/workflowexecution/metrics/metrics.go:106— pkg/workflowexecution/metrics/metrics.go:106-139 | pkg/workflowexecution/metrics/metrics.go:153-185 — These two members are one piece of code written twice and then edited apart: 33 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 (24 corresponding lines) · ×4
Edited copy of a member (24 corresponding lines) internal/kubernautagent/tools/custom/discovery_audit.go:116— internal/kubernautagent/tools/custom/discovery_audit.go:116-139 | internal/kubernautagent/tools/custom/discovery_audit.go:142-166 — These two members are one piece of code written twice and then edited apart: 24 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 (24 corresponding lines) pkg/aianalysis/handlers/investigating.go:665— pkg/aianalysis/handlers/investigating.go:665-693 | pkg/aianalysis/handlers/investigating.go:697-720 — These two members are one piece of code written twice and then edited apart: 24 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 (24 corresponding lines) pkg/apifrontend/policyread/kubernetes_sources.go:200— pkg/apifrontend/policyread/kubernetes_sources.go:200-223 | pkg/apifrontend/policyread/kubernetes_sources.go:227-250 — These two members are one piece of code written twice and then edited apart: 24 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 (24 corresponding lines) pkg/shared/tls/tls.go:393— pkg/shared/tls/tls.go:393-416 | pkg/shared/tls/tls.go:424-450 — These two members are one piece of code written twice and then edited apart: 24 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 (22 lines × 2) cmd/gateway/main.go:480— cmd/gateway/main.go:480-501 | cmd/remediationorchestrator/main.go:590-611 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `cmd/gateway/main.go:502` calls `SetFleetReadinessGate` and `cmd/remediationorchestrator/main.go:612` does not — after which the two agree again for 3 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 (22 lines × 2) pkg/gateway/adapters/prometheus_adapter.go:284— pkg/gateway/adapters/prometheus_adapter.go:284-305 | pkg/gateway/adapters/prometheus_adapter.go:462-483 — 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 `pkg/gateway/adapters/prometheus_adapter.go:284` 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. 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 (22 lines × 2) pkg/gateway/processing/distributed_lock.go:233— pkg/gateway/processing/distributed_lock.go:233-254 | pkg/remediationorchestrator/locking/distributed_lock.go:181-202 — before extracting anything, compare `pkg/gateway/processing/distributed_lock.go` and `pkg/remediationorchestrator/locking/distributed_lock.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/gateway/processing/distributed_lock.go:233` 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. 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 (22 lines × 2) pkg/signalprocessing/config/config.go:200— pkg/signalprocessing/config/config.go:200-221 | pkg/workflowexecution/config/config.go:263-284 — 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 (12 lines × 3) internal/kubernautagent/agentsession/mapping.go:469— internal/kubernautagent/agentsession/mapping.go:469-480 | internal/kubernautagent/investigator/investigator_audit.go:524-535 | internal/kubernautagent/investigator/investigator_audit.go:552-563 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `internal/kubernautagent/investigator/investigator_audit.go:570` calls `applyReviewReasonFields` and `internal/kubernautagent/agentsession/mapping.go:481` 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 × 3) pkg/notification/delivery/pagerduty.go:84— pkg/notification/delivery/pagerduty.go:84-95 | pkg/notification/delivery/slack.go:92-106 | pkg/notification/delivery/teams.go:76-87 — 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 `pkg/notification/delivery/pagerduty.go:84` 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 (12 lines × 3) cmd/aianalysis/main.go:89— cmd/aianalysis/main.go:89-103 | cmd/remediationorchestrator/main.go:90-104 | cmd/signalprocessing/main.go:99-110 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times.
Duplicated block (12 lines × 3) pkg/shared/hash/configmap.go:125— pkg/shared/hash/configmap.go:125-136 | pkg/shared/hash/configmap.go:169-180 | pkg/shared/hash/configmap.go:189-200 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/shared/hash/configmap.go:125` 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. 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 (8 lines × 3) api/actiontype/v1alpha1/description_conversion.go:34— api/actiontype/v1alpha1/description_conversion.go:34-41 | api/remediationworkflow/v1alpha1/description_conversion.go:34-41 | pkg/datastorage/models/workflow_labels.go:250-257 — before extracting anything, compare `api/actiontype/v1alpha1/description_conversion.go` and `api/remediationworkflow/v1alpha1/description_conversion.go` as WHOLE FILES: 82% 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 2 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) cmd/effectivenessmonitor/main.go:365— cmd/effectivenessmonitor/main.go:365-372 | cmd/notification/main.go:551-558 | cmd/remediationorchestrator/main.go:426-433 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/effectivenessmonitor/main.go:365` 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. 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 (8 lines × 3) cmd/apifrontend/backend_deps.go:661— cmd/apifrontend/backend_deps.go:661-668 | cmd/effectivenessmonitor/main.go:530-537 | cmd/remediationorchestrator/main.go:770-777 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/apifrontend/backend_deps.go:661` 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 (8 lines × 3) docs/architecture/spikes/hitl-permission/main.go:658— docs/architecture/spikes/hitl-permission/main.go:658-665 | docs/architecture/spikes/run-state-persistence/main.go:620-627 | docs/architecture/spikes/shadow-acp/main.go:860-867 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `docs/architecture/spikes/hitl-permission/main.go:658` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Change coupling: parser.go ↔ schema.go internal/kubernautagent/parser/parser.go:1— `internal/kubernautagent/parser/parser.go` and `internal/kubernautagent/parser/schema.go` change together 64% of the time (7 of the 11 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). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `9c95e180` feat(types+parser): add Parameters to AlternativeWorkflow (#1169); `d994e764` fix(schema): make api_version required and add EA fallback (#1040); `37083d91` feat(parser): propagate api_version from LLM through parser and respo… — run `git show` on any of them.
Change coupling: investigator_rca.go ↔ investigator_workflow_selection.go internal/kubernautagent/investigator/investigator_rca.go:1— `internal/kubernautagent/investigator/investigator_rca.go` and `internal/kubernautagent/investigator/investigator_workflow_selection.go` change together 60% of the time (6 of the 10 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). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `735696f3` fix(kubernautagent): suppress duplicate reasoning_content_delta when …; `fefdbef7` fix(kubernautagent): propagate accumulated tool-call history in RCA a…; `ce6bbcb6` lint(tier4): remediate unparam findings - kubernautagent — run `git show` on any of them.
Change coupling: request_builder.go ↔ aianalysis.go pkg/aianalysis/handlers/request_builder.go:1— `pkg/aianalysis/handlers/request_builder.go` and `pkg/remediationorchestrator/creator/aianalysis.go` change together 50% of the time (5 of the 10 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 5 shared commits counted here, the most recent 3 are `0e95f03c` feat(remediationorchestrator,kubernautagent): propagate ClusterClassi…; `9f64cfbc` feat(#462): add signalAnnotations to CRD, OpenAPI spec, RO wiring, an…; `2d0adcdf` refactor(api): replace SP local types with shared aliases, eliminate … — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (49 corresponding lines) · ×3
Edited copy of a member (49 corresponding lines) internal/controller/remediationorchestrator/terminal_transitions.go:60— internal/controller/remediationorchestrator/terminal_transitions.go:60-108 | internal/controller/remediationorchestrator/terminal_transitions.go:179-228 — These two members are one piece of code written twice and then edited apart: 49 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 (49 corresponding lines) pkg/datastorage/server/audit_events_handler.go:457— pkg/datastorage/server/audit_events_handler.go:457-512 | pkg/datastorage/server/helpers/query_helpers.go:56-104 — These two members are one piece of code written twice and then edited apart: 49 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 (49 corresponding lines) internal/controller/notification/notificationrequest_controller.go:1204— internal/controller/notification/notificationrequest_controller.go:1204-1252 | internal/controller/notification/notificationrequest_controller.go:1262-1317 — These two members are one piece of code written twice and then edited apart: 49 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 (35 corresponding lines) · ×3
Edited copy of a member (35 corresponding lines) pkg/kubernautagent/tools/alertmanager/client.go:74— pkg/kubernautagent/tools/alertmanager/client.go:74-112 | pkg/kubernautagent/tools/prometheus/client.go:94-128 — These two members are one piece of code written twice and then edited apart: 35 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 (35 corresponding lines) pkg/authwebhook/actiontype_handler.go:201— pkg/authwebhook/actiontype_handler.go:201-235 | pkg/authwebhook/remediationworkflow_handler.go:450-494 — These two members are one piece of code written twice and then edited apart: 35 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 (35 corresponding lines) pkg/kubernautagent/tools/k8s/resolver.go:393— pkg/kubernautagent/tools/k8s/resolver.go:393-427 | pkg/kubernautagent/tools/k8s/resolver.go:430-469 — These two members are one piece of code written twice and then edited apart: 35 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 (34 corresponding lines) · ×3
Edited copy of a member (34 corresponding lines) pkg/shared/types/typed_parameter.go:358— pkg/shared/types/typed_parameter.go:358-397 | pkg/shared/types/typed_parameter.go:399-432 — These two members are one piece of code written twice and then edited apart: 34 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 (34 corresponding lines) pkg/signalprocessing/audit/client.go:95— pkg/signalprocessing/audit/client.go:95-134 | pkg/signalprocessing/audit/client.go:352-385 — These two members are one piece of code written twice and then edited apart: 34 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 (34 corresponding lines) pkg/datastorage/repository/remediation_history_repository.go:212— pkg/datastorage/repository/remediation_history_repository.go:212-263 | pkg/datastorage/server/effectiveness_handler.go:340-373 — These two members are one piece of code written twice and then edited apart: 34 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 (38 corresponding lines) · ×3
Edited copy of a member (38 corresponding lines) pkg/fleet/acm/client.go:113— pkg/fleet/acm/client.go:113-151 | pkg/fleet/acm/client.go:205-242 — These two members are one piece of code written twice and then edited apart: 38 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 (38 corresponding lines) internal/controller/remediationorchestrator/audit_events.go:554— internal/controller/remediationorchestrator/audit_events.go:554-603 | internal/controller/remediationorchestrator/audit_events.go:608-645 — These two members are one piece of code written twice and then edited apart: 38 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 (38 corresponding lines) cmd/remediationorchestrator/main.go:89— cmd/remediationorchestrator/main.go:89-135 | cmd/signalprocessing/main.go:98-135 — These two members are one piece of code written twice and then edited apart: 38 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 (36 corresponding lines) · ×3
Edited copy of a member (36 corresponding lines) cmd/aianalysis/main.go:150— cmd/aianalysis/main.go:150-200 | cmd/authwebhook/main.go:117-152 — These two members are one piece of code written twice and then edited apart: 36 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 (36 corresponding lines) pkg/gateway/middleware/alertmanager_freshness.go:123— pkg/gateway/middleware/alertmanager_freshness.go:123-164 | pkg/gateway/middleware/event_freshness.go:75-110 — These two members are one piece of code written twice and then edited apart: 36 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 (36 corresponding lines) pkg/apifrontend/resilience/retry.go:48— pkg/apifrontend/resilience/retry.go:48-83 | pkg/shared/transport/retry.go:92-127 — These two members are one piece of code written twice and then edited apart: 36 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 (29 corresponding lines) · ×3
Edited copy of a member (29 corresponding lines) internal/controller/apifrontend/agentsession_close.go:124— internal/controller/apifrontend/agentsession_close.go:124-153 | internal/kubernautagent/agentsession/dispatcher.go:311-339 — These two members are one piece of code written twice and then edited apart: 29 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 (29 corresponding lines) internal/controller/aianalysis/phase_handlers.go:488— internal/controller/aianalysis/phase_handlers.go:488-516 | internal/controller/aianalysis/phase_handlers.go:520-548 — These two members are one piece of code written twice and then edited apart: 29 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 (29 corresponding lines) pkg/apifrontend/ka/mcp_sdk_client.go:70— pkg/apifrontend/ka/mcp_sdk_client.go:70-105 | pkg/apifrontend/ka/mcp_sdk_client.go:476-504 — These two members are one piece of code written twice and then edited apart: 29 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 (23 corresponding lines) · ×3
Edited copy of a member (23 corresponding lines) pkg/fleet/registry/eaigw_registry.go:171— pkg/fleet/registry/eaigw_registry.go:171-193 | pkg/fleet/registry/kuadrant_registry.go:129-151 — These two members are one piece of code written twice and then edited apart: 23 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 (23 corresponding lines) pkg/notification/delivery/orchestrator.go:408— pkg/notification/delivery/orchestrator.go:408-433 | pkg/notification/delivery/orchestrator.go:835-857 — These two members are one piece of code written twice and then edited apart: 23 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 (23 corresponding lines) internal/controller/remediationorchestrator/reconcile_loop.go:675— internal/controller/remediationorchestrator/reconcile_loop.go:675-697 | internal/controller/workflowexecution/workflowexecution_controller.go:428-451 — These two members are one piece of code written twice and then edited apart: 23 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 (25 corresponding lines) · ×3
Edited copy of a member (25 corresponding lines) pkg/gateway/processing/distributed_lock.go:230— pkg/gateway/processing/distributed_lock.go:230-254 | pkg/remediationorchestrator/locking/distributed_lock.go:178-202 — These two members are one piece of code written twice and then edited apart: 25 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 (25 corresponding lines) pkg/aianalysis/handlers/analyzing.go:166— pkg/aianalysis/handlers/analyzing.go:166-190 | pkg/aianalysis/handlers/analyzing.go:213-246 — These two members are one piece of code written twice and then edited apart: 25 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 (25 corresponding lines) pkg/apifrontend/launcher/event_bridge.go:381— pkg/apifrontend/launcher/event_bridge.go:381-405 | pkg/apifrontend/launcher/event_bridge.go:428-455 — These two members are one piece of code written twice and then edited apart: 25 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, 16+ corresponding lines) · ×3
Edited copies of one member (3 members, 16+ corresponding lines) internal/kubernautagent/audit/ds_payloads.go:621— internal/kubernautagent/audit/ds_payloads.go:621-636 | internal/kubernautagent/audit/ds_payloads.go:638-656 | internal/kubernautagent/audit/ds_payloads.go:658-676 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 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.
Edited copies of one member (3 members, 16+ corresponding lines) pkg/apifrontend/tools/crd_tools_session.go:155— pkg/apifrontend/tools/crd_tools_session.go:155-170 | pkg/apifrontend/tools/crd_tools_session.go:311-326 | pkg/apifrontend/tools/ka_investigate_mcp.go:1130-1148 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 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.
Edited copies of one member (3 members, 16+ corresponding lines) internal/kubernautagent/parser/parser_llm_types.go:182— internal/kubernautagent/parser/parser_llm_types.go:182-198 | internal/kubernautagent/parser/parser_llm_types.go:203-219 | internal/kubernautagent/parser/parser_llm_types.go:249-264 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 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 (16 corresponding lines) · ×3
Edited copy of a member (16 corresponding lines) internal/controller/signalprocessing/signalprocessing_classifying.go:267— internal/controller/signalprocessing/signalprocessing_classifying.go:267-282 | internal/controller/signalprocessing/signalprocessing_enriching.go:113-129 — These two members are one piece of code written twice and then edited apart: 16 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 (16 corresponding lines) pkg/apifrontend/config/hotreload.go:65— pkg/apifrontend/config/hotreload.go:65-83 | pkg/shared/hotreload/file_watcher.go:72-87 — These two members are one piece of code written twice and then edited apart: 16 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 (16 corresponding lines) pkg/effectivenessmonitor/client/ca_reloader.go:107— pkg/effectivenessmonitor/client/ca_reloader.go:107-122 | pkg/shared/tls/ca_reloader.go:150-167 — These two members are one piece of code written twice and then edited apart: 16 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 (6 corresponding lines) · ×3
Edited copy of a member (6 corresponding lines) internal/kubernautagent/tools/custom/fleet_resource_context.go:124— internal/kubernautagent/tools/custom/fleet_resource_context.go:124-129 | pkg/fleet/mcpclient/notfound.go:53-58 — These two members are one piece of code written twice and then edited apart: 6 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 (6 corresponding lines) internal/controller/apifrontend/agentsession_close.go:111— internal/controller/apifrontend/agentsession_close.go:111-116 | internal/controller/apifrontend/lease_sync.go:50-59 — These two members are one piece of code written twice and then edited apart: 6 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 (6 corresponding lines) pkg/apifrontend/ka/mcp_sdk_client.go:340— pkg/apifrontend/ka/mcp_sdk_client.go:340-349 | pkg/kubernautagent/llm/chat_helpers.go:28-33 — These two members are one piece of code written twice and then edited apart: 6 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 (19 lines × 2) internal/kubernautagent/config/config.go:466— internal/kubernautagent/config/config.go:466-484 | pkg/shared/types/llm.go:411-429 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Check import visibility before settling on that home: `internal/kubernautagent/config/config.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
Duplicated block (19 lines × 2) pkg/apifrontend/ka/mcp_sdk_client.go:162— pkg/apifrontend/ka/mcp_sdk_client.go:162-180 | pkg/apifrontend/ka/pooled_mcp_client.go:290-308 — 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 `pkg/apifrontend/ka/mcp_sdk_client.go:162` 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. 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 (19 lines × 2) pkg/apifrontend/resilience/circuitbreaker.go:59— pkg/apifrontend/resilience/circuitbreaker.go:59-77 | pkg/apifrontend/resilience/k8s_cb.go:32-50 — 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 `pkg/apifrontend/resilience/circuitbreaker.go: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 (18 lines × 2) pkg/apifrontend/ka/mcp_sdk_client.go:76— pkg/apifrontend/ka/mcp_sdk_client.go:76-93 | pkg/apifrontend/ka/pooled_mcp_client.go:157-174 — 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 (18 lines × 2) pkg/notification/routing/config.go:469— pkg/notification/routing/config.go:469-486 | pkg/notification/routing/config.go:505-522 — 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 `pkg/notification/routing/config.go:469` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (18 lines × 2) internal/kubernautagent/enrichment/k8s_adapter.go:262— internal/kubernautagent/enrichment/k8s_adapter.go:262-279 | pkg/kubernautagent/tools/k8s/resolver.go:216-233 — 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 `internal/kubernautagent/enrichment/k8s_adapter.go:262` 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. Check import visibility before settling on that home: `internal/kubernautagent/enrichment/k8s_adapter.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
Duplicated block (15–16 lines × 2) pkg/apifrontend/config/hotreload.go:207— pkg/apifrontend/config/hotreload.go:207-221 | pkg/shared/hotreload/file_watcher.go:225-240 — 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 `pkg/apifrontend/config/hotreload.go:207` 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/shared/hotreload/file_watcher.go:241` calls `V`, `Info` and `pkg/apifrontend/config/hotreload.go:222` 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 (15–16 lines × 2) pkg/apifrontend/tools/af_check_existing_rr.go:69— pkg/apifrontend/tools/af_check_existing_rr.go:69-84 | pkg/apifrontend/tools/af_create_rr.go:180-194 — 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 `pkg/apifrontend/tools/af_check_existing_rr.go:69` 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. 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 (15–16 lines × 2) internal/controller/remediationorchestrator/blocking.go:179— internal/controller/remediationorchestrator/blocking.go:179-194 | internal/controller/remediationorchestrator/terminal_transitions.go:667-681 — 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 `internal/controller/remediationorchestrator/blocking.go:179` 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 × 4) pkg/aianalysis/status/manager.go:71— pkg/aianalysis/status/manager.go:71-82 | pkg/remediationorchestrator/status/manager.go:75-86 | pkg/signalprocessing/status/manager.go:90-101 | pkg/workflowexecution/status/manager.go:66-77 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/aianalysis/status/manager.go:71` 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 × 4) pkg/apifrontend/ka/pooled_mcp_client.go:74— pkg/apifrontend/ka/pooled_mcp_client.go:74-85 | pkg/apifrontend/ka/pooled_mcp_client.go:118-129 | pkg/apifrontend/ka/pooled_mcp_client.go:147-158 | pkg/apifrontend/ka/pooled_mcp_client.go:326-337 — all 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/apifrontend/ka/pooled_mcp_client.go:74` 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 (12 lines × 4) pkg/authwebhook/config/config.go:100— pkg/authwebhook/config/config.go:100-111 | pkg/fleet/fmc/config/config.go:156-167 | pkg/gateway/config/config.go:441-452 | pkg/workflowexecution/config/config.go:216-227 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times. 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 (11 lines × 3) internal/kubernautagent/audit/ds_payloads.go:624— internal/kubernautagent/audit/ds_payloads.go:624-634 | internal/kubernautagent/audit/ds_payloads.go:641-651 | internal/kubernautagent/audit/ds_payloads.go:661-671 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/kubernautagent/audit/ds_payloads.go:624` 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 (11 lines × 3) pkg/aianalysis/conditions.go:118— pkg/aianalysis/conditions.go:118-128 | pkg/effectivenessmonitor/conditions/conditions.go:150-160 | pkg/signalprocessing/conditions.go:160-170 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times.
Duplicated block (11 lines × 3) pkg/audit/helpers.go:150— pkg/audit/helpers.go:150-163 | pkg/audit/helpers.go:184-197 | pkg/shared/auth/jwt_auth.go:239-249 — 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.
Duplicated block (9 lines × 4) pkg/effectivenessmonitor/audit/manager.go:186— pkg/effectivenessmonitor/audit/manager.go:186-194 | pkg/effectivenessmonitor/audit/manager.go:378-386 | pkg/effectivenessmonitor/audit/manager.go:526-534 | pkg/effectivenessmonitor/audit/manager.go:610-618 — all 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/effectivenessmonitor/audit/manager.go:186` 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 (9 lines × 4) pkg/remediationorchestrator/audit/manager.go:206— pkg/remediationorchestrator/audit/manager.go:206-214 | pkg/remediationorchestrator/audit/manager.go:239-247 | pkg/remediationorchestrator/audit/manager.go:714-722 | pkg/remediationorchestrator/audit/manager.go:776-784 — all 4 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/remediationorchestrator/audit/manager.go:723` calls `SetSeverity` and `pkg/remediationorchestrator/audit/manager.go:217` 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 (9 lines × 4) pkg/workflowexecution/executor/awx_client.go:93— pkg/workflowexecution/executor/awx_client.go:93-101 | pkg/workflowexecution/executor/awx_client.go:232-240 | pkg/workflowexecution/executor/awx_client.go:321-329 | pkg/workflowexecution/executor/awx_client.go:387-395 — all 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/workflowexecution/executor/awx_client.go:93` 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. 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 (7–8 lines × 2) internal/controller/remediationorchestrator/analyzing_handler.go:128— internal/controller/remediationorchestrator/analyzing_handler.go:128-134 | pkg/remediationorchestrator/handler/aianalysis.go:108-115 — 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 `internal/controller/remediationorchestrator/analyzing_handler.go:128` 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. 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. Check import visibility before settling on that home: `internal/controller/remediationorchestrator/analyzing_handler.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
Duplicated block (7–8 lines × 2) internal/kubernautagent/investigator/investigator_gates.go:857— internal/kubernautagent/investigator/investigator_gates.go:857-864 | internal/kubernautagent/investigator/investigator_gates.go:1018-1024 — 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 `internal/kubernautagent/investigator/investigator_gates.go:857` 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 (7–8 lines × 2) pkg/gateway/signal_ingestion.go:188— pkg/gateway/signal_ingestion.go:188-195 | pkg/gateway/signal_ingestion.go:383-389 — 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 `pkg/gateway/signal_ingestion.go:188` 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. 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. 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 (8 lines × 4) api/actiontype/v1alpha1/description_conversion.go:24— api/actiontype/v1alpha1/description_conversion.go:24-31 | api/remediationworkflow/v1alpha1/description_conversion.go:24-31 | internal/kubernautagent/workflowcatalog/cache_convert.go:215-222 | pkg/datastorage/models/workflow_labels.go:240-247 — before extracting anything, compare `api/actiontype/v1alpha1/description_conversion.go` and `api/remediationworkflow/v1alpha1/description_conversion.go` as WHOLE FILES: 82% 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 2 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Check import visibility before settling on that home: `internal/kubernautagent/workflowcatalog/cache_convert.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
Duplicated block (8 lines × 4) pkg/signalprocessing/audit/client.go:244— pkg/signalprocessing/audit/client.go:244-251 | pkg/signalprocessing/audit/client.go:434-441 | pkg/signalprocessing/audit/client.go:485-492 | pkg/signalprocessing/audit/client.go:525-532 — all 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/signalprocessing/audit/client.go:244` 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, `pkg/signalprocessing/audit/client.go:480` calls `SetDuration` and `pkg/signalprocessing/audit/client.go:239` 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 (8 lines × 4) pkg/signalprocessing/evaluator/evaluator.go:241— pkg/signalprocessing/evaluator/evaluator.go:241-248 | pkg/signalprocessing/evaluator/evaluator.go:296-303 | pkg/signalprocessing/evaluator/evaluator.go:349-356 | pkg/signalprocessing/evaluator/evaluator.go:390-397 — all 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/signalprocessing/evaluator/evaluator.go:241` 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
FileWatcher.watchLoop (cognitive 19) pkg/apifrontend/config/hotreload.go:206— FileWatcher.watchLoop has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 10). Of this number, 18 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.
FileWatcher.watchLoop (cognitive 19) pkg/shared/hotreload/file_watcher.go:224— FileWatcher.watchLoop has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 10). Of this number, 18 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.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (6 members, 50+ identical tokens) cmd/authwebhook/main.go:158— cmd/authwebhook/main.go:158-198 | cmd/effectivenessmonitor/main.go:346-372 | cmd/notification/main.go:526-558 | cmd/remediationorchestrator/main.go:403-433 | cmd/workflowexecution/main.go:408-434 | pkg/gateway/server_constructors.go:486-530 — 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.
Members sharing a duplicated core (6 members, 50+ identical tokens) pkg/effectivenessmonitor/audit/manager.go:146— pkg/effectivenessmonitor/audit/manager.go:146-205 | pkg/effectivenessmonitor/audit/manager.go:348-398 | pkg/effectivenessmonitor/audit/manager.go:513-545 | pkg/effectivenessmonitor/audit/manager.go:567-630 | pkg/effectivenessmonitor/audit/manager.go:639-701 | pkg/effectivenessmonitor/audit/manager.go:717-755 — 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 (42 corresponding lines) · ×2
Edited copy of a member (42 corresponding lines) internal/kubernautagent/investigator/investigator_rca.go:275— internal/kubernautagent/investigator/investigator_rca.go:275-316 | internal/kubernautagent/investigator/investigator_workflow_selection.go:671-723 — These two members are one piece of code written twice and then edited apart: 42 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 (42 corresponding lines) pkg/shared/types/typed_parameter.go:202— pkg/shared/types/typed_parameter.go:202-243 | pkg/shared/types/typed_parameter.go:254-296 — These two members are one piece of code written twice and then edited apart: 42 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 (41 corresponding lines) · ×2
Edited copy of a member (41 corresponding lines) pkg/apifrontend/prometheus/client.go:49— pkg/apifrontend/prometheus/client.go:49-95 | pkg/apifrontend/prometheus/client.go:98-138 — These two members are one piece of code written twice and then edited apart: 41 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 (41 corresponding lines) pkg/apifrontend/ka/pooled_mcp_client.go:146— pkg/apifrontend/ka/pooled_mcp_client.go:146-186 | pkg/apifrontend/ka/pooled_mcp_client.go:325-366 — These two members are one piece of code written twice and then edited apart: 41 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 (43 corresponding lines) · ×2
Edited copy of a member (43 corresponding lines) internal/controller/effectivenessmonitor/target_resources.go:257— internal/controller/effectivenessmonitor/target_resources.go:257-306 | internal/controller/remediationorchestrator/pre_remediation_hash.go:162-204 — These two members are one piece of code written twice and then edited apart: 43 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 (43 corresponding lines) internal/kubernautagent/session/manager_query.go:415— internal/kubernautagent/session/manager_query.go:415-462 | internal/kubernautagent/session/manager_query.go:486-528 — These two members are one piece of code written twice and then edited apart: 43 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, 44+ corresponding lines) · ×2
Edited copies of one member (3 members, 44+ corresponding lines) pkg/aianalysis/handlers/response_processor.go:865— pkg/aianalysis/handlers/response_processor.go:865-909 | pkg/aianalysis/handlers/response_processor.go:917-960 | pkg/aianalysis/handlers/response_processor.go:968-1020 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 44 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.
Edited copies of one member (3 members, 44+ corresponding lines) pkg/signalprocessing/evaluator/evaluator.go:230— pkg/signalprocessing/evaluator/evaluator.go:230-280 | pkg/signalprocessing/evaluator/evaluator.go:285-328 | pkg/signalprocessing/evaluator/evaluator.go:380-423 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 44 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 (28 corresponding lines) · ×2
Edited copy of a member (28 corresponding lines) pkg/datastorage/server/remediation_history_handler.go:323— pkg/datastorage/server/remediation_history_handler.go:323-350 | pkg/datastorage/server/remediation_history_handler.go:357-385 — 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.
Edited copy of a member (28 corresponding lines) pkg/apifrontend/ratelimit/ratelimit.go:368— pkg/apifrontend/ratelimit/ratelimit.go:368-395 | pkg/apifrontend/ratelimit/ratelimit.go:406-435 — 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 (31 corresponding lines) · ×2
Edited copy of a member (31 corresponding lines) pkg/remediationorchestrator/audit/manager.go:401— pkg/remediationorchestrator/audit/manager.go:401-433 | pkg/remediationorchestrator/audit/manager.go:708-738 — These two members are one piece of code written twice and then edited apart: 31 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 (31 corresponding lines) pkg/notification/routing/router.go:91— pkg/notification/routing/router.go:91-123 | pkg/notification/routing/router.go:128-158 — These two members are one piece of code written twice and then edited apart: 31 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, 17+ corresponding lines) · ×2
Edited copies of one member (3 members, 17+ corresponding lines) internal/controller/remediationorchestrator/cascade_terminal.go:70— internal/controller/remediationorchestrator/cascade_terminal.go:70-90 | internal/controller/remediationorchestrator/cascade_terminal.go:92-108 | internal/controller/remediationorchestrator/cascade_terminal.go:110-126 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 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.
Edited copies of one member (3 members, 17+ corresponding lines) pkg/shared/hash/configmap.go:119— pkg/shared/hash/configmap.go:119-139 | pkg/shared/hash/configmap.go:167-183 | pkg/shared/hash/configmap.go:187-207 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 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 copies of one member (3 members, 15+ corresponding lines) · ×2
Edited copies of one member (3 members, 15+ corresponding lines) internal/kubernautagent/mcp/reconstruct.go:136— internal/kubernautagent/mcp/reconstruct.go:136-150 | internal/kubernautagent/mcp/tools/investigate_autonomous.go:334-348 | internal/kubernautagent/mcp/tools/investigate_autonomous.go:351-366 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 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.
Edited copies of one member (3 members, 15+ corresponding lines) pkg/audit/typed_parameter_payload.go:14— pkg/audit/typed_parameter_payload.go:14-28 | pkg/shared/types/typed_parameter.go:165-179 | pkg/shared/types/typed_parameter.go:184-198 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 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 copies of one member (3 members, 13+ corresponding lines) · ×2
Edited copies of one member (3 members, 13+ corresponding lines) pkg/apifrontend/ka/rest_client.go:178— pkg/apifrontend/ka/rest_client.go:178-190 | pkg/apifrontend/ka/rest_client.go:193-205 | pkg/shared/llm/openaicompat/client.go:84-96 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 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.
Edited copies of one member (3 members, 13+ corresponding lines) internal/kubernautagent/investigator/investigator_gates.go:677— internal/kubernautagent/investigator/investigator_gates.go:677-689 | internal/kubernautagent/investigator/investigator_gates.go:691-703 | internal/kubernautagent/investigator/investigator_gates.go:730-745 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 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 copies of one member (3 members, 10+ corresponding lines) · ×2
Edited copies of one member (3 members, 10+ corresponding lines) internal/kubernautagent/workflowcatalog/cache.go:265— internal/kubernautagent/workflowcatalog/cache.go:265-274 | internal/kubernautagent/workflowcatalog/cache.go:282-291 | internal/kubernautagent/workflowcatalog/cache.go:319-328 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 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.
Edited copies of one member (3 members, 10+ corresponding lines) pkg/apifrontend/ratelimit/ratelimit.go:67— pkg/apifrontend/ratelimit/ratelimit.go:67-76 | pkg/apifrontend/ratelimit/ratelimit.go:140-149 | pkg/apifrontend/ratelimit/ratelimit.go:152-161 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 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 copies of one member (3 members, 14+ corresponding lines) · ×2
Edited copies of one member (3 members, 14+ corresponding lines) cmd/datastorage/main.go:711— cmd/datastorage/main.go:711-724 | cmd/notification/main.go:838-851 | cmd/remediationorchestrator/main.go:876-889 — 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.
Edited copies of one member (3 members, 14+ corresponding lines) pkg/apifrontend/security/redact.go:30— pkg/apifrontend/security/redact.go:30-43 | pkg/shared/k8s/validation.go:63-82 | pkg/workflowexecution/executor/filter.go:41-54 — 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 copies of one member (3 members, 11+ corresponding lines) · ×2
Edited copies of one member (3 members, 11+ corresponding lines) docs/architecture/spikes/hitl-permission/main.go:222— docs/architecture/spikes/hitl-permission/main.go:222-232 | docs/architecture/spikes/run-state-persistence/main.go:271-281 | docs/architecture/spikes/shadow-acp/main.go:346-356 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 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.
Edited copies of one member (3 members, 11+ corresponding lines) pkg/apifrontend/ratelimit/config.go:75— pkg/apifrontend/ratelimit/config.go:75-85 | pkg/datastorage/config/config.go:287-299 | pkg/notification/config/config.go:128-143 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 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 copies of one member (3 members, 9+ corresponding lines) · ×2
Edited copies of one member (3 members, 9+ corresponding lines) pkg/kubernautagent/tools/k8s/tools.go:295— pkg/kubernautagent/tools/k8s/tools.go:295-303 | pkg/kubernautagent/tools/k8s/tools.go:305-313 | pkg/kubernautagent/tools/k8s/tools.go:315-323 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 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.
Edited copies of one member (3 members, 9+ corresponding lines) docs/spikes/multi-cluster-mcp-gateway/spike-s2-cluster-registry/crd_watcher.go:81— docs/spikes/multi-cluster-mcp-gateway/spike-s2-cluster-registry/crd_watcher.go:81-90 | internal/kubernautagent/investigator/phase_resolver.go:117-125 | pkg/gateway/adapters/registry.go:137-147 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 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.
Duplicated block (30 lines × 2) docs/architecture/spikes/hitl-permission/main.go:32— docs/architecture/spikes/hitl-permission/main.go:32-61 | docs/architecture/spikes/run-state-persistence/main.go:46-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 (30 lines × 2) pkg/aianalysis/metrics/metrics.go:163— pkg/aianalysis/metrics/metrics.go:163-192 | pkg/aianalysis/metrics/metrics.go:240-269 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (23–24 lines × 2) pkg/notification/status/manager.go:58— pkg/notification/status/manager.go:58-81 | pkg/notification/status/manager.go:227-249 — 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.
Duplicated block (23–24 lines × 2) pkg/workflowexecution/metrics/metrics.go:107— pkg/workflowexecution/metrics/metrics.go:107-130 | pkg/workflowexecution/metrics/metrics.go:154-176 — 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.
Duplicated block (17 lines × 2) internal/controller/effectivenessmonitor/completion.go:39— internal/controller/effectivenessmonitor/completion.go:39-55 | internal/controller/effectivenessmonitor/completion.go:92-108 — 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 `internal/controller/effectivenessmonitor/completion.go: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. 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 (17 lines × 2) pkg/datastorage/query/service.go:106— pkg/datastorage/query/service.go:106-122 | pkg/datastorage/query/service.go:211-227 — 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 `pkg/datastorage/query/service.go:106` 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 (16–17 lines × 2) pkg/fleet/registry/eaigw_registry.go:275— pkg/fleet/registry/eaigw_registry.go:275-290 | pkg/fleet/registry/kuadrant_registry.go:166-182 — before extracting anything, compare `pkg/fleet/registry/eaigw_registry.go` and `pkg/fleet/registry/kuadrant_registry.go` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 114 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 (16–17 lines × 2) pkg/notification/audit/manager.go:144— pkg/notification/audit/manager.go:144-160 | pkg/notification/audit/manager.go:214-229 — 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.
Duplicated block (11–15 lines × 4) cmd/effectivenessmonitor/main.go:347— cmd/effectivenessmonitor/main.go:347-357 | cmd/notification/main.go:529-543 | cmd/remediationorchestrator/main.go:406-418 | cmd/workflowexecution/main.go:411-423 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times.
Duplicated block (11–15 lines × 4) pkg/workflowexecution/audit/manager.go:229— pkg/workflowexecution/audit/manager.go:229-241 | pkg/workflowexecution/audit/manager.go:314-326 | pkg/workflowexecution/audit/manager.go:466-480 | pkg/workflowexecution/audit/manager.go:722-732 — all 4 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 (11–15 lines × 2) pkg/kubernautagent/llm/instrumented_client.go:67— pkg/kubernautagent/llm/instrumented_client.go:67-81 | pkg/kubernautagent/llm/instrumented_client.go:87-97 — 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 `pkg/kubernautagent/llm/instrumented_client.go:67` 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. 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 (11–15 lines × 2) pkg/remediationorchestrator/handler/aianalysis.go:454— pkg/remediationorchestrator/handler/aianalysis.go:454-464 | pkg/remediationorchestrator/handler/aianalysis.go:555-569 — 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 `pkg/remediationorchestrator/handler/aianalysis.go:454` 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/remediationorchestrator/handler/aianalysis.go:452` calls `Info` and `pkg/remediationorchestrator/handler/aianalysis.go:555` 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 (11 lines × 4) cmd/effectivenessmonitor/main.go:332— cmd/effectivenessmonitor/main.go:332-342 | cmd/notification/main.go:442-452 | cmd/remediationorchestrator/main.go:387-397 | cmd/workflowexecution/main.go:392-402 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/effectivenessmonitor/main.go:332` 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 (11 lines × 4) cmd/effectivenessmonitor/main.go:763— cmd/effectivenessmonitor/main.go:763-773 | cmd/notification/main.go:782-792 | cmd/remediationorchestrator/main.go:843-853 | cmd/workflowexecution/main.go:700-710 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/effectivenessmonitor/main.go:763` 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 (10–11 lines × 2) pkg/effectivenessmonitor/audit/manager.go:161— pkg/effectivenessmonitor/audit/manager.go:161-171 | pkg/effectivenessmonitor/audit/manager.go:499-508 — 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 `pkg/effectivenessmonitor/audit/manager.go:161` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/effectivenessmonitor/audit/manager.go:513` calls `storeEvent` and `pkg/effectivenessmonitor/audit/manager.go:174` 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 (10–11 lines × 2) pkg/effectivenessmonitor/timing/derived.go:94— pkg/effectivenessmonitor/timing/derived.go:94-103 | pkg/effectivenessmonitor/timing/derived.go:116-126 — 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 `pkg/effectivenessmonitor/timing/derived.go:94` 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. 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 (10 lines × 7) cmd/aianalysis/main.go:408— cmd/aianalysis/main.go:408-417 | cmd/authwebhook/main.go:400-409 | cmd/effectivenessmonitor/main.go:760-769 | cmd/notification/main.go:779-788 | cmd/remediationorchestrator/main.go:840-849 | cmd/signalprocessing/main.go:580-589 | cmd/workflowexecution/main.go:697-706 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 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 7 times. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/aianalysis/main.go:408` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `configPath` in one and `configFile` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 7) pkg/remediationorchestrator/audit/manager.go:207— pkg/remediationorchestrator/audit/manager.go:207-217 | pkg/remediationorchestrator/audit/manager.go:240-249 | pkg/remediationorchestrator/audit/manager.go:275-284 | pkg/remediationorchestrator/audit/manager.go:311-320 | pkg/remediationorchestrator/audit/manager.go:358-368 | pkg/remediationorchestrator/audit/manager.go:777-788 | pkg/remediationorchestrator/audit/manager.go:841-850 — all 7 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/remediationorchestrator/audit/manager.go:207` 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 (10 lines × 3) cmd/aianalysis/main.go:388— cmd/aianalysis/main.go:388-397 | cmd/authwebhook/main.go:380-389 | cmd/signalprocessing/main.go:560-569 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/aianalysis/main.go:388` 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 (10 lines × 3) docs/architecture/spikes/hitl-permission/main.go:610— docs/architecture/spikes/hitl-permission/main.go:610-619 | docs/architecture/spikes/run-state-persistence/main.go:680-689 | docs/architecture/spikes/shadow-acp/main.go:470-479 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (6 lines × 4) pkg/aianalysis/audit/audit.go:243— pkg/aianalysis/audit/audit.go:243-250 | pkg/aianalysis/audit/audit.go:367-374 | pkg/aianalysis/audit/audit.go:556-561 | pkg/aianalysis/audit/audit.go:588-593 — all 4 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 (6 lines × 4) docs/architecture/spikes/run-state-persistence/main.go:602— docs/architecture/spikes/run-state-persistence/main.go:602-607 | docs/architecture/spikes/shadow-acp/main.go:752-757 | docs/architecture/spikes/shadow-acp/main.go:787-792 | docs/architecture/spikes/shadow-acp/main.go:819-824 — there are 4 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 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 8) api/actiontype/v1alpha1/groupversion_info.go:28— api/actiontype/v1alpha1/groupversion_info.go:28-37 | api/aianalysis/v1alpha1/groupversion_info.go:27-37 | api/effectivenessassessment/v1alpha1/groupversion_info.go:27-37 | api/notification/v1alpha1/groupversion_info.go:27-37 | api/remediation/v1alpha1/groupversion_info.go:27-37 | api/remediationworkflow/v1alpha1/groupversion_info.go:28-37 | api/signalprocessing/v1alpha1/groupversion_info.go:29-39 | api/workflowexecution/v1alpha1/groupversion_info.go:27-36 — before extracting anything, compare `api/actiontype/v1alpha1/groupversion_info.go` and `api/notification/v1alpha1/groupversion_info.go` as WHOLE FILES: 92% 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 8) pkg/remediationorchestrator/audit/manager.go:207— pkg/remediationorchestrator/audit/manager.go:207-217 | pkg/remediationorchestrator/audit/manager.go:240-249 | pkg/remediationorchestrator/audit/manager.go:275-284 | pkg/remediationorchestrator/audit/manager.go:311-320 | pkg/remediationorchestrator/audit/manager.go:358-368 | pkg/remediationorchestrator/audit/manager.go:549-559 | pkg/remediationorchestrator/audit/manager.go:777-788 | pkg/remediationorchestrator/audit/manager.go:841-850 — all 8 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/remediationorchestrator/audit/manager.go:207` 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 (13 lines × 3) pkg/apifrontend/resilience/retry.go:177— pkg/apifrontend/resilience/retry.go:177-189 | pkg/apifrontend/tools/ka_investigate_mcp.go:155-167 | pkg/shared/transport/retry.go:210-222 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (13 lines × 3) internal/controller/remediationorchestrator/audit_events.go:329— internal/controller/remediationorchestrator/audit_events.go:329-341 | internal/controller/remediationorchestrator/audit_events.go:371-383 | internal/controller/remediationorchestrator/audit_events.go:486-498 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/controller/remediationorchestrator/audit_events.go:329` 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 (7 lines × 5) pkg/workflowexecution/executor/awx_client.go:80— pkg/workflowexecution/executor/awx_client.go:80-86 | pkg/workflowexecution/executor/awx_client.go:219-225 | pkg/workflowexecution/executor/awx_client.go:254-260 | pkg/workflowexecution/executor/awx_client.go:308-314 | pkg/workflowexecution/executor/awx_client.go:374-380 — all 5 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (7 lines × 5) pkg/effectivenessmonitor/client/alertmanager_http.go:64— pkg/effectivenessmonitor/client/alertmanager_http.go:64-70 | pkg/effectivenessmonitor/client/prometheus_http.go:65-71 | pkg/effectivenessmonitor/client/prometheus_http.go:93-99 | pkg/workflowexecution/executor/awx_client.go:113-119 | pkg/workflowexecution/executor/awx_client.go:407-413 — there are 5 copies across 3 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 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/effectivenessmonitor/client/alertmanager_http.go:64` 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/workflowexecution/executor/awx_client.go:110` calls `setHeaders` and `pkg/effectivenessmonitor/client/alertmanager_http.go:61` does not — after which the two agree again for 3 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.
prompt.BuildRCAProvisionalReviewSection (cyclomatic 16) internal/kubernautagent/prompt/history.go:125— prompt.BuildRCAProvisionalReviewSection 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.
Hotspot: internal/kubernautagent/prompt/history.go internal/kubernautagent/prompt/history.go:125— internal/kubernautagent/prompt/history.go changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in prompt.BuildRCAProvisionalReviewSection at line 125. 4 of those changes were fix/bug commits, so the churn is repair rather than feature work. 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-08-17..2026-11-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-17 17:09:09 -05:00' --until='2026-11-15 17:09:09 -05:00' --full-history --no-merges -- internal/kubernautagent/prompt/history.go`: 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.
runtime.sdkEventToACP (cognitive 20) docs/spikes/oas-runtime/internal/runtime/agent.go:350— runtime.sdkEventToACP has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 2 (4 pts), loops 1 (2 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
controller.ComputePodHealthStats (cognitive 20) internal/controller/effectivenessmonitor/pod_health.go:48— controller.ComputePodHealthStats has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 3, loops 2 (3 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.
prompt.BuildRCAProvisionalReviewSection (cognitive 20) internal/kubernautagent/prompt/history.go:125— prompt.BuildRCAProvisionalReviewSection has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (15 pts), loops 2 (4 pts), boolean chains 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.
CRDSessionService.MaterializeCRD (cognitive 20) pkg/apifrontend/session/service.go:383— CRDSessionService.MaterializeCRD has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (3 pts), 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.
tools.BridgeEventsToA2A (cognitive 20) pkg/apifrontend/tools/ka_investigate_bridge.go:49— tools.BridgeEventsToA2A has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 2 (6 pts), boolean chains 1, loops 1 (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.
DLQRetryWorker.writeToPostgres (cognitive 20) pkg/datastorage/server/dlq_retry_worker.go:383— DLQRetryWorker.writeToPostgres has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 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.
fleet.NewScopeChecker (cognitive 20) pkg/fleet/scope_factory.go:78— fleet.NewScopeChecker has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 1, loops 1, match/switch 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.
reconnectRun.manageDeadline (cognitive 20) pkg/fleet/mcpclient/resilience.go:203— reconnectRun.manageDeadline has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 2 (7 pts), loops 1 (nesting depth added 12). Of this number, 19 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.
audit.buildSignalProcessedPayload (cognitive 20) pkg/signalprocessing/audit/client.go:153— audit.buildSignalProcessedPayload has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (20 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.
main.testDenyDestructiveTool (cognitive 19) docs/architecture/spikes/hitl-permission/main.go:376— main.testDenyDestructiveTool has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (4 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.
Investigator.continueRCAWithHistory (cognitive 19) internal/kubernautagent/investigator/investigator.go:789— Investigator.continueRCAWithHistory has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, 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.
Investigator.resolveTargetScopedCorrectionSubmission (cognitive 19) internal/kubernautagent/investigator/investigator_gates.go:1444— Investigator.resolveTargetScopedCorrectionSubmission has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (18 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.
Config.Validate (cognitive 19) pkg/apifrontend/auth/config.go:64— Config.Validate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 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.
Service.authorize (cognitive 19) pkg/apifrontend/policyread/service.go:267— Service.authorize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (2 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.
session.trimEventFunctionResponses (cognitive 19) pkg/apifrontend/session/trimming.go:26— session.trimEventFunctionResponses has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5, 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.
Triager.triagePipeline (cognitive 19) pkg/apifrontend/severity/triage.go:185— Triager.triagePipeline has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (19 pts) (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.
BufferedAuditStore.writeBatchChunkWithRetry (cognitive 19) pkg/audit/store.go:657— BufferedAuditStore.writeBatchChunkWithRetry has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (4 pts), loops 1 (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.
acm.inventoryResultPage (cognitive 19) pkg/fleet/acm/inventory.go:201— acm.inventoryResultPage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), boolean chains 2, match/switch 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.
FleetConfig.Validate (cognitive 19) pkg/fleet/config.go:237— FleetConfig.Validate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3 (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.
geminifamily.accumulateContentBlocks (cognitive 19) pkg/kubernautagent/llm/geminifamily/conv.go:270— geminifamily.accumulateContentBlocks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 1 (2 pts), loops 1 (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.
K8sOwnerResolver.ResolveTopLevelOwnerWithAPIVersion (cognitive 19) pkg/shared/k8s/ownerchain/owner_resolver.go:244— K8sOwnerResolver.ResolveTopLevelOwnerWithAPIVersion has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 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.
types.typedParameterValueToEngineValue (cognitive 19) pkg/shared/types/typed_parameter.go:254— types.typedParameterValueToEngineValue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SignalProcessingReconciler.applyEnrichmentCustomLabels (cognitive 18) internal/controller/signalprocessing/signalprocessing_enriching.go:208— SignalProcessingReconciler.applyEnrichmentCustomLabels has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4 (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.
LLMRuntimeConfig.Validate (cognitive 18) internal/kubernautagent/config/config.go:68— LLMRuntimeConfig.Validate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 1, 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.
K8sAdapter.GetOwnerChain (cognitive 18) internal/kubernautagent/enrichment/k8s_adapter.go:75— K8sAdapter.GetOwnerChain has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (3 pts), boolean chains 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.
K8sAdapter.getResourceWithFallback (cognitive 18) internal/kubernautagent/enrichment/k8s_adapter.go:192— K8sAdapter.getResourceWithFallback has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 1, 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.
Store.Cleanup (cognitive 18) internal/kubernautagent/session/store.go:375— Store.Cleanup has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 1 (2 pts), loops 1 (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.
agent.historySanitizer (cognitive 18) pkg/apifrontend/agent/history_sanitizer.go:32— agent.historySanitizer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (4 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.
JWTValidator.Validate (cognitive 18) pkg/apifrontend/auth/jwt.go:186— JWTValidator.Validate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (17 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.
Config.validateJWTProviders (cognitive 18) pkg/apifrontend/config/config.go:552— Config.validateJWTProviders has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 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.
tools.aggregateByPhase (cognitive 18) pkg/apifrontend/tools/ds_tools.go:181— tools.aggregateByPhase has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (4 pts) (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.
tools.ValidateWorkflowParameters (cognitive 18) pkg/apifrontend/tools/ka_tools.go:181— tools.ValidateWorkflowParameters has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3, 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.
tools.HandleCompleteNoAction (cognitive 18) pkg/apifrontend/tools/ka_tools.go:545— tools.HandleCompleteNoAction has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (17 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.
Client.collectNamespaceResources (cognitive 18) pkg/fleet/acm/inventory.go:165— Client.collectNamespaceResources has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, 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.
BridgeTool.executeWithBinding (cognitive 18) pkg/fleet/mcpclient/bridge_tool.go:211— BridgeTool.executeWithBinding has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 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.
types.TypedParameterValueToJSONValue (cognitive 18) pkg/shared/types/typed_parameter.go:202— types.TypedParameterValueToJSONValue has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (2 pts), boolean chains 1, match/switch 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.
NotificationRequestReconciler.rebuildPagerDutyDeliveryServices (cognitive 17) internal/controller/notification/routing_handler.go:314— NotificationRequestReconciler.rebuildPagerDutyDeliveryServices has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (4 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.
Reconciler.Reconcile (cognitive 17) internal/controller/remediationorchestrator/reconcile_loop.go:57— Reconciler.Reconcile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (17 pts) (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.
WorkflowExecutionReconciler.recordPendingSelectionAudit (cognitive 17) internal/controller/workflowexecution/workflowexecution_pending.go:304— WorkflowExecutionReconciler.recordPendingSelectionAudit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 2 (3 pts) (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.
enrichment.summarizeQuotas (cognitive 17) internal/kubernautagent/enrichment/label_detector.go:686— enrichment.summarizeQuotas has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 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.
investigator.resourceListItemsWellFormed (cognitive 17) internal/kubernautagent/investigator/investigator_gates.go:567— investigator.resourceListItemsWellFormed has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, 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.
tools.waitForAgentSessionDispatch (cognitive 17) internal/kubernautagent/mcp/tools/investigate_start.go:349— tools.waitForAgentSessionDispatch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (2 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.
parser.unwrapDoubleSerializedJSON (cognitive 17) internal/kubernautagent/parser/parser_llm_types.go:109— parser.unwrapDoubleSerializedJSON has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, 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.
Triager.Triage (cognitive 17) pkg/apifrontend/severity/triage.go:114— Triager.Triage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4 (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, 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.
adapters.extractTargetResource (cognitive 17) pkg/gateway/adapters/prometheus_adapter.go:562— adapters.extractTargetResource has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (nesting depth added 6). 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, 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.
geminifamily.convertAssistantMessage (cognitive 17) pkg/kubernautagent/llm/geminifamily/conv.go:139— geminifamily.convertAssistantMessage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 1 (3 pts), boolean chains 2, 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.
logs.fetchContainerLogs (cognitive 17) pkg/kubernautagent/tools/logs/fetch_pod_logs.go:88— logs.fetchContainerLogs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 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.
Resolver.watchLoop (cognitive 17) pkg/notification/credentials/resolver.go:150— Resolver.watchLoop has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (13 pts), match/switch 1 (2 pts), boolean chains 1, 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.
Config.ValidateCredentialRefs (cognitive 17) pkg/notification/routing/config.go:298— Config.ValidateCredentialRefs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (7 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.
remediationapprovalrequest.augmentValidationSchema (cognitive 17) pkg/remediationapprovalrequest/parameters.go:127— remediationapprovalrequest.augmentValidationSchema has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 4 (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.
RoutingEngine.FindRecentCompletedWFE (cognitive 17) pkg/remediationorchestrator/routing/blocking.go:1073— RoutingEngine.FindRecentCompletedWFE has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, 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.
evaluator.validateAndSanitizeLabels (cognitive 17) pkg/signalprocessing/evaluator/evaluator.go:501— evaluator.validateAndSanitizeLabels has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 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.
main.testStreamWithShadowForwarding (cognitive 16) docs/architecture/spikes/shadow-acp/main.go:528— main.testStreamWithShadowForwarding has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 4). 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.
Investigator.RunWorkflowDiscoveryFromRCA (cognitive 16) internal/kubernautagent/investigator/investigator_discovery.go:41— Investigator.RunWorkflowDiscoveryFromRCA has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5 (nesting depth added 2). 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.
Investigator.verifyExactTargetAPIVersion (cognitive 16) internal/kubernautagent/investigator/investigator_gates.go:1159— Investigator.verifyExactTargetAPIVersion has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3 (nesting depth added 2). 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.
Investigator.retryForAPIVersion (cognitive 16) internal/kubernautagent/investigator/investigator_gates.go:1711— Investigator.retryForAPIVersion has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (16 pts) (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, 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.
InvestigateTool.handleMessage (cognitive 16) internal/kubernautagent/mcp/tools/investigate_takeover.go:100— InvestigateTool.handleMessage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (16 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.
Validator.validateParameters (cognitive 16) internal/kubernautagent/parser/validator.go:300— Validator.validateParameters has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (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.
prompt.DetectDecliningEffectiveness (cognitive 16) internal/kubernautagent/prompt/history.go:595— prompt.DetectDecliningEffectiveness has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (4 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.
launcher.discoveryFromEvents (cognitive 16) pkg/apifrontend/launcher/completion_coordinator.go:154— launcher.discoveryFromEvents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (3 pts), 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.
policyread.listTargets (cognitive 16) pkg/apifrontend/policyread/service.go:350— policyread.listTargets has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 5, loops 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.
Service.readInventoryPage (cognitive 16) pkg/apifrontend/policyread/service.go:221— Service.readInventoryPage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 1 (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.
RetryTransport.RoundTrip (cognitive 16) pkg/apifrontend/resilience/retry.go:48— RetryTransport.RoundTrip has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, 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.
severity.labelsOverlap (cognitive 16) pkg/apifrontend/severity/triage.go:559— severity.labelsOverlap has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, 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.
Triager.collectTier2Rules (cognitive 16) pkg/apifrontend/severity/triage.go:433— Triager.collectTier2Rules has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (3 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.
tools.HandleGetAlertDetails (cognitive 16) pkg/apifrontend/tools/af_alerts.go:291— tools.HandleGetAlertDetails has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, loops 1 (nesting depth added 4). 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.
Client.drainStreamPass (cognitive 16) pkg/datastorage/dlq/client_drain.go:262— Client.drainStreamPass has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 2 (5 pts), 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.
RemediationHistoryRepository.QueryAIAnalysisDecisionContextBatch (cognitive 16) pkg/datastorage/repository/remediation_history_repository.go:269— RemediationHistoryRepository.QueryAIAnalysisDecisionContextBatch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 1, loops 1 (nesting depth added 4). Of this number, 15 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.
Server.parseQueryFilters (cognitive 16) pkg/datastorage/server/audit_events_handler.go:457— Server.parseQueryFilters has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3 (nesting depth added 4). 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.
Client.explicitInventoryResources (cognitive 16) pkg/fleet/acm/inventory.go:129— Client.explicitInventoryResources has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, 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.
mcpclient.ParseUnstructuredListResponse (cognitive 16) pkg/fleet/mcpclient/parse.go:52— mcpclient.ParseUnstructuredListResponse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 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.
apiResourcesListTool.Execute (cognitive 16) pkg/kubernautagent/tools/k8s/tools.go:129— apiResourcesListTool.Execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (3 pts) (nesting depth added 5). Of this number, 15 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.
audit.addApprovalDecisionParameters (cognitive 16) pkg/remediationorchestrator/audit/manager.go:649— audit.addApprovalDecisionParameters has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (6 pts) (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.
Detector.GetPhaseTimeout (cognitive 16) pkg/remediationorchestrator/timeout/detector.go:150— Detector.GetPhaseTimeout has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, match/switch 2 (3 pts) (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.
MockAuthorizer.CheckAccessWithGroup (cognitive 16) pkg/shared/auth/mock_auth.go:184— MockAuthorizer.CheckAccessWithGroup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (16 pts) (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.
workflowschema.SpecToSchema (cognitive 16) REDACTED:37— workflowschema.SpecToSchema has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 5 (7 pts), boolean chains 2 (nesting depth added 4). 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.
D22 · Internal API Consistency· `aianalysis.NewPermanentError` takes (message, reason) where its 5 siblings take (reason, message) · ×1
`aianalysis.NewPermanentError` takes (message, reason) where its 5 siblings take (reason, message) pkg/aianalysis/handler.go:182— 5 of 6 members of `package aianalysis` with these two same-typed parameters take them in the order (reason, message) (5 of 6). Siblings: aianalysis.SetCondition (pkg/aianalysis/conditions.go:118); aianalysis.SetReady (pkg/aianalysis/conditions.go:131); aianalysis.SetWorkflowResolved (pkg/aianalysis/conditions.go:167); aianalysis.SetApprovalRequired (pkg/aianalysis/conditions.go:176); aianalysis.SetInvestigationSessionReady (pkg/aianalysis/conditions.go:186). Reorder to (reason, message); both are the same type, so the compiler cannot catch a swapped call. [rule A3]
D22 · Internal API Consistency· `severity.NewTriager` takes functional options (`opts ...Option`) where its 3 sibling constructors take a config struct · ×1
`severity.NewTriager` takes functional options (`opts ...Option`) where its 3 sibling constructors take a config struct pkg/apifrontend/severity/triage.go:95— 3 of 4 constructors of `package severity` that take options take a config struct (3 of 4). Siblings: severity.NewAnthropicTriager (pkg/apifrontend/severity/anthropic.go:65); severity.NewGenAITriager (pkg/apifrontend/severity/llm.go:46); severity.NewOpenAICompatibleTriager (pkg/apifrontend/severity/openai_compatible.go:46). Take a config struct, like the package's other constructors. [rule A7]
D22 · Internal API Consistency· `tools.BuildProgressSnapshot` returns a map (`map[K]V`) where its 3 siblings return a slice (`[]T`) · ×1
`tools.BuildProgressSnapshot` returns a map (`map[K]V`) where its 3 siblings return a slice (`[]T`) pkg/apifrontend/tools/execution_progress.go:21— 3 of 4 collection-returning members of `package tools` return a slice (`[]T`) (3 of 4). Siblings: tools.FilterRelatedPodEvents (pkg/apifrontend/tools/af_list_events.go:179); tools.TrimSliceToFit (pkg/apifrontend/tools/helpers.go:163); tools.DiffEASteps (pkg/apifrontend/tools/verification_step.go:39). Return a slice (`[]T`). [rule A4]
D22 · Internal API Consistency· `Server.RegisterAdapter` takes no context.Context; its 3 sibling operations take one · ×1
`Server.RegisterAdapter` takes no context.Context; its 3 sibling operations take one pkg/gateway/signal_ingestion.go:68— 3 of 4 fallible operations of `Server` take a `ctx context.Context` (3 of 4). Siblings: Server.Start (pkg/gateway/server.go:454); Server.Stop (pkg/gateway/server.go:531); Server.ProcessSignal (pkg/gateway/signal_ingestion_process.go:56). Take `ctx context.Context` as the first parameter, like its siblings, and pass it on. [rule A1]
D22 · Internal API Consistency· `executor.ConvertParameters` returns a slice (`[]T`) where its 3 siblings return a map (`map[K]V`) · ×1
`executor.ConvertParameters` returns a slice (`[]T`) where its 3 siblings return a map (`map[K]V`) pkg/workflowexecution/executor/tekton.go:341— 3 of 4 collection-returning members of `package executor` return a map (`map[K]V`) (3 of 4). Siblings: executor.BuildExtraVars (pkg/workflowexecution/executor/ansible.go:870); executor.FilterDeclaredParameters (pkg/workflowexecution/executor/filter.go:41); executor.FilterDeclaredTypedParameterStrings (pkg/workflowexecution/executor/filter.go:77). Return a map (`map[K]V`). [rule A4]
D4 · Code Duplication· Near-duplicate member family (4 members, 16 shared lines) · ×1
Near-duplicate member family (4 members, 16 shared lines) pkg/workflowexecution/executor/awx_client.go:63— pkg/workflowexecution/executor/awx_client.go:63-101 | pkg/workflowexecution/executor/awx_client.go:200-240 | pkg/workflowexecution/executor/awx_client.go:284-329 | pkg/workflowexecution/executor/awx_client.go:354-395 — These 4 members are variants of one another: a block of 16 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 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 4 times.
Near-duplicate member pair (31 shared lines) internal/kubernautagent/tools/custom/tools.go:171— internal/kubernautagent/tools/custom/tools.go:171-251 | internal/kubernautagent/tools/custom/tools.go:314-384 — These two members are variants of one another: 31 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (9 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (9 members, 50+ identical tokens) internal/controller/remediationorchestrator/notification_creation.go:222— internal/controller/remediationorchestrator/notification_creation.go:222-253 | internal/controller/remediationorchestrator/timeout_handling.go:188-218 | pkg/remediationorchestrator/creator/notification.go:225-266 | pkg/remediationorchestrator/creator/notification.go:444-499 | pkg/remediationorchestrator/creator/notification.go:568-629 | pkg/remediationorchestrator/creator/notification.go:737-786 | pkg/remediationorchestrator/creator/notification.go:797-847 | pkg/remediationorchestrator/creator/notification.go:948-973 | pkg/remediationorchestrator/creator/notification.go:1235-1273 — These 9 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 9 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 9 times.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (7 members, 50+ identical tokens) internal/controller/remediationorchestrator/blocked_transitions.go:135— internal/controller/remediationorchestrator/blocked_transitions.go:135-165 | internal/controller/remediationorchestrator/blocked_transitions.go:171-197 | internal/controller/remediationorchestrator/blocking.go:164-194 | internal/controller/remediationorchestrator/notification_creation.go:82-122 | internal/controller/remediationorchestrator/notification_creation.go:158-176 | internal/controller/remediationorchestrator/notification_creation.go:255-303 | internal/controller/remediationorchestrator/terminal_transitions.go:654-681 — These 7 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 7 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 7 times.
D4 · Code Duplication· Edited copy of a member (54 corresponding lines) · ×1
Edited copy of a member (54 corresponding lines) pkg/aianalysis/handlers/response_processor.go:1026— pkg/aianalysis/handlers/response_processor.go:1026-1079 | pkg/aianalysis/handlers/response_processor.go:1083-1143 — These two members are one piece of code written twice and then edited apart: 54 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 (67 corresponding lines) · ×1
Edited copy of a member (67 corresponding lines) cmd/apifrontend/backend_deps.go:624— cmd/apifrontend/backend_deps.go:624-696 | cmd/effectivenessmonitor/main.go:495-561 — These two members are one piece of code written twice and then edited apart: 67 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, 49+ corresponding lines) · ×1
Edited copies of one member (3 members, 49+ corresponding lines) cmd/aianalysis/main.go:387— cmd/aianalysis/main.go:387-435 | cmd/authwebhook/main.go:379-427 | cmd/signalprocessing/main.go:559-607 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 49 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 (50 corresponding lines) · ×1
Edited copy of a member (50 corresponding lines) cmd/effectivenessmonitor/main.go:738— cmd/effectivenessmonitor/main.go:738-787 | cmd/remediationorchestrator/main.go:815-869 — These two members are one piece of code written twice and then edited apart: 50 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, 53+ corresponding lines) · ×1
Edited copies of one member (3 members, 53+ corresponding lines) pkg/remediationorchestrator/creator/aianalysis.go:112— pkg/remediationorchestrator/creator/aianalysis.go:112-169 | pkg/remediationorchestrator/creator/signalprocessing.go:110-162 | pkg/remediationorchestrator/creator/workflowexecution.go:199-259 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 53 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 (48 corresponding lines) · ×1
Edited copy of a member (48 corresponding lines) internal/kubernautagent/audit/ds_buffered_store.go:90— internal/kubernautagent/audit/ds_buffered_store.go:90-137 | internal/kubernautagent/audit/ds_store.go:42-92 — These two members are one piece of code written twice and then edited apart: 48 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 (40 corresponding lines) · ×1
Edited copy of a member (40 corresponding lines) internal/kubernautagent/enrichment/k8s_adapter.go:261— internal/kubernautagent/enrichment/k8s_adapter.go:261-300 | pkg/kubernautagent/tools/k8s/resolver.go:215-254 — These two members are one piece of code written twice and then edited apart: 40 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 (51 corresponding lines) · ×1
Edited copy of a member (51 corresponding lines) pkg/aianalysis/audit/audit.go:167— pkg/aianalysis/audit/audit.go:167-217 | pkg/aianalysis/audit/audit.go:688-739 — These two members are one piece of code written twice and then edited apart: 51 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, 48+ corresponding lines) · ×1
Edited copies of one member (3 members, 48+ corresponding lines) pkg/gateway/audit_emission.go:154— pkg/gateway/audit_emission.go:154-234 | pkg/gateway/audit_emission.go:238-303 | pkg/gateway/audit_emission.go:307-354 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 48 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 (44 corresponding lines) · ×1
Edited copy of a member (44 corresponding lines) cmd/signalprocessing/main.go:288— cmd/signalprocessing/main.go:288-339 | cmd/workflowexecution/main.go:474-517 — These two members are one piece of code written twice and then edited apart: 44 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, 52+ corresponding lines) · ×1
Edited copies of one member (3 members, 52+ corresponding lines) pkg/notification/delivery/pagerduty.go:49— pkg/notification/delivery/pagerduty.go:49-100 | pkg/notification/delivery/slack.go:52-112 | pkg/notification/delivery/teams.go:41-92 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 52 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 (37 corresponding lines) · ×1
Edited copy of a member (37 corresponding lines) internal/kubernautagent/agentsession/mapping.go:312— internal/kubernautagent/agentsession/mapping.go:312-348 | pkg/aianalysis/handlers/evidence_status.go:24-60 — These two members are one piece of code written twice and then edited apart: 37 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 (53 corresponding lines) · ×1
Edited copy of a member (53 corresponding lines) pkg/datastorage/dlq/client_consumer.go:51— pkg/datastorage/dlq/client_consumer.go:51-111 | pkg/datastorage/dlq/client_consumer.go:162-214 — These two members are one piece of code written twice and then edited apart: 53 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 (64 corresponding lines) · ×1
Edited copy of a member (64 corresponding lines) pkg/notification/metrics/metrics.go:110— pkg/notification/metrics/metrics.go:110-173 | pkg/notification/metrics/metrics.go:212-275 — These two members are one piece of code written twice and then edited apart: 64 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 (55 corresponding lines) · ×1
Edited copy of a member (55 corresponding lines) pkg/datastorage/repository/audit_events_query.go:97— pkg/datastorage/repository/audit_events_query.go:97-151 | pkg/datastorage/repository/audit_export.go:176-232 — These two members are one piece of code written twice and then edited apart: 55 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, 46+ corresponding lines) · ×1
Edited copies of one member (3 members, 46+ corresponding lines) internal/controller/notification/routing_handler.go:264— internal/controller/notification/routing_handler.go:264-309 | internal/controller/notification/routing_handler.go:314-364 | internal/controller/notification/routing_handler.go:369-414 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 46 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 copies of one member (4 members, 44+ corresponding lines) · ×1
Edited copies of one member (4 members, 44+ corresponding lines) pkg/notification/audit/manager.go:142— pkg/notification/audit/manager.go:142-193 | pkg/notification/audit/manager.go:212-265 | pkg/notification/audit/manager.go:282-325 | pkg/notification/audit/manager.go:342-386 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 44 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (52 corresponding lines) · ×1
Edited copy of a member (52 corresponding lines) cmd/kubernautagent/llm_builder.go:301— cmd/kubernautagent/llm_builder.go:301-357 | pkg/apifrontend/launcher/model.go:355-406 — These two members are one piece of code written twice and then edited apart: 52 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 (47 corresponding lines) · ×1
Edited copy of a member (47 corresponding lines) internal/controller/notification/notificationrequest_controller.go:1143— internal/controller/notification/notificationrequest_controller.go:1143-1192 | internal/controller/notification/notificationrequest_controller.go:1349-1395 — These two members are one piece of code written twice and then edited apart: 47 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, 31+ corresponding lines) · ×1
Edited copies of one member (3 members, 31+ corresponding lines) internal/controller/notification/notificationrequest_controller.go:488— internal/controller/notification/notificationrequest_controller.go:488-533 | internal/controller/notification/notificationrequest_controller.go:542-581 | internal/controller/notification/notificationrequest_controller.go:592-622 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 31 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 (46 corresponding lines) · ×1
Edited copy of a member (46 corresponding lines) internal/kubernautagent/investigator/investigator_phases.go:399— internal/kubernautagent/investigator/investigator_phases.go:399-444 | pkg/datastorage/models/workflow_labels.go:128-173 — These two members are one piece of code written twice and then edited apart: 46 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 (87 corresponding lines) · ×1
Edited copy of a member (87 corresponding lines) api/agentsession/v1alpha1/evidence_types.go:20— api/agentsession/v1alpha1/evidence_types.go:20-106 | api/aianalysis/v1alpha1/evidence_types.go:20-106 — These two members are one piece of code written twice and then edited apart: 87 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 (5 members, 30+ corresponding lines) · ×1
Edited copies of one member (5 members, 30+ corresponding lines) pkg/aianalysis/audit/audit.go:451— pkg/aianalysis/audit/audit.go:451-480 | pkg/authwebhook/audit_helpers.go:88-119 | pkg/effectivenessmonitor/audit/manager.go:770-804 | pkg/signalprocessing/audit/client.go:552-581 | pkg/workflowexecution/audit/manager.go:785-819 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 27+ corresponding lines) · ×1
Edited copies of one member (4 members, 27+ corresponding lines) pkg/workflowexecution/executor/awx_client.go:103— pkg/workflowexecution/executor/awx_client.go:103-129 | pkg/workflowexecution/executor/awx_client.go:160-193 | pkg/workflowexecution/executor/awx_client.go:247-282 | pkg/workflowexecution/executor/awx_client.go:397-431 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 27 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 4 times and the copies 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) pkg/aianalysis/audit/audit.go:126— pkg/aianalysis/audit/audit.go:126-161 | pkg/aianalysis/audit/audit.go:262-291 | pkg/aianalysis/audit/audit.go:296-332 — 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 copies of one member (3 members, 27+ corresponding lines) · ×1
Edited copies of one member (3 members, 27+ corresponding lines) pkg/remediationorchestrator/creator/notification.go:353— pkg/remediationorchestrator/creator/notification.go:353-386 | pkg/remediationorchestrator/creator/notification.go:899-938 | pkg/remediationorchestrator/creator/notification.go:1204-1230 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 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 copies of one member (3 members, 24+ corresponding lines) · ×1
Edited copies of one member (3 members, 24+ corresponding lines) pkg/remediationorchestrator/audit/manager.go:200— pkg/remediationorchestrator/audit/manager.go:200-225 | pkg/remediationorchestrator/audit/manager.go:234-257 | pkg/remediationorchestrator/audit/manager.go:770-796 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 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 (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) internal/kubernautagent/server/http_metrics.go:33— internal/kubernautagent/server/http_metrics.go:33-60 | pkg/gateway/middleware/http_metrics.go:45-71 — These two members are one piece of code written twice and then edited apart: 27 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 (4 members, 34+ corresponding lines) · ×1
Edited copies of one member (4 members, 34+ corresponding lines) internal/controller/remediationorchestrator/audit_events.go:201— internal/controller/remediationorchestrator/audit_events.go:201-234 | internal/controller/remediationorchestrator/audit_events.go:308-344 | internal/controller/remediationorchestrator/audit_events.go:350-386 | internal/controller/remediationorchestrator/audit_events.go:392-430 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 34 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 22+ corresponding lines) · ×1
Edited copies of one member (4 members, 22+ corresponding lines) cmd/kubernautagent/llm_builder.go:80— cmd/kubernautagent/llm_builder.go:80-101 | cmd/kubernautagent/llm_builder.go:106-127 | cmd/kubernautagent/llm_builder.go:134-163 | cmd/kubernautagent/llm_builder.go:184-210 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 22 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 18+ corresponding lines) · ×1
Edited copies of one member (4 members, 18+ corresponding lines) pkg/effectivenessmonitor/client/alertmanager_http.go:78— pkg/effectivenessmonitor/client/alertmanager_http.go:78-95 | pkg/effectivenessmonitor/client/prometheus_http.go:107-124 | pkg/workflowexecution/executor/awx_client.go:131-152 | pkg/workflowexecution/executor/awx_client.go:331-352 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 18 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 15+ corresponding lines) · ×1
Edited copies of one member (4 members, 15+ corresponding lines) pkg/notification/audit/manager.go:398— pkg/notification/audit/manager.go:398-412 | pkg/notification/audit/manager.go:418-433 | pkg/remediationorchestrator/audit/manager.go:1031-1045 | pkg/remediationorchestrator/audit/manager.go:1051-1066 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 14+ corresponding lines) · ×1
Edited copies of one member (7 members, 14+ corresponding lines) docs/architecture/spikes/hitl-permission/main.go:621— docs/architecture/spikes/hitl-permission/main.go:621-635 | docs/architecture/spikes/hitl-permission/main.go:637-654 | docs/architecture/spikes/run-state-persistence/main.go:601-616 | docs/architecture/spikes/shadow-acp/main.go:751-766 | docs/architecture/spikes/shadow-acp/main.go:768-784 | docs/architecture/spikes/shadow-acp/main.go:786-801 | docs/architecture/spikes/shadow-acp/main.go:803-816 — These 7 members are one piece of code written 7 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 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 37+ corresponding lines) · ×1
Edited copies of one member (3 members, 37+ corresponding lines) docs/architecture/spikes/hitl-permission/main.go:18— docs/architecture/spikes/hitl-permission/main.go:18-61 | docs/architecture/spikes/run-state-persistence/main.go:39-75 | docs/architecture/spikes/shadow-acp/main.go:25-74 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 37 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 copies of one member (3 members, 12+ corresponding lines) · ×1
Edited copies of one member (3 members, 12+ corresponding lines) pkg/datastorage/server/effectiveness_handler.go:164— pkg/datastorage/server/effectiveness_handler.go:164-175 | pkg/datastorage/server/effectiveness_handler.go:179-190 | pkg/datastorage/server/effectiveness_handler.go:194-205 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 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 (61 corresponding lines) · ×1
Edited copy of a member (61 corresponding lines) pkg/gateway/adapters/testing_exports.go:36— pkg/gateway/adapters/testing_exports.go:36-96 | pkg/gateway/adapters/testing_exports.go:116-176 — These two members are one piece of code written twice and then edited apart: 61 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 (4 members, 12+ corresponding lines) · ×1
Edited copies of one member (4 members, 12+ corresponding lines) internal/kubernautagent/investigator/investigator_anomaly_scope.go:98— internal/kubernautagent/investigator/investigator_anomaly_scope.go:98-111 | internal/kubernautagent/mcp/disconnect_handler.go:240-251 | internal/kubernautagent/session/store.go:356-369 | pkg/datastorage/server/dlq_retry_worker.go:280-292 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 6+ corresponding lines) · ×1
Edited copies of one member (4 members, 6+ corresponding lines) pkg/apifrontend/audit/store_adapter.go:30— pkg/apifrontend/audit/store_adapter.go:30-35 | pkg/apifrontend/handler/console_access.go:28-37 | pkg/apifrontend/handler/console_policyread.go:35-40 | pkg/apifrontend/handler/status_handler.go:42-52 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 7+ corresponding lines) · ×1
Edited copies of one member (3 members, 7+ corresponding lines) internal/kubernautagent/alignment/evaluator.go:59— internal/kubernautagent/alignment/evaluator.go:59-65 | internal/kubernautagent/mcp/tools/complete_no_action.go:154-160 | internal/kubernautagent/mcp/tools/select_workflow.go:381-387 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 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 copies of one member (4 members, 7+ corresponding lines) · ×1
Edited copies of one member (4 members, 7+ corresponding lines) internal/kubernautagent/mcp/session_manager.go:279— internal/kubernautagent/mcp/session_manager.go:279-288 | internal/kubernautagent/mcp/tools/select_workflow.go:791-800 | pkg/apifrontend/launcher/completion.go:141-147 | pkg/workflowexecution/executor/job.go:313-319 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 8+ corresponding lines) · ×1
Edited copies of one member (3 members, 8+ corresponding lines) pkg/aianalysis/phase/types.go:131— pkg/aianalysis/phase/types.go:131-138 | pkg/effectivenessmonitor/phase/types.go:95-102 | pkg/signalprocessing/phase/types.go:118-125 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 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.
Duplicated block (73 lines × 2) api/agentsession/v1alpha1/evidence_types.go:34— api/agentsession/v1alpha1/evidence_types.go:34-106 | api/aianalysis/v1alpha1/evidence_types.go:34-106 — before extracting anything, compare `api/agentsession/v1alpha1/evidence_types.go` and `api/aianalysis/v1alpha1/evidence_types.go` as WHOLE FILES: 98% 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 2 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `api/agentsession/v1alpha1/evidence_types.go:34` 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 (50 lines × 2) pkg/notification/metrics/metrics.go:111— pkg/notification/metrics/metrics.go:111-160 | pkg/notification/metrics/metrics.go:213-262 — 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.
Duplicated block (41 lines × 2) internal/kubernautagent/audit/ds_buffered_store.go:94— internal/kubernautagent/audit/ds_buffered_store.go:94-134 | internal/kubernautagent/audit/ds_store.go:46-86 — 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 (23–41 lines × 2) pkg/audit/openapi_client_adapter.go:127— pkg/audit/openapi_client_adapter.go:127-167 | pkg/effectivenessmonitor/client/ds_querier.go:61-83 — 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 `pkg/audit/openapi_client_adapter.go:127` 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 (36–38 lines × 2) internal/controller/workflowexecution/workflowexecution_status_marking.go:51— internal/controller/workflowexecution/workflowexecution_status_marking.go:51-88 | pkg/workflowexecution/executor/tekton.go:291-326 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Check import visibility before settling on that home: `internal/controller/workflowexecution/workflowexecution_status_marking.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
Duplicated block (37 lines × 3) cmd/aianalysis/main.go:399— cmd/aianalysis/main.go:399-435 | cmd/authwebhook/main.go:391-427 | cmd/signalprocessing/main.go:571-607 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/aianalysis/main.go:399` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `configPath` in one and `configFile` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (36 lines × 2) cmd/aianalysis/main.go:90— cmd/aianalysis/main.go:90-125 | cmd/remediationorchestrator/main.go:91-126 — 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 `cmd/aianalysis/main.go:90` 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 (25–35 lines × 2) internal/controller/effectivenessmonitor/assess_components.go:202— internal/controller/effectivenessmonitor/assess_components.go:202-226 | pkg/effectivenessmonitor/audit/manager.go:241-275 — 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 `internal/controller/effectivenessmonitor/assess_components.go:202` 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. Check import visibility before settling on that home: `internal/controller/effectivenessmonitor/assess_components.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
Duplicated block (34 lines × 3) api/agentsession/v1alpha1/evidence_types.go:20— api/agentsession/v1alpha1/evidence_types.go:20-53 | api/aianalysis/v1alpha1/evidence_types.go:20-53 | pkg/kubernautagent/types/evidence.go:63-96 — before extracting anything, compare `api/agentsession/v1alpha1/evidence_types.go` and `api/aianalysis/v1alpha1/evidence_types.go` as WHOLE FILES: 98% 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 2 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (22–32 lines × 2) pkg/gateway/audit_emission.go:166— pkg/gateway/audit_emission.go:166-197 | pkg/gateway/audit_emission.go:250-271 — 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 `pkg/gateway/audit_emission.go:166` 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 (31 lines × 2) pkg/workflowexecution/executor/awx_client.go:71— pkg/workflowexecution/executor/awx_client.go:71-101 | pkg/workflowexecution/executor/awx_client.go:365-395 — 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 `pkg/workflowexecution/executor/awx_client.go: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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (24–30 lines × 2) pkg/signalprocessing/audit/client.go:174— pkg/signalprocessing/audit/client.go:174-203 | pkg/signalprocessing/audit/client.go:322-345 — 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.
Duplicated block (25–29 lines × 2) pkg/gateway/signal_ingestion.go:140— pkg/gateway/signal_ingestion.go:140-168 | pkg/gateway/signal_ingestion.go:246-270 — 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 `pkg/gateway/signal_ingestion.go:140` 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (24–27 lines × 2) pkg/gateway/processing/distributed_lock.go:156— pkg/gateway/processing/distributed_lock.go:156-182 | pkg/remediationorchestrator/locking/distributed_lock.go:71-94 — before extracting anything, compare `pkg/gateway/processing/distributed_lock.go` and `pkg/remediationorchestrator/locking/distributed_lock.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (25 lines × 2) pkg/fleet/registry/eaigw_registry.go:330— pkg/fleet/registry/eaigw_registry.go:330-354 | pkg/fleet/registry/kuadrant_registry.go:249-273 — before extracting anything, compare `pkg/fleet/registry/eaigw_registry.go` and `pkg/fleet/registry/kuadrant_registry.go` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 114 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (19–22 lines × 2) pkg/notification/status/manager.go:159— pkg/notification/status/manager.go:159-177 | pkg/notification/status/manager.go:273-294 — 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.
Duplicated block (21 lines × 3) internal/config/aianalysis/config.go:138— internal/config/aianalysis/config.go:138-158 | internal/config/effectivenessmonitor/config.go:155-175 | internal/config/remediationorchestrator/config.go:318-338 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (18–20 lines × 2) cmd/apifrontend/backend_deps.go:950— cmd/apifrontend/backend_deps.go:950-967 | pkg/apifrontend/ka/rest_client.go:68-87 — 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 `cmd/apifrontend/backend_deps.go:950` 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 (19 lines × 3) docs/architecture/spikes/hitl-permission/main.go:88— docs/architecture/spikes/hitl-permission/main.go:88-106 | docs/architecture/spikes/run-state-persistence/main.go:102-120 | docs/architecture/spikes/shadow-acp/main.go:101-119 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (18 lines × 4) internal/kubernautagent/server/ratelimit.go:127— internal/kubernautagent/server/ratelimit.go:127-144 | internal/kubernautagent/server/user_ratelimit.go:99-116 | pkg/apifrontend/ratelimit/ratelimit.go:84-101 | pkg/datastorage/server/middleware/ratelimit.go:102-119 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Check import visibility before settling on that home: `internal/kubernautagent/server/ratelimit.go`, `internal/kubernautagent/server/user_ratelimit.go` sit under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
Duplicated block (17–18 lines × 2) pkg/authwebhook/notificationrequest_handler.go:85— pkg/authwebhook/notificationrequest_handler.go:85-101 | pkg/authwebhook/notificationrequest_validator.go:111-128 — 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 (15–16 lines × 5) cmd/aianalysis/main.go:402— cmd/aianalysis/main.go:402-416 | cmd/authwebhook/main.go:394-408 | cmd/effectivenessmonitor/main.go:754-768 | cmd/remediationorchestrator/main.go:833-848 | cmd/signalprocessing/main.go:574-588 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/aianalysis/main.go:402` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `configPath` in one and `configFile` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (16 lines × 3) pkg/effectivenessmonitor/audit/manager.go:174— pkg/effectivenessmonitor/audit/manager.go:174-189 | pkg/effectivenessmonitor/audit/manager.go:514-529 | pkg/effectivenessmonitor/audit/manager.go:598-613 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/effectivenessmonitor/audit/manager.go:174` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/effectivenessmonitor/audit/manager.go:513` calls `storeEvent` and `pkg/effectivenessmonitor/audit/manager.go:171` 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 (14–16 lines × 2) pkg/remediationorchestrator/audit/manager.go:408— pkg/remediationorchestrator/audit/manager.go:408-423 | pkg/remediationorchestrator/audit/manager.go:476-489 — 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 `pkg/remediationorchestrator/audit/manager.go:408` 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 (13–15 lines × 2) internal/kubernautagent/alignment/llmproxy.go:43— internal/kubernautagent/alignment/llmproxy.go:43-57 | internal/kubernautagent/alignment/llmproxy.go:63-75 — 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 `internal/kubernautagent/alignment/llmproxy.go:43` 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. 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 (12–15 lines × 2) pkg/gateway/processing/distributed_lock.go:198— pkg/gateway/processing/distributed_lock.go:198-212 | pkg/remediationorchestrator/locking/distributed_lock.go:119-130 — before extracting anything, compare `pkg/gateway/processing/distributed_lock.go` and `pkg/remediationorchestrator/locking/distributed_lock.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13–14 lines × 2) pkg/fleet/mcpclient/discover.go:87— pkg/fleet/mcpclient/discover.go:87-100 | pkg/fleet/mcpclient/discover.go:151-163 — 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 `pkg/fleet/mcpclient/discover.go:87` 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. 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 (12–13 lines × 9) internal/controller/remediationorchestrator/notification_creation.go:224— internal/controller/remediationorchestrator/notification_creation.go:224-235 | internal/controller/remediationorchestrator/timeout_handling.go:190-201 | pkg/remediationorchestrator/creator/notification.go:227-239 | pkg/remediationorchestrator/creator/notification.go:449-461 | pkg/remediationorchestrator/creator/notification.go:590-602 | pkg/remediationorchestrator/creator/notification.go:758-769 | pkg/remediationorchestrator/creator/notification.go:819-830 | pkg/remediationorchestrator/creator/notification.go:950-962 | pkg/remediationorchestrator/creator/notification.go:1243-1254 — there are 9 copies across 3 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 9 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `internal/controller/remediationorchestrator/notification_creation.go:224` 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. Check import visibility before settling on that home: `internal/controller/remediationorchestrator/notification_creation.go`, `internal/controller/remediationorchestrator/timeout_handling.go` sit under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/remediationorchestrator/creator/notification.go:754` calls `Sprintf`, `buildEscalationBody` and `pkg/remediationorchestrator/creator/notification.go:585` 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–13 lines × 2) pkg/aianalysis/audit/audit.go:194— pkg/aianalysis/audit/audit.go:194-206 | pkg/aianalysis/audit/audit.go:717-728 — 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 `pkg/aianalysis/audit/audit.go:194` 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 (10–12 lines × 2) pkg/datastorage/dlq/client_consumer.go:52— pkg/datastorage/dlq/client_consumer.go:52-63 | pkg/datastorage/dlq/client_consumer.go:163-172 — 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.
Duplicated block (10–11 lines × 3) pkg/datastorage/dlq/client.go:223— pkg/datastorage/dlq/client.go:223-233 | pkg/datastorage/dlq/client.go:281-291 | pkg/datastorage/dlq/client_consumer.go:308-317 — 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 `pkg/datastorage/dlq/client.go:223` 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 (9–11 lines × 2) pkg/remediationorchestrator/handler/aianalysis.go:165— pkg/remediationorchestrator/handler/aianalysis.go:165-175 | pkg/remediationorchestrator/handler/aianalysis.go:366-374 — 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.
Duplicated block (6–10 lines × 3) cmd/authwebhook/main.go:166— cmd/authwebhook/main.go:166-175 | cmd/workflowexecution/main.go:418-426 | pkg/gateway/server_constructors.go:515-520 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/authwebhook/main.go:166` 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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: `pkg/gateway/server_constructors.go:515` is reached only past a guard at line 487 that tests `cfg.DataStorage.URL` and leaves the function early, and `cmd/authwebhook/main.go:166` reads `cfg.DataStorage.URL` with no such check. What separates these copies is not which lines they run but which PRECONDITION they enforce, so one of them is operating on state the other one refuses. Decide which is intended BEFORE unifying them — extract the shared part and whichever copy is missing the check keeps running unchecked, and if the guard is the correct behaviour then that hole is already live.
Duplicated block (8–10 lines × 2) internal/kubernautagent/enrichment/label_detector.go:206— internal/kubernautagent/enrichment/label_detector.go:206-213 | pkg/apifrontend/tools/resource_reader.go:86-95 — 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. Check import visibility before settling on that home: `internal/kubernautagent/enrichment/label_detector.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
Duplicated block (9 lines × 5) pkg/remediationorchestrator/audit/manager.go:149— pkg/remediationorchestrator/audit/manager.go:149-157 | pkg/remediationorchestrator/audit/manager.go:274-282 | pkg/remediationorchestrator/audit/manager.go:357-365 | pkg/remediationorchestrator/audit/manager.go:407-415 | pkg/remediationorchestrator/audit/manager.go:840-848 — all 5 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/remediationorchestrator/audit/manager.go:416` calls `SetDuration` and `pkg/remediationorchestrator/audit/manager.go:284` 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 (8–9 lines × 2) cmd/notification/main.go:812— cmd/notification/main.go:812-820 | cmd/workflowexecution/main.go:440-447 — 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 `cmd/notification/main.go:812` 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 × 6) pkg/effectivenessmonitor/audit/manager.go:184— pkg/effectivenessmonitor/audit/manager.go:184-191 | pkg/effectivenessmonitor/audit/manager.go:376-383 | pkg/effectivenessmonitor/audit/manager.go:524-531 | pkg/effectivenessmonitor/audit/manager.go:608-615 | pkg/effectivenessmonitor/audit/manager.go:682-689 | pkg/effectivenessmonitor/audit/manager.go:731-738 — all 6 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 (5 lines × 4) docs/architecture/spikes/hitl-permission/main.go:286— docs/architecture/spikes/hitl-permission/main.go:286-290 | docs/architecture/spikes/run-state-persistence/main.go:283-287 | docs/architecture/spikes/shadow-acp/main.go:406-410 | docs/spikes/oas-runtime/internal/acp/server.go:277-281 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 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 4 times. Check import visibility before settling on that home: `docs/spikes/oas-runtime/internal/acp/server.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
Duplicated block (12 lines × 6) pkg/aianalysis/phase/types.go:113— pkg/aianalysis/phase/types.go:113-124 | pkg/effectivenessmonitor/phase/types.go:81-92 | pkg/notification/phase/types.go:138-149 | pkg/remediationorchestrator/phase/types.go:112-123 | pkg/signalprocessing/phase/types.go:103-114 | pkg/workflowexecution/phase/types.go:116-127 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 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 6 times.
Duplicated block (9 lines × 6) pkg/remediationapprovalrequest/conditions.go:136— pkg/remediationapprovalrequest/conditions.go:136-144 | pkg/remediationapprovalrequest/conditions.go:156-164 | pkg/remediationrequest/conditions.go:184-192 | pkg/remediationrequest/conditions.go:204-212 | pkg/remediationrequest/conditions.go:224-232 | pkg/remediationrequest/conditions.go:255-263 — `pkg/remediationapprovalrequest/conditions.go` and `pkg/remediationrequest/conditions.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 30 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind `bool` to `pending` in one and `expired` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (14 lines × 3) pkg/apifrontend/severity/anthropic.go:113— pkg/apifrontend/severity/anthropic.go:113-126 | pkg/apifrontend/severity/llm.go:86-99 | pkg/apifrontend/severity/openai_compatible.go:85-98 — 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 `pkg/apifrontend/severity/anthropic.go:113` 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. 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 (6 lines × 6) internal/controller/remediationorchestrator/blocked_transitions.go:156— internal/controller/remediationorchestrator/blocked_transitions.go:156-161 | internal/controller/remediationorchestrator/blocked_transitions.go:188-193 | internal/controller/remediationorchestrator/blocking.go:185-190 | internal/controller/remediationorchestrator/notification_creation.go:113-118 | internal/controller/remediationorchestrator/notification_creation.go:167-172 | internal/controller/remediationorchestrator/terminal_transitions.go:672-677 — there are 6 copies across 4 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 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `internal/controller/remediationorchestrator/blocked_transitions.go:156` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: `internal/controller/remediationorchestrator/notification_creation.go:113` is reached only past a guard at line 85 that tests `rr.Namespace` and leaves the function early, and `internal/controller/remediationorchestrator/blocked_transitions.go:156` reads `rr.Namespace` with no such check. What separates these copies is not which lines they run but which PRECONDITION they enforce, so one of them is operating on state the other one refuses. Decide which is intended BEFORE unifying them — extract the shared part and whichever copy is missing the check keeps running unchecked, and if the guard is the correct behaviour then that hole is already live.
Duplicated block (5 lines × 5) internal/controller/remediationorchestrator/blocked_transitions.go:151— internal/controller/remediationorchestrator/blocked_transitions.go:151-155 | internal/controller/remediationorchestrator/blocking.go:179-184 | internal/controller/remediationorchestrator/notification_creation.go:108-112 | internal/controller/remediationorchestrator/notification_creation.go:162-166 | internal/controller/remediationorchestrator/terminal_transitions.go:667-671 — there are 5 copies across 4 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 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `internal/controller/remediationorchestrator/blocked_transitions.go:151` 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: `internal/controller/remediationorchestrator/notification_creation.go:108` is reached only past a guard at line 85 that tests `rr.Namespace` and leaves the function early, and `internal/controller/remediationorchestrator/blocked_transitions.go:151` reads `rr.Namespace` with no such check. What separates these copies is not which lines they run but which PRECONDITION they enforce, so one of them is operating on state the other one refuses. Decide which is intended BEFORE unifying them — extract the shared part and whichever copy is missing the check keeps running unchecked, and if the guard is the correct behaviour then that hole is already live.
Duplicated block (7 lines × 7) internal/controller/remediationorchestrator/blocked_transitions.go:154— internal/controller/remediationorchestrator/blocked_transitions.go:154-160 | internal/controller/remediationorchestrator/blocked_transitions.go:186-192 | internal/controller/remediationorchestrator/blocking.go:183-189 | internal/controller/remediationorchestrator/notification_creation.go:111-117 | internal/controller/remediationorchestrator/notification_creation.go:165-171 | internal/controller/remediationorchestrator/notification_creation.go:296-302 | internal/controller/remediationorchestrator/terminal_transitions.go:670-676 — there are 7 copies across 4 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 7 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: `internal/controller/remediationorchestrator/notification_creation.go:111` is reached only past a guard at line 85 that tests `rr.Namespace` and leaves the function early, and `internal/controller/remediationorchestrator/blocked_transitions.go:154` reads `rr.Namespace` with no such check. What separates these copies is not which lines they run but which PRECONDITION they enforce, so one of them is operating on state the other one refuses. Decide which is intended BEFORE unifying them — extract the shared part and whichever copy is missing the check keeps running unchecked, and if the guard is the correct behaviour then that hole is already live.
D4 · Code Duplication· Edited copy of a member (30 corresponding lines) · ×1
Edited copy of a member (30 corresponding lines) scripts/validation/check-openapi-crd-enum-drift/main.go:206— scripts/validation/check-openapi-crd-enum-drift/main.go:206-235 | scripts/validation/check-openapi-crd-enum-drift/main.go:304-341 — These two members are one piece of code written twice and then edited apart: 30 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.
X19 · Unrestored process-global state· Process-global state is restored only on the happy path · ×1
Process-global state is restored only on the happy path pkg/shared/tls/tls.go:328— this function literal changes state that belongs to the whole PROCESS and changes it back at the end of the same body — the `SSL_CERT_FILE` environment variable (set at line 330, cleared at line 332) and the `SSL_CERT_DIR` environment variable (set at line 335, cleared at line 337) and the `TLS_CA_FILE` environment variable (set at line 340, cleared at line 342) — which says the change was meant to last no longer than this call. But the restore is an ordinary statement on the straight-line path, so anything that leaves the body in between — an error, an early return, a crash — skips it: the process then keeps the overwritten value for the rest of its life, and every later relative path, child-process launch or configuration read in ANY code resolves against it. That failure is silent and remote from its cause — the function that breaks is not the function that moved the value. The window is not private while it is open either: the working directory and the environment are per-process, so every concurrent thread or Go process in it sees the moved value too. The durable fix is not to widen the restore but to stop mutating the global: give the child its own directory and environment (`exec.Cmd.Dir`, `exec.Cmd.Env`), or build absolute paths with `filepath.Join`. Where the global genuinely must move, put the restore in a `defer` right after the change, so it runs on every return and on a panic.
X27 · Collection changed while being enumerated· Collection is structurally changed while it is being enumerated · ×1
Collection is structurally changed while it is being enumerated pkg/remediationapprovalrequest/parameters.go:143— `schema` is walked by the `for … range` at line 143, and line 147 appends to `schema`. A range evaluates its slice once and walks the length it had when the loop began, so the elements appended here are never visited by this loop — work queued for it is silently dropped.
Minor — 642 finding(s)
D20 · ADR Quality· ADR lacks an enforcement field · ×368
ADR lacks an enforcement field docs/architecture/decisions/001-crd-api-group-rationale.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/002-e2e-gitops-strategy.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/003-gitops-priority-order.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/004-metrics-authentication.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/005-owner-reference-architecture.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/006-effectiveness-monitor-v1-inclusion.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/007-gateway-br-legacy-mapping.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/008-gateway-br-standardization.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/011-remediationprocessor-br-migration.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/012-kubernetesexecutor-br-migration.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/013-remediationorchestrator-br-migration.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/ADR-001-crd-microservices-architecture.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/ADR-002-native-kubernetes-jobs.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/ADR-003-KIND-INTEGRATION-ENVIRONMENT.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/ADR-004-fake-kubernetes-client.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/ADR-005-integration-test-coverage.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/ADR-014-notification-service-external-auth.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/ADR-015-alert-to-signal-naming-migration.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/ADR-016-validation-responsibility-chain.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/ADR-017-notification-crd-creator.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/ADR-018-approval-notification-v1-integration.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/ADR-019-aianalysis-error-classification-retry-strategy.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/ADR-020-workflow-parallel-execution-limits.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/ADR-021-AI-DRIVEN-CYCLE-CORRECTION-ASSESSMENT.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR lacks an enforcement field docs/architecture/decisions/ADR-021-workflow-dependency-cycle-detection.md:1— Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
ADR declares no status docs/architecture/decisions/011-remediationprocessor-br-migration.md:1— `docs/architecture/decisions/011-remediationprocessor-br-migration.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/013-remediationorchestrator-br-migration.md:1— `docs/architecture/decisions/013-remediationorchestrator-br-migration.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/ADR-036-authentication-authorization-strategy.md:1— `docs/architecture/decisions/ADR-036-authentication-authorization-strategy.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/ADR-040-remediation-approval-request-architecture.md:1— `docs/architecture/decisions/ADR-040-remediation-approval-request-architecture.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/ADR-048-rate-limiting-proxy-delegation.md:1— `docs/architecture/decisions/ADR-048-rate-limiting-proxy-delegation.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/DD-002-per-step-validation-framework.md:1— `docs/architecture/decisions/DD-002-per-step-validation-framework.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/DD-003-forced-recommendation-manual-override.md:1— `docs/architecture/decisions/DD-003-forced-recommendation-manual-override.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/DD-007-graceful-shutdown.md:1— `docs/architecture/decisions/DD-007-graceful-shutdown.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/DD-007-kubernetes-aware-graceful-shutdown.md:1— `docs/architecture/decisions/DD-007-kubernetes-aware-graceful-shutdown.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/DD-008-integration-test-infrastructure-v2.md:1— `docs/architecture/decisions/DD-008-integration-test-infrastructure-v2.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/DD-008-integration-test-infrastructure.md:1— `docs/architecture/decisions/DD-008-integration-test-infrastructure.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/DD-013-kubernetes-client-initialization-standard.md:1— `docs/architecture/decisions/DD-013-kubernetes-client-initialization-standard.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/DD-014-binary-version-logging-standard.md:1— `docs/architecture/decisions/DD-014-binary-version-logging-standard.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/DD-015-timestamp-based-crd-naming.md:1— `docs/architecture/decisions/DD-015-timestamp-based-crd-naming.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/DD-016-dynamic-toolset-v2-deferral.md:1— `docs/architecture/decisions/DD-016-dynamic-toolset-v2-deferral.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/DD-018-helm-chart-single-install-per-cluster-guard.md:1— `docs/architecture/decisions/DD-018-helm-chart-single-install-per-cluster-guard.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/DD-AIANALYSIS-001-rego-policy-loading-strategy.md:1— `docs/architecture/decisions/DD-AIANALYSIS-001-rego-policy-loading-strategy.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/DD-AIANALYSIS-002-rego-policy-startup-validation.md:1— `docs/architecture/decisions/DD-AIANALYSIS-002-rego-policy-startup-validation.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/DD-AIANALYSIS-2586-independent-confidence.md:1— `docs/architecture/decisions/DD-AIANALYSIS-2586-independent-confidence.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/DD-API-001-openapi-client-mandatory-v1.md:1— `docs/architecture/decisions/DD-API-001-openapi-client-mandatory-v1.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/DD-DATA-STORAGE-AUDIT-TRAIL-DEFERRAL-ASSESSMENT.md:1— `docs/architecture/decisions/DD-DATA-STORAGE-AUDIT-TRAIL-DEFERRAL-ASSESSMENT.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/DD-FLEET-002-cluster-scoped-workflow-targeting.md:1— `docs/architecture/decisions/DD-FLEET-002-cluster-scoped-workflow-targeting.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/DD-FLEET-008-workflow-declared-execution-cluster.md:1— `docs/architecture/decisions/DD-FLEET-008-workflow-declared-execution-cluster.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/DD-GATEWAY-001-payload-size-limits.md:1— `docs/architecture/decisions/DD-GATEWAY-001-payload-size-limits.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
ADR declares no status docs/architecture/decisions/DD-GATEWAY-002-integration-test-architecture.md:1— `docs/architecture/decisions/DD-GATEWAY-002-integration-test-architecture.md` declares no status, while 326 of the 378 other records in `docs/architecture/decisions` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
Duplicated predicate cmd/apifrontend/backend_deps.go:625— `!cfg.Fleet.Enabled || cfg.Fleet.MCPGatewayEndpoint == ""` appears character-identically in 3 files — cmd/apifrontend/backend_deps.go, cmd/effectivenessmonitor/main.go, cmd/remediationorchestrator/main.go. 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 internal/kubernautagent/enrichment/k8s_adapter.go:235— `!errors.IsNotFound(getErr) && !errors.IsForbidden(getErr)` appears character-identically in 2 files — internal/kubernautagent/enrichment/k8s_adapter.go, pkg/kubernautagent/tools/k8s/resolver.go. 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 pkg/apifrontend/handler/agentcard.go:143— `!interactiveEnabled && tools.SessionDependentTools[t.Name]` appears character-identically in 2 files — pkg/apifrontend/handler/agentcard.go, pkg/apifrontend/handler/mcp.go. 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 pkg/apifrontend/tools/discover_cache.go:34— `!ok || time.Now().After(entry.expiresAt)` appears character-identically in 2 files — pkg/apifrontend/tools/discover_cache.go, pkg/signalprocessing/cache/cache.go. 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 internal/kubernautagent/session/manager_interactive.go:142— `IsTerminal(sess.Status) || sess.Status == StatusUserDriving` appears character-identically in 2 files — internal/kubernautagent/session/manager_interactive.go, internal/kubernautagent/session/store.go. 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 internal/controller/remediationorchestrator/pre_remediation_hash.go:56— `ai != nil && ai.Status.GetRCAResult().RootCauseAnalysis != nil && ai.Status.RCAResult.RootCauseAnalysis.RemediationTarget != nil` appears character-identically in 2 files — internal/controller/remediationorchestrator/pre_remediation_hash.go, pkg/remediationorchestrator/creator/notification.go. 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 internal/controller/remediationorchestrator/analyzing_handler.go:165— `ai.Status.GetReview().NeedsHumanReview && ai.Status.GetRCAResult().SelectedWorkflow == nil` appears character-identically in 2 files — internal/controller/remediationorchestrator/analyzing_handler.go, pkg/remediationorchestrator/handler/aianalysis.go. 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 internal/controller/effectivenessmonitor/target_resources.go:287— `apierrors.IsNotFound(err) || apierrors.IsForbidden(err)` appears character-identically in 2 files — internal/controller/effectivenessmonitor/target_resources.go, internal/controller/remediationorchestrator/pre_remediation_hash.go. 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 internal/kubernautagent/agentsession/dispatcher.go:867— `as.Status.SessionID != "" && as.Status.SessionID != sessionID` appears character-identically in 2 files — internal/kubernautagent/agentsession/dispatcher.go, internal/kubernautagent/agentsession/status_writer.go. 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 pkg/signalprocessing/config/config.go:210— `c.Fleet.Endpoint != "" && !c.Fleet.OAuth2.Enabled` appears character-identically in 2 files — pkg/signalprocessing/config/config.go, pkg/workflowexecution/config/config.go. 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 pkg/apifrontend/config/config.go:425— `c.Server.MetricsPort < 1024 || c.Server.MetricsPort > 65535` appears character-identically in 2 files — pkg/apifrontend/config/config.go, pkg/datastorage/config/config_validate.go. 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 pkg/apifrontend/config/config.go:422— `c.Server.Port < 1024 || c.Server.Port > 65535` appears character-identically in 2 files — pkg/apifrontend/config/config.go, pkg/datastorage/config/config_validate.go. 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 pkg/fleet/mcpclient/auth.go:113— `c.httpClient != nil && c.httpClient.Transport != nil` appears character-identically in 2 files — pkg/fleet/mcpclient/auth.go, pkg/fleet/mcpclient/reloadable_auth.go. 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 cmd/apifrontend/backend_deps.go:281— `cfg.Fleet.Enabled && cfg.Fleet.EffectiveEndpoint() != ""` appears character-identically in 3 files — cmd/apifrontend/backend_deps.go, cmd/remediationorchestrator/main.go, pkg/gateway/server_constructors.go. 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 internal/controller/effectivenessmonitor/reconciler.go:302— `clusterID == "" || r.readerFactory == nil` appears character-identically in 2 files — internal/controller/effectivenessmonitor/reconciler.go, internal/controller/remediationorchestrator/config_accessors.go. 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 pkg/shared/transport/circuit_breaker.go:175— `code == http.StatusBadGateway || code == http.StatusServiceUnavailable || code == http.StatusGatewayTimeout` appears character-identically in 2 files — pkg/shared/transport/circuit_breaker.go, pkg/shared/transport/retry.go. 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 pkg/effectivenessmonitor/conditions/conditions.go:180— `condition != nil && condition.Status == metav1.ConditionTrue` appears character-identically in 3 files — pkg/effectivenessmonitor/conditions/conditions.go, pkg/shared/conditions/conditions.go, pkg/signalprocessing/conditions.go. 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 pkg/notification/delivery/pagerduty_payload.go:73— `ctx.Analysis != nil && ctx.Analysis.RootCause != ""` appears character-identically in 2 files — pkg/notification/delivery/pagerduty_payload.go, pkg/notification/delivery/teams_cards.go. 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 pkg/notification/delivery/pagerduty_payload.go:79— `ctx.Target != nil && ctx.Target.TargetResource != ""` appears character-identically in 2 files — pkg/notification/delivery/pagerduty_payload.go, pkg/notification/delivery/teams_cards.go. 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 pkg/notification/delivery/pagerduty_payload.go:76— `ctx.Workflow != nil && ctx.Workflow.Confidence != ""` appears character-identically in 2 files — pkg/notification/delivery/pagerduty_payload.go, pkg/notification/delivery/teams_cards.go. 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 internal/controller/effectivenessmonitor/reconcile_orchestrate.go:59— `ea.Spec.Config.HashComputeDelay != nil && ea.Spec.Config.HashComputeDelay.Duration > 0` appears character-identically in 2 files — internal/controller/effectivenessmonitor/reconcile_orchestrate.go, pkg/effectivenessmonitor/audit/manager.go. 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 internal/kubernautagent/investigator/investigator.go:989— `enrichData != nil && enrichData.HistoryUnavailable` appears character-identically in 3 files — internal/kubernautagent/investigator/investigator.go, internal/kubernautagent/investigator/investigator_discovery.go, internal/kubernautagent/investigator/investigator_workflow_selection.go. 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 internal/controller/workflowexecution/workflowexecution_lifecycle.go:343— `err != nil && !apierrors.IsNotFound(err)` appears character-identically in 2 files — internal/controller/workflowexecution/workflowexecution_lifecycle.go, pkg/apifrontend/session/service.go. 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 internal/controller/remediationorchestrator/analyzing_handler.go:270— `err != nil && !errors.Is(err, routing.ErrNotBlocked)` appears character-identically in 2 files — internal/controller/remediationorchestrator/analyzing_handler.go, internal/controller/remediationorchestrator/pending_handler.go. 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 internal/kubernautagent/agentsession/mapping.go:400— `err != nil || len(raw) == 0 || string(raw) == "null" || string(raw) == "{}"` appears character-identically in 2 files — internal/kubernautagent/agentsession/mapping.go, pkg/aianalysis/handlers/request_builder.go. 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.
README/code drift docs/README.md:66— docs/README.md links to `value-proposition/README.md`, but `docs/value-proposition/README.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:68— docs/README.md links to `value-proposition/TECHNICAL_SCENARIOS.md`, but `docs/value-proposition/TECHNICAL_SCENARIOS.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:69— docs/README.md links to `value-proposition/V1_VS_V2_CAPABILITIES.md`, but `docs/value-proposition/V1_VS_V2_CAPABILITIES.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:85— docs/README.md links to `development/getting-started/setup/PGVECTOR_SETUP_GUIDE.md`, but `docs/development/getting-started/setup/PGVECTOR_SETUP_GUIDE.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:91— docs/README.md links to `architecture/AI_CONTEXT_ORCHESTRATION_ARCHITECTURE.md`, but `docs/architecture/AI_CONTEXT_ORCHESTRATION_ARCHITECTURE.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:102— docs/README.md links to `architecture/analysis/OSCILLATION_DETECTION_ALGORITHMS.md`, but `docs/architecture/analysis/OSCILLATION_DETECTION_ALGORITHMS.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:114— docs/README.md links to `TESTING_FRAMEWORK.md`, but `docs/TESTING_FRAMEWORK.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:115— docs/README.md links to `development/E2E_TESTING_PLAN.md`, but `docs/development/E2E_TESTING_PLAN.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:127— docs/README.md links to `development/e2e-testing/QUICK_START.md`, but `docs/development/e2e-testing/QUICK_START.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:128— docs/README.md links to `development/e2e-testing/KCLI_QUICK_START.md`, but `docs/development/e2e-testing/KCLI_QUICK_START.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:136— docs/README.md links to `api/testutil/README.md`, but `docs/api/testutil/README.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:143— docs/README.md links to `status/AI_INTEGRATION_VALIDATION.md`, but `docs/status/AI_INTEGRATION_VALIDATION.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:145— docs/README.md links to `status/TODO.md`, but `docs/status/TODO.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:187— docs/README.md links to `specialized/pattern-engine/PATTERN_ENGINE_IMPROVEMENTS.md`, but `docs/specialized/pattern-engine/PATTERN_ENGINE_IMPROVEMENTS.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:188— docs/README.md links to `specialized/pattern-engine/PATTERN_ENGINE_HIGH_RISK_MITIGATION.md`, but `docs/specialized/pattern-engine/PATTERN_ENGINE_HIGH_RISK_MITIGATION.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:189— docs/README.md links to `specialized/pattern-engine/PATTERN_ENGINE_MEDIUM_RISK_MITIGATION.md`, but `docs/specialized/pattern-engine/PATTERN_ENGINE_MEDIUM_RISK_MITIGATION.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:191— docs/README.md links to `specialized/testing-analysis/COMPREHENSIVE_BRITTLENESS_SOLUTION.md`, but `docs/specialized/testing-analysis/COMPREHENSIVE_BRITTLENESS_SOLUTION.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:192— docs/README.md links to `specialized/testing-analysis/BRITTLENESS_ANALYSIS_AND_SOLUTIONS.md`, but `docs/specialized/testing-analysis/BRITTLENESS_ANALYSIS_AND_SOLUTIONS.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:194— docs/README.md links to `specialized/integration-notes/README_INTELLIGENT_WORKFLOW_BUILDER.md`, but `docs/specialized/integration-notes/README_INTELLIGENT_WORKFLOW_BUILDER.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:203— docs/README.md links to `value-proposition/`, but `docs/value-proposition` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:206— docs/README.md links to `ARCHITECTURE.md`, but `docs/ARCHITECTURE.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:208— docs/README.md links to `status/`, but `docs/status` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:209— docs/README.md links to `planning/`, but `docs/planning` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/README.md:210— docs/README.md links to `specialized/`, but `docs/specialized` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/architecture/README.md:42— docs/architecture/README.md links to `KUBERNAUT_IMPLEMENTATION_ROADMAP.md`, but `docs/architecture/KUBERNAUT_IMPLEMENTATION_ROADMAP.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
Interpolated log message defeats structured logging docs/architecture/spikes/goose-mcp-roundtrip/mcp_server.py:19— `info` at line 19 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging docs/architecture/spikes/goose-mcp-roundtrip/mcp_server.py:34— `info` at line 34 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging docs/architecture/spikes/goose-mcp-roundtrip/mcp_server.py:49— `info` at line 49 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging pkg/workflowexecution/executor/ansible.go:701— `Info` at line 701 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging pkg/signalprocessing/enricher/k8s_enricher.go:287— `Info` at line 287 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging pkg/signalprocessing/enricher/k8s_enricher.go:292— `Error` at line 292 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Error("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Error("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Error("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging pkg/remediationorchestrator/creator/notification.go:130— `Info` at line 130 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging pkg/remediationorchestrator/creator/notification.go:158— `Info` at line 158 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging pkg/remediationorchestrator/creator/notification.go:161— `Error` at line 161 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Error("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Error("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Error("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging pkg/remediationorchestrator/aggregator/status.go:72— `Info` at line 72 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging pkg/remediationorchestrator/aggregator/status.go:74— `Error` at line 74 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Error("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Error("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Error("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging pkg/gateway/server.go:700— `Info` at line 700 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging internal/kubernautagent/tools/custom/resource_context.go:114— `Info` at line 114 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging internal/kubernautagent/tools/custom/resource_context.go:152— `Info` at line 152 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging internal/kubernautagent/mcp/tools/investigate_discovery.go:449— `Info` at line 449 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging internal/kubernautagent/investigator/investigator_anomaly_scope.go:122— `Info` at line 122 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging internal/kubernautagent/investigator/investigator_gates.go:203— `Info` at line 203 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging internal/kubernautagent/investigator/investigator_gates.go:217— `Info` at line 217 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging internal/kubernautagent/investigator/investigator_gates.go:223— `Info` at line 223 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging internal/kubernautagent/investigator/investigator_phases.go:158— `Info` at line 158 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging internal/controller/workflowexecution/workflowexecution_status_marking.go:561— `Error` at line 561 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Error("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Error("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Error("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging cmd/fleetmetadatacache/main.go:397— `Info` at line 397 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging cmd/fleetmetadatacache/main.go:429— `Error` at line 429 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Error("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Error("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Error("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging cmd/apifrontend/mcp_a2a_handlers.go:123— `Info` at line 123 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
M2 · Architecture documentation· Architecture diagram out of date · ×14
Architecture diagram out of date docs/architecture/APPROVED_MICROSERVICES_ARCHITECTURE.md:173— `docs/architecture/APPROVED_MICROSERVICES_ARCHITECTURE.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `effectivenessmonitor`, `fleetmetadatacache`, `remediationorchestrator`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
Architecture diagram out of date docs/architecture/KUBERNAUT_ARCHITECTURE_OVERVIEW.md:41— `docs/architecture/KUBERNAUT_ARCHITECTURE_OVERVIEW.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `apifrontend`, `authwebhook`, `effectivenessmonitor`, `fleetmetadatacache`, `notification`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
Architecture diagram out of date docs/architecture/KUBERNAUT_CRD_ARCHITECTURE.md:685— `docs/architecture/KUBERNAUT_CRD_ARCHITECTURE.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `authwebhook`, `fleetmetadatacache`, `notification`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
Architecture diagram out of date docs/architecture/SERVICE_DEPENDENCY_MAP.md:59— `docs/architecture/SERVICE_DEPENDENCY_MAP.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `apifrontend`, `authwebhook`, `effectivenessmonitor`, `fleetmetadatacache`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
Architecture diagram out of date docs/architecture/decisions/ADR-032-data-access-layer-isolation.md:309— `docs/architecture/decisions/ADR-032-data-access-layer-isolation.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `apifrontend`, `authwebhook`, `fleetmetadatacache`, `kubernautagent`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
Architecture diagram out of date docs/architecture/decisions/ADR-EM-001-effectiveness-monitor-service-integration.md:86— `docs/architecture/decisions/ADR-EM-001-effectiveness-monitor-service-integration.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `apifrontend`, `authwebhook`, `fleetmetadatacache`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
Architecture diagram out of date docs/architecture/decisions/DD-WORKFLOW-017-workflow-lifecycle-component-interactions.md:163— `docs/architecture/decisions/DD-WORKFLOW-017-workflow-lifecycle-component-interactions.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `apifrontend`, `effectivenessmonitor`, `fleetmetadatacache`, `gateway`, `notification`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
Architecture diagram out of date docs/architecture/diagrams/kubernaut-layered-architecture.svg:3— `docs/architecture/diagrams/kubernaut-layered-architecture.svg` draws the system's parts, and the drawing no longer matches the code: it leaves out `apifrontend`, `authwebhook`, `fleetmetadatacache`, `signalprocessing`, `workflowexecution`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
Architecture diagram out of date docs/architecture/references/visual-diagrams-master.md:13— `docs/architecture/references/visual-diagrams-master.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `apifrontend`, `authwebhook`, `effectivenessmonitor`, `fleetmetadatacache`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
Architecture diagram out of date docs/presentations/svg/04-architecture.svg:33— `docs/presentations/svg/04-architecture.svg` draws the system's parts, and the drawing no longer matches the code: it leaves out `authwebhook`, `fleetmetadatacache`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
Architecture diagram out of date docs/services/apifrontend/design/ARCHITECTURE.md:29— `docs/services/apifrontend/design/ARCHITECTURE.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `authwebhook`, `effectivenessmonitor`, `fleetmetadatacache`, `gateway`, `workflowexecution`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
Architecture diagram out of date docs/services/crd-controllers/02-aianalysis/integration-points.md:36— `docs/services/crd-controllers/02-aianalysis/integration-points.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `apifrontend`, `authwebhook`, `datastorage`, `effectivenessmonitor`, `fleetmetadatacache`, `gateway`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
Architecture diagram out of date docs/services/crd-controllers/02-aianalysis/overview.md:58— `docs/services/crd-controllers/02-aianalysis/overview.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `apifrontend`, `authwebhook`, `effectivenessmonitor`, `fleetmetadatacache`, `gateway`, `notification`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
Architecture diagram out of date docs/services/crd-controllers/05-remediationorchestrator/overview.md:102— `docs/services/crd-controllers/05-remediationorchestrator/overview.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `apifrontend`, `authwebhook`, `effectivenessmonitor`, `fleetmetadatacache`, `kubernautagent`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
D20 · ADR Quality· ADR has no Context section · ×11
ADR has no Context section docs/architecture/decisions/ADR-E2E-001-DEPLOYMENT-PATTERNS.md:1— docs/architecture/decisions/ADR-E2E-001-DEPLOYMENT-PATTERNS.md has no Context section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Context section docs/architecture/decisions/DD-010-postgresql-driver-migration.md:1— docs/architecture/decisions/DD-010-postgresql-driver-migration.md has no Context section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Context section docs/architecture/decisions/DD-AIANALYSIS-2586-independent-confidence.md:1— docs/architecture/decisions/DD-AIANALYSIS-2586-independent-confidence.md has no Context section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Context section docs/architecture/decisions/DD-AUDIT-010-idempotent-workflow-execution-audit-contract.md:1— docs/architecture/decisions/DD-AUDIT-010-idempotent-workflow-execution-audit-contract.md has no Context section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Context section docs/architecture/decisions/DD-EFFECTIVENESS-001-Hybrid-Automated-AI-Analysis.md:1— docs/architecture/decisions/DD-EFFECTIVENESS-001-Hybrid-Automated-AI-Analysis.md has no Context section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Context section docs/architecture/decisions/DD-GATEWAY-004-redis-memory-optimization.md:1— docs/architecture/decisions/DD-GATEWAY-004-redis-memory-optimization.md has no Context section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Context section docs/architecture/decisions/DD-KA-2496-history-aware-rca-and-repeat-selection.md:1— docs/architecture/decisions/DD-KA-2496-history-aware-rca-and-repeat-selection.md has no Context section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Context section docs/architecture/decisions/DD-KA-2511-generic-recurrent-rca-continuation.md:1— docs/architecture/decisions/DD-KA-2511-generic-recurrent-rca-continuation.md has no Context section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Context section docs/architecture/decisions/DD-PLAYBOOK-009-catalog-storage.md:1— docs/architecture/decisions/DD-PLAYBOOK-009-catalog-storage.md has no Context section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Context section docs/architecture/decisions/DD-WE-010-job-identity-per-remediation-request.md:1— docs/architecture/decisions/DD-WE-010-job-identity-per-remediation-request.md has no Context section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Context section docs/architecture/decisions/DD-WORKFLOW-009-catalog-storage.md:1— docs/architecture/decisions/DD-WORKFLOW-009-catalog-storage.md has no Context section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
Silent fallback default on error internal/kubernautagent/parser/parser_json_extract.go:62— `unwrapSingleElementArray` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
Silent fallback default on error internal/kubernautagent/tools/custom/tools.go:604— `EncodeCursor` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
Silent fallback default on error pkg/apifrontend/auth/middleware.go:226— `cryptoRandIntn` turns a non-nil `err` into `return 0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
Silent fallback default on error pkg/apifrontend/tools/ka_investigate_bridge.go:595— `extractJSONField` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
Silent fallback default on error pkg/datastorage/dlq/client.go:140— `CorrelationID` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
Silent fallback default on error pkg/datastorage/server/dlq_retry_worker.go:455— `extractPayloadField` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
Silent fallback default on error pkg/datastorage/server/dlq_retry_worker.go:524— `ParseTimestamp` turns a non-nil `err` into `return time.Time{}` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
Silent fallback default on error pkg/datastorage/server/dlq_retry_worker.go:533— `ParseRetryCount` turns a non-nil `err` into `return 0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
Silent fallback default on error pkg/fleet/mcpclient/client.go:598— `ExtractText` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
D8 · Code Coverage· Tests reach code only in some runs · ×8
Tests reach code only in some runs: internal/kubernautagent/workflowcatalog/lazy_catalog.go internal/kubernautagent/workflowcatalog/lazy_catalog.go:118— 5 line(s) (118-120, 135-136) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
Tests reach code only in some runs: pkg/apifrontend/ka/session_pool.go pkg/apifrontend/ka/session_pool.go:148— 3 line(s) (148-150) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
Tests reach code only in some runs: pkg/apifrontend/launcher/streaming_executor.go pkg/apifrontend/launcher/streaming_executor.go:159— 1 line(s) (159) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
Tests reach code only in some runs: pkg/authwebhook/helpers.go pkg/authwebhook/helpers.go:41— 1 line(s) (41) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
Tests reach code only in some runs: pkg/authwebhook/remediationworkflow_handler.go pkg/authwebhook/remediationworkflow_handler.go:543— 6 line(s) (543-545, 572-574) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
Tests reach code only in some runs: pkg/datastorage/dlq/client_consumer.go pkg/datastorage/dlq/client_consumer.go:167— 2 line(s) (167-168) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
Tests reach code only in some runs: pkg/datastorage/server/dlq_retry_worker.go pkg/datastorage/server/dlq_retry_worker.go:254— 4 line(s) (254-257) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
Tests reach code only in some runs: pkg/shared/hotreload/file_watcher.go pkg/shared/hotreload/file_watcher.go:289— 6 line(s) (289-294) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
D20 · ADR Quality· ADR has no Decision and Consequences section · ×7
ADR has no Decision and Consequences section docs/architecture/decisions/011-remediationprocessor-br-migration.md:1— docs/architecture/decisions/011-remediationprocessor-br-migration.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Decision and Consequences section docs/architecture/decisions/013-remediationorchestrator-br-migration.md:1— docs/architecture/decisions/013-remediationorchestrator-br-migration.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Decision and Consequences section docs/architecture/decisions/DD-AUTH-009-oauth2-proxy-workflow-attribution-implementation.md:1— docs/architecture/decisions/DD-AUTH-009-oauth2-proxy-workflow-attribution-implementation.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Decision and Consequences section docs/architecture/decisions/DD-GATEWAY-005-redis-cleanup-on-crd-deletion.md:1— docs/architecture/decisions/DD-GATEWAY-005-redis-cleanup-on-crd-deletion.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Decision and Consequences section docs/architecture/decisions/DD-PLAYBOOK-005-automated-schema-extraction.md:1— docs/architecture/decisions/DD-PLAYBOOK-005-automated-schema-extraction.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Decision and Consequences section docs/architecture/decisions/DD-PLAYBOOK-006-schema-drift-prevention.md:1— docs/architecture/decisions/DD-PLAYBOOK-006-schema-drift-prevention.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Decision and Consequences section docs/architecture/decisions/DD-WORKFLOW-006-schema-drift-prevention.md:1— docs/architecture/decisions/DD-WORKFLOW-006-schema-drift-prevention.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
D20 · ADR Quality· ADR links a record that does not exist · ×7
ADR links a record that does not exist docs/architecture/decisions/ADR-023-tekton-from-v1.md:8— docs/architecture/decisions/ADR-023-tekton-from-v1.md:8 names `ADR-022-v1-native-jobs-v2-tekton-migration.md` as the record it supersedes, and no such record is in the decision log. Fix the link, or restore the record, so a reader can follow the decision's history.
ADR links a record that does not exist docs/architecture/decisions/ADR-023-tekton-from-v1.md:630— docs/architecture/decisions/ADR-023-tekton-from-v1.md:630 names `ADR-022-v1-native-jobs-v2-tekton-migration.md` as the record it supersedes, and no such record is in the decision log. Fix the link, or restore the record, so a reader can follow the decision's history.
ADR links a record that does not exist docs/architecture/decisions/DD-AUTH-003-externalized-authorization-sidecar.md:667— docs/architecture/decisions/DD-AUTH-003-externalized-authorization-sidecar.md:667 names `mdc:docs/architecture/decisions/DD-AUTH-002-http-authentication-middleware.md` as the record it supersedes, and no such record is in the decision log. Fix the link, or restore the record, so a reader can follow the decision's history.
ADR links a record that does not exist docs/architecture/decisions/DD-CRD-001-api-group-domain-selection.md:225— docs/architecture/decisions/DD-CRD-001-api-group-domain-selection.md:225 names `ADR 2025` as the record it supersedes, and no such record is in the decision log. Fix the link, or restore the record, so a reader can follow the decision's history.
ADR links a record that does not exist docs/architecture/decisions/DD-TEST-015-fleet-e2e-deploy-correctly-first-time.md:3— docs/architecture/decisions/DD-TEST-015-fleet-e2e-deploy-correctly-first-time.md:3 names `ADR 2561` as the record it is superseded by, and no such record is in the decision log. Fix the link, or restore the record, so a reader can follow the decision's history.
ADR links a record that does not exist docs/architecture/decisions/DD-WORKFLOW-019-ka-owned-workflow-discovery.md:10— docs/architecture/decisions/DD-WORKFLOW-019-ka-owned-workflow-discovery.md:10 names `ADR 1661` as the record it supersedes, and no such record is in the decision log. Fix the link, or restore the record, so a reader can follow the decision's history.
ADR links a record that does not exist docs/services/apifrontend/adr/ADR-014-hybrid-ka-communication.md:7— docs/services/apifrontend/adr/ADR-014-hybrid-ka-communication.md:7 names `ADR 1326` as the record it is superseded by, and no such record is in the decision log. Fix the link, or restore the record, so a reader can follow the decision's history.
Anemic entity: RemediationAudit pkg/datastorage/models/audit.go:30— `RemediationAudit` is an aggregate/entity with 19 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
Anemic entity: AIAnalysisAudit pkg/datastorage/models/audit.go:54— `AIAnalysisAudit` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
Anemic entity: WorkflowAudit pkg/datastorage/models/audit.go:69— `WorkflowAudit` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
Anemic entity: ExecutionAudit pkg/datastorage/models/audit.go:84— `ExecutionAudit` is an aggregate/entity with 13 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
Anemic entity: NotificationAudit pkg/datastorage/models/notification_audit.go:38— `NotificationAudit` is an aggregate/entity with 13 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
Anemic entity: RemediationWorkflow pkg/datastorage/models/workflow.go:60— `RemediationWorkflow` is an aggregate/entity with 41 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
D20 · ADR Quality· ADR has no Context and Consequences section · ×4
ADR has no Context and Consequences section docs/architecture/decisions/ADR-028-EXCEPTION-001-upstream-go-arm64.md:1— docs/architecture/decisions/ADR-028-EXCEPTION-001-upstream-go-arm64.md has no Context and Consequences section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Context and Consequences section docs/architecture/decisions/DD-AUDIT-CORRELATION-002-universal-correlation-id-standard.md:1— docs/architecture/decisions/DD-AUDIT-CORRELATION-002-universal-correlation-id-standard.md has no Context and Consequences section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Context and Consequences section docs/architecture/decisions/DD-RO-002-ADDENDUM-blocked-phase-semantics.md:1— docs/architecture/decisions/DD-RO-002-ADDENDUM-blocked-phase-semantics.md has no Context and Consequences section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Context and Consequences section docs/architecture/decisions/DD-SP-003-multi-provider-extensibility.md:1— docs/architecture/decisions/DD-SP-003-multi-provider-extensibility.md has no Context and Consequences section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
D20 · ADR Quality· ADR has no Consequences section · ×4
ADR has no Consequences section docs/architecture/decisions/DD-ARCH-002-GRAPHQL-QUERY-LAYER-ASSESSMENT.md:1— docs/architecture/decisions/DD-ARCH-002-GRAPHQL-QUERY-LAYER-ASSESSMENT.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/architecture/decisions/DD-AUTH-012/DD-AUTH-012-ose-oauth-proxy-sar-rest-api-endpoints.md:1— docs/architecture/decisions/DD-AUTH-012/DD-AUTH-012-ose-oauth-proxy-sar-rest-api-endpoints.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/architecture/decisions/DD-REGISTRY-001-container-registry-strategy.md:1— docs/architecture/decisions/DD-REGISTRY-001-container-registry-strategy.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Consequences section docs/architecture/decisions/DD-SOC2-001-day9-2-deferral.md:1— docs/architecture/decisions/DD-SOC2-001-day9-2-deferral.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
Mutable entity: NotificationAudit pkg/datastorage/models/notification_audit.go:38— `NotificationAudit` exposes publicly writable state (ID, RemediationID, NotificationID, Recipient, Channel, MessageSummary, and 7 more).
Mutable entity: RemediationWorkflow pkg/datastorage/models/workflow.go:60— `RemediationWorkflow` exposes publicly writable state (WorkflowID, WorkflowName, Version, SchemaVersion, Name, Description, and 35 more).
D20 · ADR Quality· ADR has no Decision section · ×3
ADR has no Decision section docs/architecture/decisions/DD-E2E-001-parallel-image-builds.md:1— docs/architecture/decisions/DD-E2E-001-parallel-image-builds.md has no Decision section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Decision section docs/architecture/decisions/DD-PLAYBOOK-004-parameter-schema-location.md:1— docs/architecture/decisions/DD-PLAYBOOK-004-parameter-schema-location.md has no Decision section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Decision section docs/architecture/decisions/TRIAGE-SEVERITY-EXTENSIBILITY.md:1— docs/architecture/decisions/TRIAGE-SEVERITY-EXTENSIBILITY.md has no Decision section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
D20 · ADR Quality· ADR still proposed, but the code already adopted it · ×3
ADR still proposed, but the code already adopted it docs/architecture/decisions/ADR-063-servicenow-signal-integration.md:3— docs/architecture/decisions/ADR-063-servicenow-signal-integration.md:3 says "PROPOSED", but the production code already uses every element its Decision names: `SignalSource` (internal/kubernautagent/prompt/builder.go). A proposal the code has adopted is a decision in force; mark it accepted, or, if the code should not do this, say so.
ADR still proposed, but the code already adopted it docs/architecture/decisions/ADR-075-multi-pillar-data-contract-extensibility.md:4— docs/architecture/decisions/ADR-075-multi-pillar-data-contract-extensibility.md:4 says "Proposed; pending cross-team review", but the production code already uses every element its Decision names: `signalType` (internal/kubernautagent/prompt/history.go). A proposal the code has adopted is a decision in force; mark it accepted, or, if the code should not do this, say so.
ADR still proposed, but the code already adopted it docs/architecture/decisions/DD-EM-002-canonical-spec-hash.md:3— docs/architecture/decisions/DD-EM-002-canonical-spec-hash.md:3 says "PROPOSED", but the production code already uses every element its Decision names: `PostRemediationSpecHash` (internal/kubernautagent/enrichment/ds_adapter.go). A proposal the code has adopted is a decision in force; mark it accepted, or, if the code should not do this, say so.
Orphaned file pkg/apifrontend/resilience/k8s_dynamic.go:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file pkg/apifrontend/streaming/tracker.go:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file pkg/apifrontend/ratelimit/config.go:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Hand-rolled JSON/XML parsing via regex pkg/shared/sanitization/sanitizer.go:295— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Go code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex pkg/kubernautagent/tools/sanitization/injection.go:56— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Go code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex pkg/kubernautagent/tools/sanitization/injection.go:57— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Go code already uses a real parser in the same package; use it here too.
D20 · ADR Quality· ADR has no Context and Decision and Consequences section · ×2
ADR has no Context and Decision and Consequences section docs/architecture/decisions/DD-WORKFLOW-010-mcp-integration-confidence.md:1— docs/architecture/decisions/DD-WORKFLOW-010-mcp-integration-confidence.md has no Context and Decision and Consequences section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Context and Decision and Consequences section docs/architecture/decisions/dd-context-005/REJECTED-FIELD-ANALYSIS.md:1— docs/architecture/decisions/dd-context-005/REJECTED-FIELD-ANALYSIS.md has no Context and Decision and Consequences section (a heading such as `## Context`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
D20 · ADR Quality· ADR superseded but its status says otherwise · ×2
ADR superseded but its status says otherwise docs/architecture/decisions/ADR-027-multi-architecture-build-strategy.md:1— docs/architecture/decisions/ADR-027-multi-architecture-build-strategy.md:1 says "✅ Accepted", but docs/architecture/decisions/ADR-028-container-registry-policy.md supersedes it. Two records now claim the same ground; mark this one "Superseded by" its successor.
ADR superseded but its status says otherwise docs/architecture/decisions/ADR-068-fleet-federation-architecture.md:3— docs/architecture/decisions/ADR-068-fleet-federation-architecture.md:3 says "Implemented (MVP; amended 2026-09-22)", but docs/architecture/decisions/DD-FLEET-005-cluster-transparent-tool-exposure.md supersedes it. Two records now claim the same ground; mark this one "Superseded by" its successor.
Silent fallback default in catch test/performance/apifrontend/scripts/mcp-tools-call.js:93— `default` swallows every exception into `return false` — 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 test/performance/apifrontend/scripts/sse-streams.js:51— `default` swallows every exception into `return false` — 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.
Subsumed condition operand internal/controller/workflowexecution/failure_analysis.go:250— `strings.Contains(messageLower, "oomkilled")` can never decide this `||` — every value satisfying `strings.Contains(messageLower, "oomkilled")` also satisfies `strings.Contains(messageLower, "oom")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand cmd/apifrontend/main_wiring_test.go:1646— `strings.Contains(ct, "application/json")` can never decide this `||` — every value satisfying `strings.Contains(ct, "application/json")` also satisfies `strings.Contains(ct, "json")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
D21 · Naming Consistency· `WorkflowId` spells `Id` where 1087 names in the project spell it `ID` · ×1
`WorkflowId` spells `Id` where 1087 names in the project spell it `ID` api/aianalysis/v1alpha1/aianalysis_types.go:302— 1087 of 1088 names in project github.com/jordigilh/kubernaut spell the token `ID` (1087 of 1088; unit: names in project github.com/jordigilh/kubernaut containing `ID`). Peers: AgentSessionSpec.IncidentID (api/agentsession/v1alpha1/agentsession_types.go:141); AgentSessionSpec.RemediationID (api/agentsession/v1alpha1/agentsession_types.go:148); AgentSessionAlternativeWorkflow.WorkflowID (api/agentsession/v1alpha1/agentsession_types.go:265); AgentSessionValidationAttempt.WorkflowID (api/agentsession/v1alpha1/agentsession_types.go:275); AgentSessionResult.IncidentID (api/agentsession/v1alpha1/agentsession_types.go:322). Rename to `WorkflowID`. [rule N6]
D21 · Naming Consistency· `DefaultRetryMS` spells `MS` where 43 names in the project spell it `Ms` · ×1
`DefaultRetryMS` spells `MS` where 43 names in the project spell it `Ms` pkg/apifrontend/streaming/sse.go:19— 43 of 45 names in project github.com/jordigilh/kubernaut spell the token `Ms` (43 of 45; unit: names in project github.com/jordigilh/kubernaut containing `Ms`). Peers: investigatingUpdateOutcome.investigationTimeMs (internal/controller/aianalysis/phase_handlers.go:149); metricsAssessResult.LatencyP95BeforeMs (internal/controller/effectivenessmonitor/assess_components.go:206); metricsAssessResult.LatencyP95AfterMs (internal/controller/effectivenessmonitor/assess_components.go:207); Reconciler.emitCompletionAudit(durationMs) (internal/controller/remediationorchestrator/audit_events.go:350); Reconciler.emitFailureAudit(durationMs) (internal/controller/remediationorchestrator/audit_events.go:392). Rename to `DefaultRetryMs`. [rule N6]
D21 · Naming Consistency· `watchTerminalEventsSafetyNetNs` spells `Ns` where 42 names in the project spell it `NS` · ×1
`watchTerminalEventsSafetyNetNs` spells `Ns` where 42 names in the project spell it `NS` pkg/apifrontend/tools/ka_investigate_bridge.go:460— 42 of 43 names in project github.com/jordigilh/kubernaut spell the token `NS` (42 of 43; unit: names in project github.com/jordigilh/kubernaut containing `NS`). Peers: main.buildAIAnalysisManager(controllerNS) (cmd/aianalysis/main.go:150); main.setupAIAnalysisReconciler(controllerNS) (cmd/aianalysis/main.go:286); main.initCoreDependencies(controllerNS) (cmd/effectivenessmonitor/main.go:287); main.buildManager(controllerNS) (cmd/effectivenessmonitor/main.go:322); main.buildManager(controllerNS) (cmd/notification/main.go:432). Rename to `watchTerminalEventsSafetyNetNS`. [rule N6]
D21 · Naming Consistency· `requireGET` spells `GET` where 43 names in the project spell it `Get` · ×1
`requireGET` spells `GET` where 43 names in the project spell it `Get` pkg/fleet/fmc/handler.go:208— 43 of 44 names in project github.com/jordigilh/kubernaut spell the token `Get` (43 of 44; unit: names in project github.com/jordigilh/kubernaut containing `Get`). Peers: KASession.ConsecutiveGetResultErrors (api/aianalysis/v1alpha1/aianalysis_types.go:743); github.com/jordigilh/kubernaut/pkg/aianalysis/handlers.AgentSessionGetOrCreator (pkg/aianalysis/handlers/interfaces.go:43); InvestigatingHandler.agentSessionGetOrCreator (pkg/aianalysis/handlers/investigating.go:56); audit.EventConsoleManagedResourceGetRead (pkg/apifrontend/audit/audit.go:93); audit.buildConsoleManagedResourceGetReadPayload (pkg/apifrontend/audit/store_adapter.go:540). Rename to `requireGet`. [rule N6]
D21 · Naming Consistency· `KeyDurationMS` spells `MS` where 43 names in the project spell it `Ms` · ×1
`KeyDurationMS` spells `MS` where 43 names in the project spell it `Ms` pkg/log/fields.go:61— 43 of 45 names in project github.com/jordigilh/kubernaut spell the token `Ms` (43 of 45; unit: names in project github.com/jordigilh/kubernaut containing `Ms`). Peers: investigatingUpdateOutcome.investigationTimeMs (internal/controller/aianalysis/phase_handlers.go:149); metricsAssessResult.LatencyP95BeforeMs (internal/controller/effectivenessmonitor/assess_components.go:206); metricsAssessResult.LatencyP95AfterMs (internal/controller/effectivenessmonitor/assess_components.go:207); Reconciler.emitCompletionAudit(durationMs) (internal/controller/remediationorchestrator/audit_events.go:350); Reconciler.emitFailureAudit(durationMs) (internal/controller/remediationorchestrator/audit_events.go:392). Rename to `KeyDurationMs`. [rule N6]
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion REDACTED:1— `(repository root)` (197157 LoC, 1845 module-visible types across 255 directories) overshoots its size bounds. 1 of 6 build unit(s) (Go) overshoot their size bounds, lowering Project Cohesion to 6.7/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
REDACTED
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 3 of 722 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 722 of the 893 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: pkg/apifrontend/resilience/k8s_dynamic.go, pkg/apifrontend/streaming/tracker.go, pkg/apifrontend/ratelimit/config.go. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
X2 · Cancellation propagation· Not all functions that make a request accept a context.Context · ×1
Not all functions that make a request accept a context.Context — Only 34/53 functions that make a cancellable request (net/http, net.Dial) accept a context.Context or pass one on, so a request keeps running after whatever wanted it has given up — a cancelled request, a shutdown, an expired deadline. Take `ctx context.Context` as the first parameter and build the request with it (`http.NewRequestWithContext`, `DialContext`); where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
Outdated: github.com/containers/kubernetes-mcp-server — `github.com/containers/kubernetes-mcp-server` is required at v0.1.2 in REDACTED, but v0.1.3 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/containers/kubernetes-mcp-server@v0.1.3 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/ogen-go/ogen — `github.com/ogen-go/ogen` is required at v1.24.0 in REDACTED, but v1.25.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/ogen-go/ogen@v1.25.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/open-policy-agent/opa — `github.com/open-policy-agent/opa` is required at v1.22.3 in REDACTED, but v1.22.4 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/open-policy-agent/opa@v1.22.4 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/pressly/goose/v3 — `github.com/pressly/goose/v3` is required at v3.30.0 in REDACTED, but v3.30.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/pressly/goose/v3@v3.30.1 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/slack-go/slack — `github.com/slack-go/slack` is required at v0.35.0 in REDACTED, but v0.36.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/slack-go/slack@v0.36.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/tektoncd/pipeline — `github.com/tektoncd/pipeline` is required at v1.16.0 in REDACTED, but v1.18.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/tektoncd/pipeline@v1.18.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: google.golang.org/adk/v2 — `google.golang.org/adk/v2` is required at v2.4.1-0.20260915115737-76959b0ca682 in REDACTED, but v2.8.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get google.golang.org/adk/v2@v2.8.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: sigs.k8s.io/controller-runtime — `sigs.k8s.io/controller-runtime` is required at v0.24.1 in REDACTED, but v0.25.3 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get sigs.k8s.io/controller-runtime@v0.25.3 && go mod tidy` and commit the updated REDACTED and go.sum.
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 3 file(s) — `internal/kubernautagent/mcp/tools/select_workflow.go`, `pkg/fleet/fmc/inventory.go`, `pkg/kubernautagent/types/live_selection.go` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
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 01a1e6c6-f90d-7642-987a-accc1a86979d · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 51 · Warnings: 1038 · Recommendations: 642 · Info: 8 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 16-11-2026 @ 23:52 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.