Public report of smartcomputer-ai/lightspeed, published 22 October 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.10.5). Watchdog 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, 22 October 2026, 12:36 UTC · Survey ID cd_b030b61597f64ebc938d92ca185be174
smartcomputer-ai/lightspeed
Measured 22 October 2026, 12:31 UTC, at code version 86f6adf
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
Down 7 since the last survey
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: 340,943 lines of product code in 35 projects, tests not counted · Estimated rebuild effort: about 2.7 person-years · Weakest lens: Production Readiness, 47
Findings by how serious they are
40 critical1361 serious114 minor
8 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks 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
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
22 October 2026, 12:31 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 Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
The score is deterministic, which means the same code always gets the same score. Watchdog works 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 ▸
88of 93 dimensions measured by tools. The other 5 are advisory notes from an AI model, which explain the code but don't count towards the score.
1471of 1515 findings point to an exact file and line, so you can open each one in the code. The other 44 concern the repository as a whole, such as missing documentation.
93dimensions across 8 lenses, read from 340,943 lines of product code in 35 projects.
smartcomputer-ai/lightspeed scores 54 out of 100 and is rated Adequate, while six of its eight lenses score higher still: Event Sourcing and Performance at 100, both rated Exemplary, Architecture at 82, rated Strong, and Security and Compliance at 72, Code Health at 66 and Accessibility at 61, all rated Adequate. The project hasn't declared a stable release yet, so its lenses are rated against a lower bar than a released product's, while the score itself is worked out as for any repository.
The score is lower than those six because the weakest lens counts most, and here that is Production Readiness, which scores 47 and is rated Adequate. Its REDACTED Scanning dimension scores 0 out of 10, and until that reaches 4, Production Readiness can't be rated higher than Adequate. The first actions are to resolve the 1 No ADRs found finding(s) in ADR Quality and to resolve the 11 Leaked secret finding(s) in REDACTED Scanning, and if Production Readiness rose to 70, the score would rise from 54 to about 59.
40 findings are critical: 13 in Secrets (history), 11 in REDACTED Scanning, eight in Forms & labels, three in Dependency Vulnerabilities, one in Circular Imports, one in Dependency Hygiene, one in IaC & Container Security, one in Static Analysis (SAST) and one in Test isolation.
Watchdog couldn't measure 6 dimensions in this code, among them Code Coverage, Test Reliability and Navigability, so they are left out of the score. The product code is 340,943 lines, which would take an estimated 2.7 person-years, around €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.
If Production Readiness rose from 47 to 70, the lowest score rated Strong, the score would rise from 54 to about 59.
Code composition: what the lines of code are
Product code 84%Tests 16%
New since the last survey: 162 findings
These 162 critical or serious findings weren't in the previous survey, on 8 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 176 findings
These 176 critical or serious findings were in the previous survey, on 8 October 2026, and are gone from this one. The first 100 are listed here.
€130,000 to €660,000, for 2,203 to 6,989 hours of work, about 2.7 person-years for 1 to 6 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.8 at a score of 54. 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: 340,943 lines of product code
How the estimate is made: Watchdog prices 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 1 No ADRs found finding(s) in ADR Quality.
Raises the score by about 4 points · Low effort · ADR Quality
2
Resolve the 11 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (5), REDACTED (3), REDACTED (2).
Raises the score by about 6 points · Medium effort · REDACTED Scanning
3
Reconcile the README with reality: README advertises Kubernetes, but no Kubernetes manifest or chart exists; crates/auth/README.md names `auth/grants/import`, but no file or folder `auth/grants/import` exists; docs/documentation/access-and-security/api-keys-and-service-access.md names `session/delete`, but no file or folder `session/delete` exists; docs/documentation/access-and-security/api-keys-and-service-access.md names `deployment/sessions`, but no file or folder `deployment/sessions` exists; docs/documentation/access-and-security/api-keys-and-service-access.md names `deployment/channels`, but no file or folder `deployment/channels` exists.
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €400,000 to build again, about 2.7 person-years of work. Its weakest lens is Production Readiness, at 47 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 1 No ADRs found finding(s) in ADR Quality. Of all the actions in this report, it raises the score most for the work it takes: about 4 points for low effort, because it clears the 1 ADR Quality findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 7.2 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 526,335 lines over the last 90 days, which is about 2,134,581 lines a year. At that pace, the extra work comes to an estimated 106.7 to 711.5 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
638 modules, with 1914 dependencies between them. 13 loops run through 97 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 598 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.
harness.core.components.ids uses harness.session.ids, so a change to harness.session.ids can break harness.core.components.ids, while a change to harness.core.components.ids can't break harness.session.ids.
Position
Below the diagonal: harness.core.components.ids uses a module listed above it, which is the healthy direction.
environments uses environment_protocol.shared, so a change to environment_protocol.shared can break environments, while a change to environments can't break environment_protocol.shared.
Position
Below the diagonal: environments uses a module listed above it, which is the healthy direction.
environments uses harness.core.components.ids, so a change to harness.core.components.ids can break environments, while a change to environments can't break harness.core.components.ids.
Position
Below the diagonal: environments uses a module listed above it, which is the healthy direction.
harness.core.components.turn uses harness.core.components.ids, so a change to harness.core.components.ids can break harness.core.components.turn, while a change to harness.core.components.turn can't break harness.core.components.ids.
Position
Below the diagonal: harness.core.components.turn uses a module listed above it, which is the healthy direction.
11→20 harness.core.components.turn uses harness.core.components.toolingpart of a loop✕
Connections
1 pair of types, where a type in harness.core.components.turn uses a type in harness.core.components.tooling.
harness.core.components.turn uses harness.core.components.tooling, so a change to harness.core.components.tooling can break harness.core.components.turn, while a change to harness.core.components.turn can't break harness.core.components.tooling.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
11→25 harness.core.components.turn uses harness.core.components.statepart of a loop✕
Connections
1 pair of types, where a type in harness.core.components.turn uses a type in harness.core.components.state.
harness.core.components.turn uses harness.core.components.state, so a change to harness.core.components.state can break harness.core.components.turn, while a change to harness.core.components.turn can't break harness.core.components.state.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
11→28 harness.core.components.turn uses harness.core.components.runpart of a loop✕
Connections
1 pair of types, where a type in harness.core.components.turn uses a type in harness.core.components.run.
harness.core.components.turn uses harness.core.components.run, so a change to harness.core.components.run can break harness.core.components.turn, while a change to harness.core.components.turn can't break harness.core.components.run.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
11→31 harness.core.components.turn uses harness.core.components.contextpart of a loop✕
Connections
1 pair of types, where a type in harness.core.components.turn uses a type in harness.core.components.context.
harness.core.components.turn uses harness.core.components.context, so a change to harness.core.components.context can break harness.core.components.turn, while a change to harness.core.components.turn can't break harness.core.components.context.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
harness.core.components.workflow_tool uses harness.blob, so a change to harness.blob can break harness.core.components.workflow_tool, while a change to harness.core.components.workflow_tool can't break harness.blob.
Position
Below the diagonal: harness.core.components.workflow_tool uses a module listed above it, which is the healthy direction.
harness.core.components.workflow_tool uses harness.session.ids, so a change to harness.session.ids can break harness.core.components.workflow_tool, while a change to harness.core.components.workflow_tool can't break harness.session.ids.
Position
Below the diagonal: harness.core.components.workflow_tool uses a module listed above it, which is the healthy direction.
harness.core.components.workflow_tool uses harness.core.components.ids, so a change to harness.core.components.ids can break harness.core.components.workflow_tool, while a change to harness.core.components.workflow_tool can't break harness.core.components.ids.
Position
Below the diagonal: harness.core.components.workflow_tool uses a module listed above it, which is the healthy direction.
12→17 harness.core.components.workflow_tool uses harness.core.iopart of a loop✕
Connections
1 pair of types, where a type in harness.core.components.workflow_tool uses a type in harness.core.io.
harness.core.components.workflow_tool uses harness.core.io, so a change to harness.core.io can break harness.core.components.workflow_tool, while a change to harness.core.components.workflow_tool can't break harness.core.io.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
12→20 harness.core.components.workflow_tool uses harness.core.components.toolingpart of a loop✕
Connections
1 pair of types, where a type in harness.core.components.workflow_tool uses a type in harness.core.components.tooling.
harness.core.components.workflow_tool uses harness.core.components.tooling, so a change to harness.core.components.tooling can break harness.core.components.workflow_tool, while a change to harness.core.components.workflow_tool can't break harness.core.components.tooling.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
12→25 harness.core.components.workflow_tool uses harness.core.components.statepart of a loop✕
Connections
1 pair of types, where a type in harness.core.components.workflow_tool uses a type in harness.core.components.state.
harness.core.components.workflow_tool uses harness.core.components.state, so a change to harness.core.components.state can break harness.core.components.workflow_tool, while a change to harness.core.components.workflow_tool can't break harness.core.components.state.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
api.views uses harness.session.ids, so a change to harness.session.ids can break api.views, while a change to api.views can't break harness.session.ids.
Position
Below the diagonal: api.views uses a module listed above it, which is the healthy direction.
api.views uses harness.core.components.ids, so a change to harness.core.components.ids can break api.views, while a change to api.views can't break harness.core.components.ids.
Position
Below the diagonal: api.views uses a module listed above it, which is the healthy direction.
api.sessions uses harness.session.ids, so a change to harness.session.ids can break api.sessions, while a change to api.sessions can't break harness.session.ids.
Position
Below the diagonal: api.sessions uses a module listed above it, which is the healthy direction.
api.sessions uses harness.core.components.ids, so a change to harness.core.components.ids can break api.sessions, while a change to api.sessions can't break harness.core.components.ids.
Position
Below the diagonal: api.sessions uses a module listed above it, which is the healthy direction.
api.profiles uses harness.session.ids, so a change to harness.session.ids can break api.profiles, while a change to api.profiles can't break harness.session.ids.
Position
Below the diagonal: api.profiles uses a module listed above it, which is the healthy direction.
harness.core.io uses harness.session.ids, so a change to harness.session.ids can break harness.core.io, while a change to harness.core.io can't break harness.session.ids.
Position
Below the diagonal: harness.core.io uses a module listed above it, which is the healthy direction.
harness.core.io uses harness.core.components.ids, so a change to harness.core.components.ids can break harness.core.io, while a change to harness.core.io can't break harness.core.components.ids.
Position
Below the diagonal: harness.core.io uses a module listed above it, which is the healthy direction.
harness.core.io uses harness.core.components.turn, so a change to harness.core.components.turn can break harness.core.io, while a change to harness.core.io can't break harness.core.components.turn.
Position
Below the diagonal: harness.core.io uses a module listed above it, which is the healthy direction.
harness.core.io uses harness.core.components.workflow_tool, so a change to harness.core.components.workflow_tool can break harness.core.io, while a change to harness.core.io can't break harness.core.components.workflow_tool.
Position
Below the diagonal: harness.core.io uses a module listed above it, which is the healthy direction.
harness.core.io uses harness.core.components.tooling, so a change to harness.core.components.tooling can break harness.core.io, while a change to harness.core.io can't break harness.core.components.tooling.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
17→26 harness.core.io uses harness.core.components.promisepart of a loop✕
Connections
1 pair of types, where a type in harness.core.io uses a type in harness.core.components.promise.
harness.core.io uses harness.core.components.promise, so a change to harness.core.components.promise can break harness.core.io, while a change to harness.core.io can't break harness.core.components.promise.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
17→30 harness.core.io uses harness.core.components.llmpart of a loop✕
Connections
3 pairs of types, where a type in harness.core.io uses a type in harness.core.components.llm.
harness.core.io uses harness.core.components.llm, so a change to harness.core.components.llm can break harness.core.io, while a change to harness.core.io can't break harness.core.components.llm.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
17→31 harness.core.io uses harness.core.components.contextpart of a loop✕
Connections
2 pairs of types, where a type in harness.core.io uses a type in harness.core.components.context.
harness.core.io uses harness.core.components.context, so a change to harness.core.components.context can break harness.core.io, while a change to harness.core.io can't break harness.core.components.context.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
llm_clients.openai.responses uses api.sessions, so a change to api.sessions can break llm_clients.openai.responses, while a change to llm_clients.openai.responses can't break api.sessions.
Position
Below the diagonal: llm_clients.openai.responses uses a module listed above it, which is the healthy direction.
18→21 llm_clients.openai.responses uses llm_clients.anthropic.messagespart of a loop✕
Connections
5 pairs of types, where a type in llm_clients.openai.responses uses a type in llm_clients.anthropic.messages.
llm_clients.openai.responses uses llm_clients.anthropic.messages, so a change to llm_clients.anthropic.messages can break llm_clients.openai.responses, while a change to llm_clients.openai.responses can't break llm_clients.anthropic.messages.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
api.bots uses harness.core.components.ids, so a change to harness.core.components.ids can break api.bots, while a change to api.bots can't break harness.core.components.ids.
Position
Below the diagonal: api.bots uses a module listed above it, which is the healthy direction.
harness.core.components.tooling uses harness.blob, so a change to harness.blob can break harness.core.components.tooling, while a change to harness.core.components.tooling can't break harness.blob.
Position
Below the diagonal: harness.core.components.tooling uses a module listed above it, which is the healthy direction.
harness.core.components.tooling uses harness.core.components.ids, so a change to harness.core.components.ids can break harness.core.components.tooling, while a change to harness.core.components.tooling can't break harness.core.components.ids.
Position
Below the diagonal: harness.core.components.tooling uses a module listed above it, which is the healthy direction.
harness.core.components.tooling uses harness.core.io, so a change to harness.core.io can break harness.core.components.tooling, while a change to harness.core.components.tooling can't break harness.core.io.
Position
Below the diagonal: harness.core.components.tooling uses a module listed above it, which is the healthy direction.
20→25 harness.core.components.tooling uses harness.core.components.statepart of a loop✕
Connections
1 pair of types, where a type in harness.core.components.tooling uses a type in harness.core.components.state.
harness.core.components.tooling uses harness.core.components.state, so a change to harness.core.components.state can break harness.core.components.tooling, while a change to harness.core.components.tooling can't break harness.core.components.state.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
20→28 harness.core.components.tooling uses harness.core.components.runpart of a loop✕
Connections
2 pairs of types, where a type in harness.core.components.tooling uses a type in harness.core.components.run.
harness.core.components.tooling uses harness.core.components.run, so a change to harness.core.components.run can break harness.core.components.tooling, while a change to harness.core.components.tooling can't break harness.core.components.run.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
20→30 harness.core.components.tooling uses harness.core.components.llmpart of a loop✕
Connections
1 pair of types, where a type in harness.core.components.tooling uses a type in harness.core.components.llm.
harness.core.components.tooling uses harness.core.components.llm, so a change to harness.core.components.llm can break harness.core.components.tooling, while a change to harness.core.components.tooling can't break harness.core.components.llm.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
20→31 harness.core.components.tooling uses harness.core.components.contextpart of a loop✕
Connections
2 pairs of types, where a type in harness.core.components.tooling uses a type in harness.core.components.context.
harness.core.components.tooling uses harness.core.components.context, so a change to harness.core.components.context can break harness.core.components.tooling, while a change to harness.core.components.tooling can't break harness.core.components.context.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
llm_clients.anthropic.messages uses api.sessions, so a change to api.sessions can break llm_clients.anthropic.messages, while a change to llm_clients.anthropic.messages can't break api.sessions.
Position
Below the diagonal: llm_clients.anthropic.messages uses a module listed above it, which is the healthy direction.
llm_clients.anthropic.messages uses llm_clients.openai.responses, so a change to llm_clients.openai.responses can break llm_clients.anthropic.messages, while a change to llm_clients.anthropic.messages can't break llm_clients.openai.responses.
Position
Below the diagonal: llm_clients.anthropic.messages uses a module listed above it, which is the healthy direction.
29 pairs of types, where a type in bots.records uses a type in api.bots. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
cli.api_client uses llm_clients.anthropic.messages, so a change to llm_clients.anthropic.messages can break cli.api_client, while a change to cli.api_client can't break llm_clients.anthropic.messages.
Position
Below the diagonal: cli.api_client uses a module listed above it, which is the healthy direction.
harness.core.components.state uses harness.core.components.ids, so a change to harness.core.components.ids can break harness.core.components.state, while a change to harness.core.components.state can't break harness.core.components.ids.
Position
Below the diagonal: harness.core.components.state uses a module listed above it, which is the healthy direction.
harness.core.components.state uses harness.core.components.workflow_tool, so a change to harness.core.components.workflow_tool can break harness.core.components.state, while a change to harness.core.components.state can't break harness.core.components.workflow_tool.
Position
Below the diagonal: harness.core.components.state uses a module listed above it, which is the healthy direction.
harness.core.components.state uses harness.core.components.tooling, so a change to harness.core.components.tooling can break harness.core.components.state, while a change to harness.core.components.state can't break harness.core.components.tooling.
Position
Below the diagonal: harness.core.components.state uses a module listed above it, which is the healthy direction.
25→26 harness.core.components.state uses harness.core.components.promisepart of a loop✕
Connections
1 pair of types, where a type in harness.core.components.state uses a type in harness.core.components.promise.
harness.core.components.state uses harness.core.components.promise, so a change to harness.core.components.promise can break harness.core.components.state, while a change to harness.core.components.state can't break harness.core.components.promise.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
25→28 harness.core.components.state uses harness.core.components.runpart of a loop✕
Connections
1 pair of types, where a type in harness.core.components.state uses a type in harness.core.components.run.
harness.core.components.state uses harness.core.components.run, so a change to harness.core.components.run can break harness.core.components.state, while a change to harness.core.components.state can't break harness.core.components.run.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
25→31 harness.core.components.state uses harness.core.components.contextpart of a loop✕
Connections
1 pair of types, where a type in harness.core.components.state uses a type in harness.core.components.context.
harness.core.components.state uses harness.core.components.context, so a change to harness.core.components.context can break harness.core.components.state, while a change to harness.core.components.state can't break harness.core.components.context.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
harness.core.components.promise uses harness.blob, so a change to harness.blob can break harness.core.components.promise, while a change to harness.core.components.promise can't break harness.blob.
Position
Below the diagonal: harness.core.components.promise uses a module listed above it, which is the healthy direction.
harness.core.components.promise uses harness.core.components.ids, so a change to harness.core.components.ids can break harness.core.components.promise, while a change to harness.core.components.promise can't break harness.core.components.ids.
Position
Below the diagonal: harness.core.components.promise uses a module listed above it, which is the healthy direction.
harness.core.components.promise uses harness.core.io, so a change to harness.core.io can break harness.core.components.promise, while a change to harness.core.components.promise can't break harness.core.io.
Position
Below the diagonal: harness.core.components.promise uses a module listed above it, which is the healthy direction.
harness.core.components.promise uses harness.core.components.state, so a change to harness.core.components.state can break harness.core.components.promise, while a change to harness.core.components.promise can't break harness.core.components.state.
Position
Below the diagonal: harness.core.components.promise uses a module listed above it, which is the healthy direction.
harness.storage.session uses harness.blob, so a change to harness.blob can break harness.storage.session, while a change to harness.storage.session can't break harness.blob.
Position
Below the diagonal: harness.storage.session uses a module listed above it, which is the healthy direction.
harness.storage.session uses harness.session.ids, so a change to harness.session.ids can break harness.storage.session, while a change to harness.storage.session can't break harness.session.ids.
Position
Below the diagonal: harness.storage.session uses a module listed above it, which is the healthy direction.
harness.storage.session uses api.sessions, so a change to api.sessions can break harness.storage.session, while a change to harness.storage.session can't break api.sessions.
Position
Below the diagonal: harness.storage.session uses a module listed above it, which is the healthy direction.
harness.storage.session uses harness.core.components.state, so a change to harness.core.components.state can break harness.storage.session, while a change to harness.storage.session can't break harness.core.components.state.
Position
Below the diagonal: harness.storage.session uses a module listed above it, which is the healthy direction.
harness.core.components.run uses harness.blob, so a change to harness.blob can break harness.core.components.run, while a change to harness.core.components.run can't break harness.blob.
Position
Below the diagonal: harness.core.components.run uses a module listed above it, which is the healthy direction.
harness.core.components.run uses harness.session.ids, so a change to harness.session.ids can break harness.core.components.run, while a change to harness.core.components.run can't break harness.session.ids.
Position
Below the diagonal: harness.core.components.run uses a module listed above it, which is the healthy direction.
harness.core.components.run uses harness.core.components.ids, so a change to harness.core.components.ids can break harness.core.components.run, while a change to harness.core.components.run can't break harness.core.components.ids.
Position
Below the diagonal: harness.core.components.run uses a module listed above it, which is the healthy direction.
harness.core.components.run uses api.access, so a change to api.access can break harness.core.components.run, while a change to harness.core.components.run can't break api.access.
Position
Below the diagonal: harness.core.components.run uses a module listed above it, which is the healthy direction.
harness.core.components.run uses harness.core.components.turn, so a change to harness.core.components.turn can break harness.core.components.run, while a change to harness.core.components.run can't break harness.core.components.turn.
Position
Below the diagonal: harness.core.components.run uses a module listed above it, which is the healthy direction.
harness.core.components.run uses api.views, so a change to api.views can break harness.core.components.run, while a change to harness.core.components.run can't break api.views.
Position
Below the diagonal: harness.core.components.run uses a module listed above it, which is the healthy direction.
harness.core.components.run uses harness.core.components.state, so a change to harness.core.components.state can break harness.core.components.run, while a change to harness.core.components.run can't break harness.core.components.state.
Position
Below the diagonal: harness.core.components.run uses a module listed above it, which is the healthy direction.
harness.core.components.run uses harness.core.components.promise, so a change to harness.core.components.promise can break harness.core.components.run, while a change to harness.core.components.run can't break harness.core.components.promise.
Position
Below the diagonal: harness.core.components.run uses a module listed above it, which is the healthy direction.
28→31 harness.core.components.run uses harness.core.components.contextpart of a loop✕
Connections
2 pairs of types, where a type in harness.core.components.run uses a type in harness.core.components.context.
harness.core.components.run uses harness.core.components.context, so a change to harness.core.components.context can break harness.core.components.run, while a change to harness.core.components.run can't break harness.core.components.context.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
store_pg uses harness.core.components.ids, so a change to harness.core.components.ids can break store_pg, while a change to store_pg can't break harness.core.components.ids.
Position
Below the diagonal: store_pg uses a module listed above it, which is the healthy direction.
29 pairs of types, where a type in store_pg uses a type in environments. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
store_pg uses harness.storage.session, so a change to harness.storage.session can break store_pg, while a change to store_pg can't break harness.storage.session.
Position
Below the diagonal: store_pg uses a module listed above it, which is the healthy direction.
harness.core.components.llm uses harness.blob, so a change to harness.blob can break harness.core.components.llm, while a change to harness.core.components.llm can't break harness.blob.
Position
Below the diagonal: harness.core.components.llm uses a module listed above it, which is the healthy direction.
harness.core.components.llm uses harness.session.ids, so a change to harness.session.ids can break harness.core.components.llm, while a change to harness.core.components.llm can't break harness.session.ids.
Position
Below the diagonal: harness.core.components.llm uses a module listed above it, which is the healthy direction.
harness.core.components.llm uses harness.core.components.ids, so a change to harness.core.components.ids can break harness.core.components.llm, while a change to harness.core.components.llm can't break harness.core.components.ids.
Position
Below the diagonal: harness.core.components.llm uses a module listed above it, which is the healthy direction.
harness.core.components.llm uses harness.core.components.turn, so a change to harness.core.components.turn can break harness.core.components.llm, while a change to harness.core.components.llm can't break harness.core.components.turn.
Position
Below the diagonal: harness.core.components.llm uses a module listed above it, which is the healthy direction.
harness.core.components.llm uses harness.core.components.workflow_tool, so a change to harness.core.components.workflow_tool can break harness.core.components.llm, while a change to harness.core.components.llm can't break harness.core.components.workflow_tool.
Position
Below the diagonal: harness.core.components.llm uses a module listed above it, which is the healthy direction.
harness.core.components.llm uses api.sessions, so a change to api.sessions can break harness.core.components.llm, while a change to harness.core.components.llm can't break api.sessions.
Position
Below the diagonal: harness.core.components.llm uses a module listed above it, which is the healthy direction.
harness.core.components.llm uses harness.core.components.tooling, so a change to harness.core.components.tooling can break harness.core.components.llm, while a change to harness.core.components.llm can't break harness.core.components.tooling.
Position
Below the diagonal: harness.core.components.llm uses a module listed above it, which is the healthy direction.
harness.core.components.llm uses harness.core.components.state, so a change to harness.core.components.state can break harness.core.components.llm, while a change to harness.core.components.llm can't break harness.core.components.state.
Position
Below the diagonal: harness.core.components.llm uses a module listed above it, which is the healthy direction.
harness.core.components.llm uses harness.core.components.run, so a change to harness.core.components.run can break harness.core.components.llm, while a change to harness.core.components.llm can't break harness.core.components.run.
Position
Below the diagonal: harness.core.components.llm uses a module listed above it, which is the healthy direction.
30→31 harness.core.components.llm uses harness.core.components.contextpart of a loop✕
Connections
5 pairs of types, where a type in harness.core.components.llm uses a type in harness.core.components.context.
harness.core.components.llm uses harness.core.components.context, so a change to harness.core.components.context can break harness.core.components.llm, while a change to harness.core.components.llm can't break harness.core.components.context.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
harness.core.components.context uses harness.blob, so a change to harness.blob can break harness.core.components.context, while a change to harness.core.components.context can't break harness.blob.
Position
Below the diagonal: harness.core.components.context uses a module listed above it, which is the healthy direction.
harness.core.components.context uses harness.core.components.ids, so a change to harness.core.components.ids can break harness.core.components.context, while a change to harness.core.components.context can't break harness.core.components.ids.
Position
Below the diagonal: harness.core.components.context uses a module listed above it, which is the healthy direction.
harness.core.components.context uses harness.core.components.state, so a change to harness.core.components.state can break harness.core.components.context, while a change to harness.core.components.context can't break harness.core.components.state.
Position
Below the diagonal: harness.core.components.context uses a module listed above it, which is the healthy direction.
harness.core.components.context uses harness.core.components.llm, so a change to harness.core.components.llm can break harness.core.components.context, while a change to harness.core.components.context can't break harness.core.components.llm.
Position
Below the diagonal: harness.core.components.context uses a module listed above it, which is the healthy direction.
api_projection uses harness.session.ids, so a change to harness.session.ids can break api_projection, while a change to api_projection can't break harness.session.ids.
Position
Below the diagonal: api_projection uses a module listed above it, which is the healthy direction.
api_projection uses harness.core.components.ids, so a change to harness.core.components.ids can break api_projection, while a change to api_projection can't break harness.core.components.ids.
Position
Below the diagonal: api_projection uses a module listed above it, which is the healthy direction.
api_projection uses harness.core.components.turn, so a change to harness.core.components.turn can break api_projection, while a change to api_projection can't break harness.core.components.turn.
Position
Below the diagonal: api_projection uses a module listed above it, which is the healthy direction.
api_projection uses harness.core.components.workflow_tool, so a change to harness.core.components.workflow_tool can break api_projection, while a change to api_projection can't break harness.core.components.workflow_tool.
Position
Below the diagonal: api_projection uses a module listed above it, which is the healthy direction.
api_projection uses harness.core.components.tooling, so a change to harness.core.components.tooling can break api_projection, while a change to api_projection can't break harness.core.components.tooling.
Position
Below the diagonal: api_projection uses a module listed above it, which is the healthy direction.
api_projection uses harness.core.components.state, so a change to harness.core.components.state can break api_projection, while a change to api_projection can't break harness.core.components.state.
Position
Below the diagonal: api_projection uses a module listed above it, which is the healthy direction.
api_projection uses harness.core.components.promise, so a change to harness.core.components.promise can break api_projection, while a change to api_projection can't break harness.core.components.promise.
Position
Below the diagonal: api_projection uses a module listed above it, which is the healthy direction.
api_projection uses harness.storage.session, so a change to harness.storage.session can break api_projection, while a change to api_projection can't break harness.storage.session.
Position
Below the diagonal: api_projection uses a module listed above it, which is the healthy direction.
api_projection uses harness.core.components.run, so a change to harness.core.components.run can break api_projection, while a change to api_projection can't break harness.core.components.run.
Position
Below the diagonal: api_projection uses a module listed above it, which is the healthy direction.
api_projection uses harness.core.components.llm, so a change to harness.core.components.llm can break api_projection, while a change to api_projection can't break harness.core.components.llm.
Position
Below the diagonal: api_projection uses a module listed above it, which is the healthy direction.
api_projection uses harness.core.components.context, so a change to harness.core.components.context can break api_projection, while a change to api_projection can't break harness.core.components.context.
Position
Below the diagonal: api_projection uses a module listed above it, which is the healthy direction.
eval uses harness.core.components.command, so a change to harness.core.components.command can break eval, while a change to eval can't break harness.core.components.command.
Position
Below the diagonal: eval uses a module listed above it, which is the healthy direction.
eval uses harness.core.components.ids, so a change to harness.core.components.ids can break eval, while a change to eval can't break harness.core.components.ids.
Position
Below the diagonal: eval uses a module listed above it, which is the healthy direction.
eval uses harness.core.components.turn, so a change to harness.core.components.turn can break eval, while a change to eval can't break harness.core.components.turn.
Position
Below the diagonal: eval uses a module listed above it, which is the healthy direction.
eval uses llm_clients.openai.responses, so a change to llm_clients.openai.responses can break eval, while a change to eval can't break llm_clients.openai.responses.
Position
Below the diagonal: eval uses a module listed above it, which is the healthy direction.
eval uses llm_clients.anthropic.messages, so a change to llm_clients.anthropic.messages can break eval, while a change to eval can't break llm_clients.anthropic.messages.
Position
Below the diagonal: eval uses a module listed above it, which is the healthy direction.
eval uses harness.core.components.run, so a change to harness.core.components.run can break eval, while a change to eval can't break harness.core.components.run.
Position
Below the diagonal: eval uses a module listed above it, which is the healthy direction.
eval uses harness.core.components.llm, so a change to harness.core.components.llm can break eval, while a change to eval can't break harness.core.components.llm.
Position
Below the diagonal: eval uses a module listed above it, which is the healthy direction.
eval uses harness.core.components.context, so a change to harness.core.components.context can break eval, while a change to eval can't break harness.core.components.context.
Position
Below the diagonal: eval uses a module listed above it, which is the healthy direction.
harness.core.drive uses harness.blob, so a change to harness.blob can break harness.core.drive, while a change to harness.core.drive can't break harness.blob.
Position
Below the diagonal: harness.core.drive uses a module listed above it, which is the healthy direction.
harness.core.drive uses harness.core.components.command, so a change to harness.core.components.command can break harness.core.drive, while a change to harness.core.drive can't break harness.core.components.command.
Position
Below the diagonal: harness.core.drive uses a module listed above it, which is the healthy direction.
harness.core.drive uses harness.session.ids, so a change to harness.session.ids can break harness.core.drive, while a change to harness.core.drive can't break harness.session.ids.
Position
Below the diagonal: harness.core.drive uses a module listed above it, which is the healthy direction.
harness.core.drive uses harness.core.components.ids, so a change to harness.core.components.ids can break harness.core.drive, while a change to harness.core.drive can't break harness.core.components.ids.
Position
Below the diagonal: harness.core.drive uses a module listed above it, which is the healthy direction.
harness.core.drive uses harness.core.components.turn, so a change to harness.core.components.turn can break harness.core.drive, while a change to harness.core.drive can't break harness.core.components.turn.
Position
Below the diagonal: harness.core.drive uses a module listed above it, which is the healthy direction.
harness.core.drive uses harness.core.io, so a change to harness.core.io can break harness.core.drive, while a change to harness.core.drive can't break harness.core.io.
Position
Below the diagonal: harness.core.drive uses a module listed above it, which is the healthy direction.
harness.core.drive uses harness.core.components.tooling, so a change to harness.core.components.tooling can break harness.core.drive, while a change to harness.core.drive can't break harness.core.components.tooling.
Position
Below the diagonal: harness.core.drive uses a module listed above it, which is the healthy direction.
harness.core.drive uses harness.core.components.state, so a change to harness.core.components.state can break harness.core.drive, while a change to harness.core.drive can't break harness.core.components.state.
Position
Below the diagonal: harness.core.drive uses a module listed above it, which is the healthy direction.
harness.core.drive uses harness.core.components.promise, so a change to harness.core.components.promise can break harness.core.drive, while a change to harness.core.drive can't break harness.core.components.promise.
Position
Below the diagonal: harness.core.drive uses a module listed above it, which is the healthy direction.
harness.core.drive uses harness.core.components.run, so a change to harness.core.components.run can break harness.core.drive, while a change to harness.core.drive can't break harness.core.components.run.
Position
Below the diagonal: harness.core.drive uses a module listed above it, which is the healthy direction.
harness.core.drive uses harness.core.components.llm, so a change to harness.core.components.llm can break harness.core.drive, while a change to harness.core.drive can't break harness.core.components.llm.
Position
Below the diagonal: harness.core.drive uses a module listed above it, which is the healthy direction.
harness.core.drive uses harness.core.components.context, so a change to harness.core.components.context can break harness.core.drive, while a change to harness.core.drive can't break harness.core.components.context.
Position
Below the diagonal: harness.core.drive uses a module listed above it, which is the healthy direction.
temporal_workflow.types uses environment_protocol.shared, so a change to environment_protocol.shared can break temporal_workflow.types, while a change to temporal_workflow.types can't break environment_protocol.shared.
Position
Below the diagonal: temporal_workflow.types uses a module listed above it, which is the healthy direction.
temporal_workflow.types uses harness.blob, so a change to harness.blob can break temporal_workflow.types, while a change to temporal_workflow.types can't break harness.blob.
Position
Below the diagonal: temporal_workflow.types uses a module listed above it, which is the healthy direction.
temporal_workflow.types uses harness.core.components.command, so a change to harness.core.components.command can break temporal_workflow.types, while a change to temporal_workflow.types can't break harness.core.components.command.
Position
Below the diagonal: temporal_workflow.types uses a module listed above it, which is the healthy direction.
temporal_workflow.types uses harness.session.ids, so a change to harness.session.ids can break temporal_workflow.types, while a change to temporal_workflow.types can't break harness.session.ids.
Position
Below the diagonal: temporal_workflow.types uses a module listed above it, which is the healthy direction.
temporal_workflow.types uses api.rpc, so a change to api.rpc can break temporal_workflow.types, while a change to temporal_workflow.types can't break api.rpc.
Position
Below the diagonal: temporal_workflow.types uses a module listed above it, which is the healthy direction.
temporal_workflow.types uses harness.core.components.ids, so a change to harness.core.components.ids can break temporal_workflow.types, while a change to temporal_workflow.types can't break harness.core.components.ids.
Position
Below the diagonal: temporal_workflow.types uses a module listed above it, which is the healthy direction.
temporal_workflow.types uses harness.core.components.workflow_tool, so a change to harness.core.components.workflow_tool can break temporal_workflow.types, while a change to temporal_workflow.types can't break harness.core.components.workflow_tool.
Position
Below the diagonal: temporal_workflow.types uses a module listed above it, which is the healthy direction.
temporal_workflow.types uses api.views, so a change to api.views can break temporal_workflow.types, while a change to temporal_workflow.types can't break api.views.
Position
Below the diagonal: temporal_workflow.types uses a module listed above it, which is the healthy direction.
temporal_workflow.types uses api.sessions, so a change to api.sessions can break temporal_workflow.types, while a change to temporal_workflow.types can't break api.sessions.
Position
Below the diagonal: temporal_workflow.types uses a module listed above it, which is the healthy direction.
temporal_workflow.types uses harness.core.io, so a change to harness.core.io can break temporal_workflow.types, while a change to temporal_workflow.types can't break harness.core.io.
Position
Below the diagonal: temporal_workflow.types uses a module listed above it, which is the healthy direction.
temporal_workflow.types uses harness.core.components.tooling, so a change to harness.core.components.tooling can break temporal_workflow.types, while a change to temporal_workflow.types can't break harness.core.components.tooling.
Position
Below the diagonal: temporal_workflow.types uses a module listed above it, which is the healthy direction.
temporal_workflow.types uses harness.core.components.state, so a change to harness.core.components.state can break temporal_workflow.types, while a change to temporal_workflow.types can't break harness.core.components.state.
Position
Below the diagonal: temporal_workflow.types uses a module listed above it, which is the healthy direction.
temporal_workflow.types uses harness.core.components.promise, so a change to harness.core.components.promise can break temporal_workflow.types, while a change to temporal_workflow.types can't break harness.core.components.promise.
Position
Below the diagonal: temporal_workflow.types uses a module listed above it, which is the healthy direction.
temporal_workflow.types uses harness.storage.session, so a change to harness.storage.session can break temporal_workflow.types, while a change to temporal_workflow.types can't break harness.storage.session.
Position
Below the diagonal: temporal_workflow.types uses a module listed above it, which is the healthy direction.
temporal_workflow.types uses harness.core.components.run, so a change to harness.core.components.run can break temporal_workflow.types, while a change to temporal_workflow.types can't break harness.core.components.run.
Position
Below the diagonal: temporal_workflow.types uses a module listed above it, which is the healthy direction.
temporal_workflow.types uses harness.core.components.llm, so a change to harness.core.components.llm can break temporal_workflow.types, while a change to temporal_workflow.types can't break harness.core.components.llm.
Position
Below the diagonal: temporal_workflow.types uses a module listed above it, which is the healthy direction.
temporal_workflow.types uses harness.core.components.context, so a change to harness.core.components.context can break temporal_workflow.types, while a change to temporal_workflow.types can't break harness.core.components.context.
Position
Below the diagonal: temporal_workflow.types uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses environment_protocol.shared, so a change to environment_protocol.shared can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break environment_protocol.shared.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses harness.blob, so a change to harness.blob can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break harness.blob.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses harness.core.components.command, so a change to harness.core.components.command can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break harness.core.components.command.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses harness.session.ids, so a change to harness.session.ids can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break harness.session.ids.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses api.rpc, so a change to api.rpc can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break api.rpc.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses harness.core.components.ids, so a change to harness.core.components.ids can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break harness.core.components.ids.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses api.access, so a change to api.access can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break api.access.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses environments, so a change to environments can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break environments.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses harness.core.components.turn, so a change to harness.core.components.turn can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break harness.core.components.turn.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses harness.core.components.workflow_tool, so a change to harness.core.components.workflow_tool can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break harness.core.components.workflow_tool.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses api.auth, so a change to api.auth can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break api.auth.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses api.views, so a change to api.views can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break api.views.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
26 pairs of types, where a type in temporal_runtime.gateway.service uses a type in api.sessions. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
temporal_runtime.gateway.service uses api.sessions, so a change to api.sessions can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break api.sessions.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses api.profiles, so a change to api.profiles can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break api.profiles.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
26 pairs of types, where a type in temporal_runtime.gateway.service uses a type in api.bots. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
temporal_runtime.gateway.service uses api.bots, so a change to api.bots can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break api.bots.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses llm_clients.anthropic.messages, so a change to llm_clients.anthropic.messages can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break llm_clients.anthropic.messages.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses bots.records, so a change to bots.records can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break bots.records.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses harness.core.components.state, so a change to harness.core.components.state can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break harness.core.components.state.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses harness.storage.session, so a change to harness.storage.session can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break harness.storage.session.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses harness.core.components.run, so a change to harness.core.components.run can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break harness.core.components.run.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses store_pg, so a change to store_pg can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break store_pg.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses harness.core.components.llm, so a change to harness.core.components.llm can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break harness.core.components.llm.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses harness.core.components.context, so a change to harness.core.components.context can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break harness.core.components.context.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses api_projection, so a change to api_projection can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break api_projection.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.gateway.service uses temporal_workflow.types, so a change to temporal_workflow.types can break temporal_runtime.gateway.service, while a change to temporal_runtime.gateway.service can't break temporal_workflow.types.
Position
Below the diagonal: temporal_runtime.gateway.service uses a module listed above it, which is the healthy direction.
temporal_runtime.worker.session_tools uses environment_protocol.shared, so a change to environment_protocol.shared can break temporal_runtime.worker.session_tools, while a change to temporal_runtime.worker.session_tools can't break environment_protocol.shared.
Position
Below the diagonal: temporal_runtime.worker.session_tools uses a module listed above it, which is the healthy direction.
temporal_runtime.worker.session_tools uses harness.session.ids, so a change to harness.session.ids can break temporal_runtime.worker.session_tools, while a change to temporal_runtime.worker.session_tools can't break harness.session.ids.
Position
Below the diagonal: temporal_runtime.worker.session_tools uses a module listed above it, which is the healthy direction.
temporal_runtime.worker.session_tools uses harness.core.components.ids, so a change to harness.core.components.ids can break temporal_runtime.worker.session_tools, while a change to temporal_runtime.worker.session_tools can't break harness.core.components.ids.
Position
Below the diagonal: temporal_runtime.worker.session_tools uses a module listed above it, which is the healthy direction.
temporal_runtime.worker.session_tools uses environments, so a change to environments can break temporal_runtime.worker.session_tools, while a change to temporal_runtime.worker.session_tools can't break environments.
Position
Below the diagonal: temporal_runtime.worker.session_tools uses a module listed above it, which is the healthy direction.
temporal_runtime.worker.session_tools uses harness.core.components.workflow_tool, so a change to harness.core.components.workflow_tool can break temporal_runtime.worker.session_tools, while a change to temporal_runtime.worker.session_tools can't break harness.core.components.workflow_tool.
Position
Below the diagonal: temporal_runtime.worker.session_tools uses a module listed above it, which is the healthy direction.
temporal_runtime.worker.session_tools uses api.sessions, so a change to api.sessions can break temporal_runtime.worker.session_tools, while a change to temporal_runtime.worker.session_tools can't break api.sessions.
Position
Below the diagonal: temporal_runtime.worker.session_tools uses a module listed above it, which is the healthy direction.
temporal_runtime.worker.session_tools uses harness.core.io, so a change to harness.core.io can break temporal_runtime.worker.session_tools, while a change to temporal_runtime.worker.session_tools can't break harness.core.io.
Position
Below the diagonal: temporal_runtime.worker.session_tools uses a module listed above it, which is the healthy direction.
temporal_runtime.worker.session_tools uses harness.core.components.promise, so a change to harness.core.components.promise can break temporal_runtime.worker.session_tools, while a change to temporal_runtime.worker.session_tools can't break harness.core.components.promise.
Position
Below the diagonal: temporal_runtime.worker.session_tools uses a module listed above it, which is the healthy direction.
temporal_runtime.worker.session_tools uses store_pg, so a change to store_pg can break temporal_runtime.worker.session_tools, while a change to temporal_runtime.worker.session_tools can't break store_pg.
Position
Below the diagonal: temporal_runtime.worker.session_tools uses a module listed above it, which is the healthy direction.
temporal_runtime.worker.session_tools uses temporal_workflow.types, so a change to temporal_workflow.types can break temporal_runtime.worker.session_tools, while a change to temporal_runtime.worker.session_tools can't break temporal_workflow.types.
Position
Below the diagonal: temporal_runtime.worker.session_tools uses a module listed above it, which is the healthy direction.
temporal_workflow.workflows.session uses harness.session.ids, so a change to harness.session.ids can break temporal_workflow.workflows.session, while a change to temporal_workflow.workflows.session can't break harness.session.ids.
Position
Below the diagonal: temporal_workflow.workflows.session uses a module listed above it, which is the healthy direction.
temporal_workflow.workflows.session uses api.rpc, so a change to api.rpc can break temporal_workflow.workflows.session, while a change to temporal_workflow.workflows.session can't break api.rpc.
Position
Below the diagonal: temporal_workflow.workflows.session uses a module listed above it, which is the healthy direction.
temporal_workflow.workflows.session uses harness.core.components.state, so a change to harness.core.components.state can break temporal_workflow.workflows.session, while a change to temporal_workflow.workflows.session can't break harness.core.components.state.
Position
Below the diagonal: temporal_workflow.workflows.session uses a module listed above it, which is the healthy direction.
temporal_workflow.workflows.session uses temporal_workflow.types, so a change to temporal_workflow.types can break temporal_workflow.workflows.session, while a change to temporal_workflow.workflows.session can't break temporal_workflow.types.
Position
Below the diagonal: temporal_workflow.workflows.session uses a module listed above it, which is the healthy direction.
temporal_runtime.bots.tools uses api.rpc, so a change to api.rpc can break temporal_runtime.bots.tools, while a change to temporal_runtime.bots.tools can't break api.rpc.
Position
Below the diagonal: temporal_runtime.bots.tools uses a module listed above it, which is the healthy direction.
temporal_runtime.bots.tools uses api.bots, so a change to api.bots can break temporal_runtime.bots.tools, while a change to temporal_runtime.bots.tools can't break api.bots.
Position
Below the diagonal: temporal_runtime.bots.tools uses a module listed above it, which is the healthy direction.
temporal_runtime.bots.tools uses bots.records, so a change to bots.records can break temporal_runtime.bots.tools, while a change to temporal_runtime.bots.tools can't break bots.records.
Position
Below the diagonal: temporal_runtime.bots.tools uses a module listed above it, which is the healthy direction.
temporal_runtime.bots.tools uses temporal_runtime.gateway.service, so a change to temporal_runtime.gateway.service can break temporal_runtime.bots.tools, while a change to temporal_runtime.bots.tools can't break temporal_runtime.gateway.service.
Position
Below the diagonal: temporal_runtime.bots.tools uses a module listed above it, which is the healthy direction.
temporal_runtime.worker.activities.state uses llm_clients.anthropic.messages, so a change to llm_clients.anthropic.messages can break temporal_runtime.worker.activities.state, while a change to temporal_runtime.worker.activities.state can't break llm_clients.anthropic.messages.
Position
Below the diagonal: temporal_runtime.worker.activities.state uses a module listed above it, which is the healthy direction.
temporal_runtime.worker.activities.state uses store_pg, so a change to store_pg can break temporal_runtime.worker.activities.state, while a change to temporal_runtime.worker.activities.state can't break store_pg.
Position
Below the diagonal: temporal_runtime.worker.activities.state uses a module listed above it, which is the healthy direction.
temporal_runtime.worker.activities.state uses temporal_runtime.worker.session_tools, so a change to temporal_runtime.worker.session_tools can break temporal_runtime.worker.activities.state, while a change to temporal_runtime.worker.activities.state can't break temporal_runtime.worker.session_tools.
Position
Below the diagonal: temporal_runtime.worker.activities.state 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
A07:2025 — Authentication Failures
25
High / Critical
A03:2025 — Software Supply Chain Failures
13
High / Critical
A05:2025 — Injection
10
High / Critical
A02:2025 — Security Misconfiguration
4
High / Critical
Roadmap
Immediately resolve the eleven leaked secrets in REDACTED, REDACTED, and REDACTED to secure the codebase. Reconcile the README and documentation with the actual repository structure to eliminate misleading references, and establish a process for recording significant design decisions in a dedicated ADR folder. Finally, fix the release pipeline by ensuring variables are correctly read and adding strict error handling to prevent publishing empty versions.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Reconcile the README with reality: README advertises Kubernetes, but no Kubernetes manifest or chart exists; crates/auth/README.md names `auth/grants/import`, but no file or folder `auth/grants/import` exists; docs/documentation/access-and-security/api-keys-and-service-access.md names `session/delete`, but no file or folder `session/delete` exists; docs/documentation/access-and-security/api-keys-and-service-access.md names `deployment/sessions`, but no file or folder `deployment/sessions` exists; docs/documentation/access-and-security/api-keys-and-service-access.md names `deployment/channels`, but no file or folder `deployment/channels` exists.
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Fix the release pipeline's version hand-off — read back the variable the step actually assigns, and add `set -euo pipefail` to the step so an unset variable fails the job instead of quietly publishing an empty version.
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
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 — 40
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 — 1361
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 — 114
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 8
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
Watchdog 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. 88 of 93 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 5 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three 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; ◐ Advisory — an LLM prose judgement. 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; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 93 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, 1471 of 1515 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, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: this repository's production source spans .ts, .tsx, .rs, and our analyzer cannot run the .rs test suite(s) — so no coverage was collected for the repository as a whole. The JavaScript/TypeScript half did build and run, and its own line coverage came back at 85.4% — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero. In the meantime, produce a coverage report in a standard format (lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`, or lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures and real coverage will be read. You can widen what we reach: optional: produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then both halves are read on the next scan.
D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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 989 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 85 test source file(s) (.rs) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT SCORED: this repository's production source includes .rs, and the rust executor ran against the .rs half and could not be re-run to completion inside our analyzer environment — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (vitest via `npm ci --ignore-scripts` in clients/typescript/; node:test via `npm ci --ignore-scripts` in docs/site/ (1 tests); vitest via `npm ci --ignore-scripts` in platform/backend/ (26 tests); vitest via `npm ci --ignore-scripts` in platform/configurator-mcp/; vitest via `npm ci --ignore-scripts` in platform/connectors/ (31 tests); vitest via `npm ci --ignore-scripts` in platform/web/): measured (0 flaky) suite(s) did re-run, and came back with 0 flaky across 1 measured tier(s) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted. The remedy is our analyzer environment, not a runner nobody has built.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in clients/typescript/ was NOT MEASURED: the install for clients/typescript/ left no `vitest` binary under node_modules, so the suite could not be launched. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in platform/configurator-mcp/ was NOT MEASURED: the install for platform/configurator-mcp/ left no `vitest` binary under node_modules, so the suite could not be launched. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in platform/web/ was NOT MEASURED: the vitest run in platform/web/ produced no per-test report (⎯⎯⎯⎯⎯⎯⎯ Startup Error ⎯⎯⎯⎯⎯⎯⎯⎯). This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (6 contributor(s) across 581 commit(s) sampled, automation and bot accounts excluded). One of them holds 97% of the history; the other 5 hold 0.6% 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.
D27 Navigability — not measured this run — Watchdog 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. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D30 Dependency Vulnerabilities — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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 scanner produced no output at all, so no dependency was actually scanned. 1 of 2 declared ecosystem(s) (osv) WERE scanned and every vulnerability they reported is included in this result; npm was not, so this dimension's score covers less than the dependency surface this repository declares, and nothing here is evidence that npm is free of known-vulnerable dependencies.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog 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. `clients/typescript/src/index.ts`, `clients/typescript/src/workflow.ts`, `platform/shared/src/index.ts`, `platform/web/src/components/models/model-defaults.tsx` 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.
D43 Malicious Dependencies — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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 scanner produced no output at all, so no dependency was actually scanned. 1 of 2 declared ecosystem(s) (osv) WERE scanned and every vulnerability they reported is included in this result; npm was not, so this dimension's score covers less than the dependency surface this repository declares, and nothing here is evidence that npm is free of known-vulnerable dependencies.
AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (REDACTED). compose up failed (exit 18 — an image could not be pulled) — postgres Pulling pgadmin Pulling temporal Pulling minio Pulling postgres Error Get "https://registry-1.docker.io/v2/": Forbidden temporal Error Get "https://registry-1.docker.io/v2/": Forbidden minio Error Get "https://registry-1.docker.io/v2/": Forbidden pgadmin Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: pgadmin Pulling minio Pulling temporal Pulling postgres Pulling minio Error Get "https://registry-1.docker.io/v2/": Forbidden pgadmin Error context canceled postgres Error context canceled temporal Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the runtime sandbox reaches registries only through the in-fence pull-through mirror, so an image the mirror does not carry cannot be fetched — this is a limit of our sandbox, not of your stack; runtime evidence skipped.
GD1 Unfinished & placeholder code — not measured this run — Watchdog 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 and Scala source only, and this repository's Rust is most of its product and 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 — Watchdog 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 and Scala source only, and this repository's Rust is most of its product and 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 — Watchdog measured this, but not all of it. What it 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. 65 further occurrence(s) are not listed individually; the score already reflects all 105.
R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 149 further occurrence(s) are not listed individually; the score already reflects all 189.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does 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.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
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.
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 Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
C4 Data Retention: This control is scored from in-repo evidence only — its real-world effectiveness, exercised only at runtime, is outside a static scan.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
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.
The LLM boundary
LLM-set scores this run (5): D19, D21, D22, D26, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
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.
192 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was gateway.gatewayRoutes at 237. A further 20 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being BuiltinTool::name_str at 44 — they are counted neither in the figure above nor in this dimension's score. 5 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: crates/tools/src/builtin/mod.rs (BuiltinTool::name_str at 44), crates/environment-daemon/src/server.rs (environment_daemon::server::handle_data at 27), crates/eval/src/main.rs (eval::builtin_operation_for_id at 17), crates/cli/src/session_cli.rs (cli::session_cli::handle at 16), crates/temporal-runtime/src/gateway/service/auth_api.rs (temporal_runtime::gateway::service::auth_api::map_auth_error at 16). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 136 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with gateway.gatewayRoutes (cyclomatic 237), workspace-transfers.WorkspaceTransfers (cyclomatic 178), SessionsPage.SessionDetail (cyclomatic 168). — 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 3 together lifts Cyclomatic Complexity from 5.1 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
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.
+ 154 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 6 bodies over 120 down to 120 or less in Cognitive Complexity — start with gateway.gatewayRoutes (cognitive 240), environment_daemon::filesystem::scan::scan (cognitive 162), workspace-transfers.WorkspaceTransfers (cognitive 159). — 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 6 together lifts Cognitive Complexity from 4.2 to about 5.2/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.7 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 121 FunctionTooLong finding(s) in God Classes — start with triggers.tsx (7), session-config-editor.tsx (6), EnvironmentsPage.tsx (6). — One of this dimension's main actionable groups (121 warning-level).
Resolve the 100 FileTooLong finding(s) in God Classes — start with lib.rs (3), session.rs (3), mod.rs (2). — One of this dimension's main actionable groups (100 warning-level).
Resolve the 30 MethodTooLong finding(s) in God Classes — start with session.rs (8), session_tools.rs (4), mod.rs (4). — One of this dimension's main actionable groups (30 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
293 duplicated block group(s) detected. A further 11 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 2 of the 304 are in trees this repository does not ship — vendored, example/demo, 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.
+ 64 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 31 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with auth_cli.rs (3), openai_completions.rs (2), drive.rs (2). — One of this dimension's main actionable groups (31 warning-level).
Resolve the 30 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with lib.rs (4), memory.rs (2), vfs.rs (2). — One of this dimension's main actionable groups (30 warning-level).
Resolve the 25 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with session.rs (5), vfs.rs (3), auth_cli.rs. — One of this dimension's main actionable groups (25 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling7.7 / 10Strong✓ 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.
33 production modules (Cargo+npm), 0 dependency cycle(s), 2 unstable depended-on module(s). Read from the build's own module declarations; 8 module(s) off the main sequence, with abstractness counted on 32 of the 33 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
Off the main sequence: @lightspeed-ai/platform-db · ×7
Unstable project store-pg
Unstable project temporal-workflow
Off the main sequence: @lightspeed-ai/platform-shared
What to do
Resolve the 7 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 1 Unstable project store-pg finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Unstable project temporal-workflow finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 1 Low cohesion finding(s) in Cohesion (LCOM4) — start with state.rs. — One of this dimension's main actionable groups (1 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
3541 test methods: 3184 unit, 357 integration, 0 BDD, 0 e2e. The JavaScript/TypeScript suite contributes 989 `it`/`test` case(s) across 162 test file(s) declaring at least one; its tier split is read from package names and paths only. The Rust suite contributes 2552 `#[test]` function(s) across 354 file(s) declaring at least one; its unit/integration split is Cargo's own — 72 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 989 tests. Measured on the JavaScript/TypeScript suite only — at least 85 test source file(s) (.rs) went unread, so its test quality is unmeasured and is not in these counts.
What it measures: Whether dependencies are current, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
15 outdated, 0 yanked direct Cargo dependencies. Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from REDACTED there.
Outdated: libc · ×15
✓ On the Gold path — maintain.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
Resolve the 11 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (5), REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (11 issue-level).
Enforce REDACTED Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
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 627 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares package.json, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Resolve the 98 Hotspot finding(s) in Churn × Complexity Hotspots — start with mod.rs (3), lib.rs (2), drive.rs (2). — One of this dimension's main actionable groups (98 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
0 deducted task-comment markers across 341796 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
The repository's root README (Lightspeed) gives a strong overview of the project and its Why Lightspeed? rationale plus links to the docs site. The platform/README documents the platform directory with a detailed list of components, people/universes/access, development, and demo build sections; clients/typescript/README is a focused SDK doc that is complete within its own directory. All 13 READMEs are present and well-structured per their scope, but the summary ends before any individual document's findings can be flagged. The documentation is comprehensive: the READMEs of each directory (platform/connectors/, scripts/dev/) document their own directories rather than the repository-wide project, but they are all well written for their audiences — one detailed Lightspeed connector host description with What it does, Authentication, Configuration, and a clipped outline; another Lightspeed development environment covering services, unified supervisor, startup errors, infrastructure primitives, and runtime environment; a dedicated Build and release guide that is itself clipped mid-sentence but the outlined sections exist (Local release build, Publication); and an authoritative product documentation index describing the manual's progression from getting started to internals plus roadmap pages. The root README is judged separately for its overview/installation/usage/contributing/licence scope. This is a comprehensive roadmap and design documentation set for an agent/VFS project with 13 READMEs plus 217 architecture/roadmap markdown files. Each document is well-structured: the P169–P173 roadmap series has a clear overview (immutable artifacts without workspace mounts, working directories and prompt/skill sources), detailed behavior sections, implementation progress, configuration examples, and full-outline outline for every named topic. The READMEs are all directory-specific deployment/usage docs with no cross-project overview; the root README is judged by its own roadmap rather than being flagged as missing an overall scope.
Documentation: contradicts the code · ×3docs/site/README.md
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
0 naming inconsistencies across 0 sampled symbols.
✓ On the Gold path — maintain.
Detailed fixes: d21_recommendation.md.
Do you agree with this assessment?
D22 · Internal API ConsistencyStronggated by 2 serious findings◐ Sampled · advisory
What it measures: Whether the internal API surface is consistent and coherent.
Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.
2 API inconsistencies across a 400-member sample of 2158 exposed types.
Ambiguous parsing intent: `parse` suggests general deserialization (e.g. from wire format), while `of` suggests construction from a specific domain concept (a method name). In other types like `Visibility`, only `parse` is used. If `of` is just a convenience for `parse`, it creates redundancy. If they serve different purposes, the naming convention is inconsistent with the rest of the API (which uses `parse` for string-to-type conversion).
Inconsistent response structure for read operations: `BotReadResponse` includes `access` metadata, whereas `AuthGrantReadResponse`, `AuthClientReadResponse`, `AuthProviderReadResponse`, and `BotTriggerReadResponse` only return the primary entity (e.g., `grant: AuthGrantView`). This forces consumers to handle two different response shapes for similar 'read' operations.
What to do
Resolve the 1 Ambiguous parsing intent finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Inconsistent response structure for read operations finding(s) in Internal API Consistency. — 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 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.
13 finding(s): 0 critical, 13 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
REDACTED
What to do
Resolve the 10 High secret finding(s) in Secrets (history) — start with REDACTED (4), REDACTED (4), REDACTED (2). — One of this dimension's main actionable groups (10 issue-level).
Resolve the 3 REDACTED finding(s) in Secrets (history) — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
10 finding(s): 0 critical, 1 high, 9 medium, 0 low. semgrep hit a parse error in 11 file(s) — `clients/typescript/src/index.ts` (line 31), `clients/typescript/src/workflow.ts` (line 11), `crates/temporal-runtime/src/environments/resolver.rs` (line 447, line 514), `crates/vfs/src/snapshot.rs` (line 129, line 201, line 209, …), `platform/backend/src/routes/gateway.ts`, … (+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 2 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
What to do
Resolve the 6 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (6 warning-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 warning-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.
11 finding(s): 0 critical, 3 high, 7 medium, 1 low. Partial dependency scan: 1 of 2 declared ecosystem(s) were scanned (osv), and the findings above are real and complete for them. npm was not scanned (npm: the scanner produced no output at all, so no dependency was actually scanned), so this is not the whole dependency surface and the result is reported at reduced confidence.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
What to do
Resolve the 3 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Resolve the 4 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3), REDACTED. — One of this dimension's main actionable groups (4 warning-level).
Resolve the 2 Medium vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 1 High IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 2 Low IaC finding(s) in IaC & Container Security — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 recommendation-level).
Resolve the 1 Medium IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 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.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 590 of the 776 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 2 Change coupling finding(s) in Change Coupling — start with schema_export.rs, main.rs. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored 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. SCORED, not informational.
No known-vulnerable dependencies in the 1 ecosystem(s) that were scanned (osv). Partial dependency scan: 1 of 2 declared ecosystem(s) were scanned (osv), and the findings above are real and complete for them. npm was not scanned (npm: the scanner produced no output at all, so no dependency was actually scanned), so this is not the whole dependency surface and the result is reported at reduced confidence.
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 1 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.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives10.0 / 10Exemplary○ Nothing flagged
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
Do you agree with this assessment?
AC2 · Forms & labels4.2 / 10Weak✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×26) — platform/web/src/components/bot/activity.tsx:144, platform/web/src/components/bot/cron-builder.tsx:188, platform/web/src/components/bot/cron-builder.tsx:237, …
This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×5) — platform/web/src/components/bot/setup.tsx:345, platform/web/src/components/models/model-api-key.tsx:538, platform/web/src/components/session/session-config-editor.tsx:1453, …
A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one. — platform/web/src/components/models/model-defaults.tsx:117
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label. (×5) — platform/web/src/components/session/session-settings-sheet.tsx:314, platform/web/src/pages/EnvironmentsPage.tsx:650, platform/web/src/pages/EnvironmentsPage.tsx:1281, …
This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×3) — platform/web/src/pages/EnvironmentsPage.tsx:949, platform/web/src/pages/ProfilesPage.tsx:532, platform/web/src/pages/SessionsPage.tsx:1214
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".
Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.
Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
<div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — platform/web/src/components/resize-handle.tsx:165
<input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — platform/web/src/components/session/composer-model-picker.tsx:73
<textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×3) — platform/web/src/pages/EnvironmentsPage.tsx:949, platform/web/src/pages/ProfilesPage.tsx:408, platform/web/src/pages/WorkspacesPage.tsx:562
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 132 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
What to do
Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
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.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
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.
Do you agree with this assessment?
AX8 · Test isolation7.5 / 10Strong✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
`eval` (production) references the test project `test-support`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
What to do
Remove every production → test project reference: extract any shared test helper into a production support library (which the tests reference), or invert the dependency so the test project depends on production — not the reverse.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Do you agree with this assessment?
C1 · Data Protection6.5 / 10Adequate✓ Tool-verified
Other · Security — Whether sensitive data is encrypted at rest and in transit and keys are vaulted.
Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.
No in-app HTTPS enforcement, but the server reads the forwarded scheme (X-Forwarded-Proto, actix's connection_info().scheme(), Rocket's proxy_proto_header) — a TLS-terminating reverse proxy sits in front of it, where serving TLS in the app would be wrong. Verify the reverse proxy enforces TLS. — crates/environment-provider-incus/src/edge.rs:99
What to do
Strengthen data-at-rest protection: vault your keys (AWS KMS / Secrets Manager, GCP KMS / REDACTED Manager, Azure Key Vault, HashiCorp Vault — not a key read from an environment variable beside the data) and encrypt the most sensitive columns (an AEAD over the field before Diesel/sqlx write it, SQLCipher, pgcrypto) — partial coverage still leaves gaps.
Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.
Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.
Do you agree with this assessment?
C4 · Data Retention6.5 / 10Adequate✓ Tool-verified
Other · Security — Whether data has a defined lifetime — retention periods, TTLs, cleanup jobs (storage limitation).
Method: Roslyn scan: retention/TTL configuration presence in schema; CascadeDelete detected but not scored as retention control. Deterministic, gated by PII presence.
A retention mechanism is present, but the data-lifecycle is not yet complete — missing: an expiry limit — a declared maximum age / TTL after which the data is no longer kept, a documented retention period / data-expiry.
What to do
Complete the data-lifecycle story: an expiry limit (a declared maximum age for the stored data — a retention-age setting, or a store-level TTL where your storage offers one), a scheduled purge/cleanup job that enforces it, and a documented retention period covering the personal data.
Other · Event Sourcing — Whether the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.
Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.
Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.
Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Add a README to the 26 of 35 project(s) that lack one — worth up to 1.5 pts.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
README advertises Kubernetes, but no Kubernetes manifest or chart exists — searched for: `kubernetes`, `k8s`, `helm`. Each was matched case- and separator-insensitively against file and directory NAMES anywhere in the tree, and against the CONTENTS of manifest and configuration files (package.json and other *.json, *.csproj, *.props, *.sln/*.slnx, *.yml, *.toml, *.config, tool configs such as eslint.config.js, Dockerfile); the README's own prose never counts, so a claim is never refuted by merely being made. Nothing outside that search was read — a footprint living only in a submodule, in a file type not listed here, or under a name none of those terms matches is not seen, and this row is then wrong. — README.md:141
crates/auth/README.md names `auth/grants/import`, but no file or folder `auth/grants/import` exists. 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. — crates/auth/README.md:70
docs/documentation/access-and-security/api-keys-and-service-access.md names `session/delete`, but no file or folder `session/delete` exists. 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/documentation/access-and-security/api-keys-and-service-access.md:47
docs/documentation/access-and-security/api-keys-and-service-access.md names `deployment/sessions`, but no file or folder `deployment/sessions` exists. 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/documentation/access-and-security/api-keys-and-service-access.md:51
docs/documentation/access-and-security/api-keys-and-service-access.md names `deployment/channels`, but no file or folder `deployment/channels` exists. 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/documentation/access-and-security/api-keys-and-service-access.md:190
docs/documentation/access-and-security/api-keys-and-service-access.md names `channels/inbound`, but no file or folder `channels/inbound` exists. 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/documentation/access-and-security/api-keys-and-service-access.md:190
docs/documentation/access-and-security/api-keys-and-service-access.md names `auth/lease`, but no file or folder `auth/lease` exists. 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/documentation/access-and-security/api-keys-and-service-access.md:190
docs/documentation/access-and-security/single-sign-on.md documents the environment variable `LIGHTSPEED_PLATFORM_OIDC_GROUPS_CLAIM`, but no code, script or configuration file names it. 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/documentation/access-and-security/single-sign-on.md:34
docs/documentation/access-and-security/single-sign-on.md documents the environment variable `LIGHTSPEED_PLATFORM_OIDC_SESSION_MAX_AGE_SECONDS`, but no code, script or configuration file names it. 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/documentation/access-and-security/single-sign-on.md:125
docs/documentation/deployment/configuration.md names `deployment/channels`, but no file or folder `deployment/channels` exists. 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/documentation/deployment/configuration.md:191
docs/documentation/deployment/configuration.md names `auth/lease`, but no file or folder `auth/lease` exists. 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/documentation/deployment/configuration.md:191
docs/documentation/deployment/configuration.md names `channels/inbound`, but no file or folder `channels/inbound` exists. 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/documentation/deployment/configuration.md:191
docs/documentation/deployment/operations.md documents the environment variable `LIGHTSPEED_RELEASE_ID`, but no code, script or configuration file names it. 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/documentation/deployment/operations.md:190
docs/documentation/deployment/self-hosting.md documents the environment variable `LIGHTSPEED_RELEASE_TAG`, but no code, script or configuration file names it. 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/documentation/deployment/self-hosting.md:57
docs/documentation/deployment/self-hosting.md documents the environment variable `LIGHTSPEED_RELEASE_ID`, but no code, script or configuration file names it. 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/documentation/deployment/self-hosting.md:69
docs/documentation/deployment/self-hosting.md documents the environment variable `RELEASE_REF`, but no code, script or configuration file names it. 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/documentation/deployment/self-hosting.md:91
docs/documentation/deployment/self-hosting.md documents the environment variable `LIGHTSPEED_ARCHIVE`, but no code, script or configuration file names it. 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/documentation/deployment/self-hosting.md:400
docs/documentation/deployment/self-hosting.md documents the environment variable `LIGHTSPEED_ARCHIVE_SHA`, but no code, script or configuration file names it. 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/documentation/deployment/self-hosting.md:402
docs/documentation/development/local-development.md names `deployment/universes`, but no file or folder `deployment/universes` exists. 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/documentation/development/local-development.md:71
docs/documentation/environments/bring-your-own-compute.md documents the environment variable `LIGHTSPEED_ENVD_BIN`, but no code, script or configuration file names it. 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/documentation/environments/bring-your-own-compute.md:40
docs/documentation/environments/credentials.md documents the environment variable `ACORN_RELEASE_TOKEN`, but no code, script or configuration file names it. 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/documentation/environments/credentials.md:30
docs/documentation/environments/credentials.md names `environments/credentials/bind`, but no file or folder `environments/credentials/bind` exists. 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/documentation/environments/credentials.md:178
docs/documentation/environments/incus-vms.md documents the environment variable `LIGHTSPEED_CHECKOUT`, but no code, script or configuration file names it. 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/documentation/environments/incus-vms.md:61
docs/documentation/environments/incus-vms.md documents the environment variable `LIGHTSPEED_IMAGE_WORKDIR`, but no code, script or configuration file names it. 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/documentation/environments/incus-vms.md:62
docs/documentation/environments/power-and-cleanup.md names `environments/power/put`, but no file or folder `environments/power/put` exists. 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/documentation/environments/power-and-cleanup.md:220
docs/documentation/environments/power-and-cleanup.md names `environments/idle-policy/put`, but no file or folder `environments/idle-policy/put` exists. 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/documentation/environments/power-and-cleanup.md:220
docs/documentation/environments/processes-and-jobs.md names `check-release.sh`, but no file or folder `check-release.sh` exists. 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/documentation/environments/processes-and-jobs.md:35
docs/documentation/environments/processes-and-jobs.md names `check-result.txt`, but no file or folder `check-result.txt` exists. 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/documentation/environments/processes-and-jobs.md:206
docs/documentation/environments/processes-and-jobs.md names `environments/jobs/cancel`, but no file or folder `environments/jobs/cancel` exists. 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/documentation/environments/processes-and-jobs.md:240
docs/documentation/environments/processes-and-jobs.md names `process/start`, but no file or folder `process/start` exists. 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/documentation/environments/processes-and-jobs.md:242
docs/documentation/environments/using-environments.md names `session/config/put`, but no file or folder `session/config/put` exists. 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/documentation/environments/using-environments.md:219
docs/documentation/environments/using-environments.md names `session/start`, but no file or folder `session/start` exists. 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/documentation/environments/using-environments.md:224
docs/documentation/environments/using-environments.md names `environments/list`, but no file or folder `environments/list` exists. 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/documentation/environments/using-environments.md:237
docs/documentation/environments/using-environments.md names `environments/read`, but no file or folder `environments/read` exists. 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/documentation/environments/using-environments.md:237
docs/documentation/environments/using-environments.md names `session/environments/activate`, but no file or folder `session/environments/activate` exists. 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/documentation/environments/using-environments.md:238
docs/documentation/environments/using-environments.md names `session/environments/deactivate`, but no file or folder `session/environments/deactivate` exists. 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/documentation/environments/using-environments.md:238
docs/documentation/environments/vfs-transfer.md names `fs/transfer`, but no file or folder `fs/transfer` exists. 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/documentation/environments/vfs-transfer.md:90
docs/documentation/environments/vfs-transfer.md names `fs/materialize`, but no file or folder `fs/materialize` exists. 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/documentation/environments/vfs-transfer.md:109
docs/documentation/environments/vfs-transfer.md names `fs/scan`, but no file or folder `fs/scan` exists. 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/documentation/environments/vfs-transfer.md:116
docs/documentation/getting-started/first-agent.md names `changes.md`, but no file or folder `changes.md` exists. 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/documentation/getting-started/first-agent.md:72
What to do
Reconcile the README with reality: README advertises Kubernetes, but no Kubernetes manifest or chart exists; crates/auth/README.md names `auth/grants/import`, but no file or folder `auth/grants/import` exists; docs/documentation/access-and-security/api-keys-and-service-access.md names `session/delete`, but no file or folder `session/delete` exists; docs/documentation/access-and-security/api-keys-and-service-access.md names `deployment/sessions`, but no file or folder `deployment/sessions` exists; docs/documentation/access-and-security/api-keys-and-service-access.md names `deployment/channels`, but no file or folder `deployment/channels` exists.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning6.0 / 10Adequate✓ Tool-verified
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
1942/2328 types (83%) declared in the published library are public. For a library, every public type is a stability contract — keep implementation types off the surface and expose only the intended API.
What to do
Keep implementation types off the public surface (Rust: `pub(crate)`, or keep the module private) so internals can change without breaking consumers.
Do you agree with this assessment?
P2 · Observability8.1 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 6/17 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `crates/api`, `crates/cli`, `crates/environment-daemon`, `crates/environment-provider-incus`, `crates/eval` and 6 more.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
What to do
The pipeline declares a deployment environment, but whether required reviewers / protection rules are attached to it lives in repository settings we cannot read — confirm the gate is enforced before production promotion.
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
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
Do you agree with this assessment?
P6 · Release Hygiene3.0 / 10Weak✓ Tool-verified
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
`.github/workflows/release-tag.yml:63` writes `version=$LIGHTSPEED_PRODUCT_VERSION` to `$GITHUB_OUTPUT`, but `$LIGHTSPEED_PRODUCT_VERSION` is assigned nowhere in that `run:` block, and nowhere else in the workflow. The block runs under `set -u`, so the step ABORTS instead of publishing — the release never reaches the publisher. — .github/workflows/release-tag.yml:63
`REDACTED:59` writes `version=$LIGHTSPEED_PRODUCT_VERSION` to `$GITHUB_OUTPUT`, but `$LIGHTSPEED_PRODUCT_VERSION` is assigned nowhere in that `run:` block, and nowhere else in the workflow. The block runs under `set -u`, so the step ABORTS instead of publishing — the release never reaches the publisher. — REDACTED:59
`REDACTED:60` writes `rust_version=$LIGHTSPEED_RELEASE_RUST_VERSION` to `$GITHUB_OUTPUT`, but `$LIGHTSPEED_RELEASE_RUST_VERSION` is assigned nowhere in that `run:` block, and nowhere else in the workflow. The block runs under `set -u`, so the step ABORTS instead of publishing — the release never reaches the publisher. — REDACTED:60
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Fix the release pipeline's version hand-off — read back the variable the step actually assigns, and add `set -euo pipefail` to the step so an unset variable fails the job instead of quietly publishing an empty version.
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
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.
`reqwest::Client::builder(` 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. — crates/cli/src/api_client.rs:92
`reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — crates/environment-provider-incus/src/edge.rs:34
`fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×3) — REDACTED:23, REDACTED:55, REDACTED:61
What to do
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.
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 asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
Do you agree with this assessment?
R1 · Type Safety9.4 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
What to do
Migrate the remaining .js/.jsx files to TypeScript.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.
47 duplicated blocks under platform/web/src/ have copies in at least two of the sibling directories components, lib, pages — 22 of them are reported below, and 25 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 47 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 47 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 47 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — platform/web/src/components/universe-switcher.tsx:118
7 duplicated blocks under platform/web/src/components/ have copies in at least two of the sibling directories bot, credentials, mcp, models, session — 3 of them are reported below, and 4 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 7 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — platform/web/src/components/credentials/github-app.tsx:226
6 duplicated blocks under platform/ have copies in at least two of the sibling directories backend, cli, configurator-mcp, connectors, shared, web — 5 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — platform/configurator-mcp/src/upstream-client.ts:74
platform/web/src/pages/AdminApiKeysPage.tsx:69 · platform/web/src/pages/ApiKeysPage.tsx:80 — the two spans are one implementation copied and then locally edited — 1359 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — platform/web/src/pages/AdminApiKeysPage.tsx:69
platform/web/src/pages/ApiKeysPage.tsx:73 · platform/web/src/pages/CredentialsPage.tsx:128 — the two spans are one implementation copied and then locally edited — 697 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — platform/web/src/pages/ApiKeysPage.tsx:73
platform/web/src/components/ui/dialog.tsx:10 · platform/web/src/components/ui/sheet.tsx:8 — the two spans are one implementation copied and then locally edited — 462 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — platform/web/src/components/ui/dialog.tsx:10
platform/web/src/components/ui/combobox.tsx:122 · platform/web/src/components/ui/select.tsx:103 — the two spans are one implementation copied and then locally edited — 257 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — platform/web/src/components/ui/combobox.tsx:122
platform/web/src/components/credentials/github-app.tsx:226 · platform/web/src/components/models/subscription.tsx:158 — the two spans are one implementation copied and then locally edited — 372 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — platform/web/src/components/credentials/github-app.tsx:226
platform/connectors/src/presentation/telegram.ts:24 · platform/connectors/src/presentation/whatsapp.ts:19 — the two spans are one implementation copied and then locally edited — 376 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — platform/connectors/src/presentation/telegram.ts:24
platform/web/src/components/models/model-api-key.tsx:242 · platform/web/src/components/models/model-api-key.tsx:573 — the two spans are one implementation copied and then locally edited — 299 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — platform/web/src/components/models/model-api-key.tsx:242
platform/web/src/pages/ProfilesPage.tsx:688 · platform/web/src/pages/WorkspacesPage.tsx:651 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — platform/web/src/pages/ProfilesPage.tsx:688
platform/web/src/components/universe-switcher.tsx:118 · platform/web/src/pages/WorkspacesPage.tsx:605 — the two spans are one implementation copied and then locally edited — 263 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — platform/web/src/components/universe-switcher.tsx:118
platform/connectors/src/providers/telegram/delivery.ts:37 · platform/connectors/src/providers/whatsapp/delivery.ts:38 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — platform/connectors/src/providers/telegram/delivery.ts:37
platform/web/src/pages/ProfilesPage.tsx:576 · platform/web/src/pages/SessionsPage.tsx:1230 — the two spans are one implementation copied and then locally edited — 216 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — platform/web/src/pages/ProfilesPage.tsx:576
platform/web/src/components/ui/dropdown-menu.tsx:19 · platform/web/src/components/ui/popover.tsx:14 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — platform/web/src/components/ui/dropdown-menu.tsx:19
platform/backend/src/routes/gateway.ts:1359 · platform/backend/src/routes/gateway.ts:1403 — 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. — platform/backend/src/routes/gateway.ts:1359
platform/web/src/components/ui/field.tsx:10 · platform/web/src/components/ui/message.tsx:5 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — platform/web/src/components/ui/field.tsx:10
platform/web/src/components/models/model-api-key.tsx:124 · platform/web/src/components/models/subscription.tsx:76 — the two spans are one implementation copied and then locally edited — 155 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — platform/web/src/components/models/model-api-key.tsx:124
platform/web/src/pages/SessionsPage.tsx:460 · platform/web/src/pages/SessionsPage.tsx:515 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — platform/web/src/pages/SessionsPage.tsx:460
platform/web/src/components/workspace-transfers.tsx:767 · platform/web/src/components/workspace-transfers.tsx:832 · platform/web/src/components/workspace-transfers.tsx:984 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — platform/web/src/components/workspace-transfers.tsx:767
platform/web/src/components/credentials/github-app.tsx:180 · platform/web/src/components/models/model-api-key.tsx:547 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — platform/web/src/components/credentials/github-app.tsx:180
platform/web/src/pages/MembersPage.tsx:150 · platform/web/src/pages/ProfilesPage.tsx:371 — the two spans are one implementation copied and then locally edited — 99 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — platform/web/src/pages/MembersPage.tsx:150
platform/web/src/components/ui/dropdown-menu.tsx:7 · platform/web/src/components/ui/popover.tsx:6 · platform/web/src/components/ui/tooltip.tsx:20 — the 3 copies are spread across 3 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — platform/web/src/components/ui/dropdown-menu.tsx:7
platform/backend/src/routes/gateway.ts:2049 · platform/backend/src/routes/gateway.ts:2079 — 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. — platform/backend/src/routes/gateway.ts:2049
platform/connectors/src/providers/telegram/media.ts:86 · REDACTED:157 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — platform/connectors/src/providers/telegram/media.ts:86
platform/web/src/pages/ProfilesPage.tsx:98 · platform/web/src/pages/SessionsPage.tsx:184 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — platform/web/src/pages/ProfilesPage.tsx:98
platform/backend/src/routes/gateway.ts:650 · platform/backend/src/routes/gateway.ts:674 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — platform/backend/src/routes/gateway.ts:650
platform/web/src/components/confirm-danger-button.tsx:30 · platform/web/src/pages/GeneralSettingsPage.tsx:253 — the two spans are one implementation copied and then locally edited — 70 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — platform/web/src/components/confirm-danger-button.tsx:30
platform/configurator-mcp/src/upstream-client.ts:74 · platform/connectors/src/providers/telegram/media.ts:136 — the two spans are one implementation copied and then locally edited — 92 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — platform/configurator-mcp/src/upstream-client.ts:74
platform/web/src/components/bot/chat.tsx:21 · platform/web/src/components/bot/detail.tsx:130 — the two spans are one implementation copied and then locally edited — 69 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — platform/web/src/components/bot/chat.tsx:21
platform/web/src/components/bot/send-event-dialog.tsx:51 · platform/web/src/pages/MembersPage.tsx:285 — the two spans are one implementation copied and then locally edited — 90 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — platform/web/src/components/bot/send-event-dialog.tsx:51
platform/web/src/components/icons/bot.tsx:8 · platform/web/src/components/icons/bot.tsx:40 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — platform/web/src/components/icons/bot.tsx:8
platform/web/src/pages/GeneralSettingsPage.tsx:254 · platform/web/src/pages/ProfilesPage.tsx:371 — the two spans are one implementation copied and then locally edited — 80 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — platform/web/src/pages/GeneralSettingsPage.tsx:254
platform/web/src/pages/ProfilesPage.tsx:124 · platform/web/src/pages/WorkspacesPage.tsx:200 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — platform/web/src/pages/ProfilesPage.tsx:124
platform/web/src/components/bot/setup.tsx:1050 · platform/web/src/pages/EnvironmentsPage.tsx:1159 — the two spans are one implementation copied and then locally edited — 102 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — platform/web/src/components/bot/setup.tsx:1050
platform/web/src/components/session/session-config-editor.tsx:1590 · platform/web/src/components/session/session-config-editor.tsx:1607 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — platform/web/src/components/session/session-config-editor.tsx:1590
platform/web/src/components/workspace-transfers.tsx:728 · platform/web/src/components/workspace-transfers.tsx:805 · platform/web/src/components/workspace-transfers.tsx:954 — 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. — platform/web/src/components/workspace-transfers.tsx:728
platform/web/src/pages/ChannelsPage.tsx:269 · platform/web/src/pages/GeneralSettingsPage.tsx:254 — the two spans are one implementation copied and then locally edited — 71 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — platform/web/src/pages/ChannelsPage.tsx:269
platform/web/src/pages/EnvironmentsPage.tsx:1277 · platform/web/src/pages/EnvironmentsPage.tsx:1423 — the two spans are one implementation copied and then locally edited — 106 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — platform/web/src/pages/EnvironmentsPage.tsx:1277
platform/scripts/generate-config-reference.mjs:51 · platform/scripts/generate-config-reference.mjs:83 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — platform/scripts/generate-config-reference.mjs:51
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).
Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.
REDACTED:6 imports platform/backend/test/identity-fixture.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — REDACTED:6
What to do
Fix the listed violations: move the shared test helper into a source directory production code may depend on (1 row).
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
SessionDetail has cyclomatic complexity 96 and cognitive complexity 83; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — platform/web/src/pages/SessionsPage.tsx:1303
(anonymous) has cyclomatic complexity 82 and cognitive complexity 118; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — platform/backend/src/auth.ts:119
ServerDialog has cyclomatic complexity 72 and cognitive complexity 63; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — platform/web/src/pages/McpServersPage.tsx:359
configError has cyclomatic complexity 68 and cognitive complexity 93; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — platform/web/src/components/session/session-config-editor.tsx:412
Wizard has cyclomatic complexity 57 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — platform/web/src/pages/BotCreatePage.tsx:142
SessionComposer has cyclomatic complexity 57 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — platform/web/src/components/session/composer.tsx:51
WorkspaceTransfers has cyclomatic complexity 57 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — platform/web/src/components/workspace-transfers.tsx:93
applyEvents has cyclomatic complexity 55 and cognitive complexity 60; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — platform/web/src/lib/sessions/transcript.ts:257
normalizeSessionConfig has cyclomatic complexity 53 and cognitive complexity 121; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — platform/web/src/components/session/session-config-editor.tsx:253
createPlan has cyclomatic complexity 52 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:190
LiveSessionSetup has cyclomatic complexity 49 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — platform/web/src/components/session/session-settings-sheet.tsx:94
NewSessionDialog has cyclomatic complexity 47 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — platform/web/src/pages/SessionsPage.tsx:921
applyNonToolCallItem has cyclomatic complexity 45 and cognitive complexity 72; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — platform/web/src/lib/sessions/transcript.ts:735
OtherBotsSection has cyclomatic complexity 41 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — platform/web/src/components/bot/setup.tsx:791
SessionList has cyclomatic complexity 40 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — platform/web/src/pages/SessionsPage.tsx:195
EnvironmentCard has cyclomatic complexity 39 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — platform/web/src/pages/EnvironmentsPage.tsx:293
SessionResourceChips has cyclomatic complexity 38 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — platform/web/src/components/session/session-resources.tsx:70
EventRow has cyclomatic complexity 36 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — platform/web/src/components/bot/activity.tsx:319
applyItems has cyclomatic complexity 35 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — platform/web/src/lib/sessions/transcript.ts:642
ToolPicker has cyclomatic complexity 34 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — platform/web/src/components/mcp/tool-picker.tsx:48
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files5.9 / 10Adequate✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
platform/web/src/components/bot/triggers.tsx has 2563 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/components/bot/triggers.tsx:1
platform/web/src/pages/SessionsPage.tsx has 2452 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/pages/SessionsPage.tsx:1
platform/backend/src/routes/gateway.ts has 2316 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/backend/src/routes/gateway.ts:1
platform/web/src/components/session/session-config-editor.tsx has 2171 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/components/session/session-config-editor.tsx:1
platform/web/src/pages/EnvironmentsPage.tsx has 1415 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/pages/EnvironmentsPage.tsx:1
platform/web/src/pages/McpServersPage.tsx has 1327 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/pages/McpServersPage.tsx:1
platform/web/src/components/workspace-transfers.tsx has 1299 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/components/workspace-transfers.tsx:1
platform/web/src/lib/sessions/transcript.ts has 1150 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/lib/sessions/transcript.ts:1
platform/web/src/components/bot/setup.tsx has 1079 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/components/bot/setup.tsx:1
platform/web/src/components/models/model-api-key.tsx has 881 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/components/models/model-api-key.tsx:1
platform/web/src/pages/WorkspacesPage.tsx has 859 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/pages/WorkspacesPage.tsx:1
platform/web/src/pages/BotCreatePage.tsx has 847 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/pages/BotCreatePage.tsx:1
platform/web/src/pages/ProfilesPage.tsx has 785 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/pages/ProfilesPage.tsx:1
platform/web/src/pages/CredentialsPage.tsx has 697 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/pages/CredentialsPage.tsx:1
platform/web/src/components/ui/sidebar.tsx has 673 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/components/ui/sidebar.tsx:1
platform/web/src/api.ts has 670 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/api.ts:1
platform/web/src/pages/AdminEnvironmentProvidersPage.tsx has 609 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/pages/AdminEnvironmentProvidersPage.tsx:1
platform/backend/src/routes/universes.ts has 598 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/backend/src/routes/universes.ts:1
platform/web/src/components/session/session-settings-sheet.tsx has 578 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/components/session/session-settings-sheet.tsx:1
platform/web/src/pages/ChannelsPage.tsx has 532 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/pages/ChannelsPage.tsx:1
platform/web/src/components/session/tool-trace.tsx has 505 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/components/session/tool-trace.tsx:1
platform/backend/src/routes/setups.ts has 486 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/backend/src/routes/setups.ts:1
platform/web/src/pages/AdminUsersPage.tsx has 484 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/pages/AdminUsersPage.tsx:1
platform/web/src/components/bot/detail.tsx has 462 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/components/bot/detail.tsx:1
platform/web/src/components/bot/activity.tsx has 459 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/components/bot/activity.tsx:1
platform/web/src/pages/AdminUniversesPage.tsx has 458 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/pages/AdminUniversesPage.tsx:1
platform/web/src/components/session/composer.tsx has 442 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/components/session/composer.tsx:1
platform/web/src/components/session/transcript-view.tsx has 415 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/web/src/components/session/transcript-view.tsx:1
platform/shared/src/workspace-transfers.ts has 413 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — platform/shared/src/workspace-transfers.ts:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage9.4 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×16) — platform/cli/src/main.ts:1, platform/db/scripts/check-migrations.ts:1, REDACTED:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
What to do
Bump outdated dependencies to current versions to limit upgrade debt.
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code9.8 / 10Exemplary✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
2 file(s) (~411 LoC) were excluded from dead-code analysis. This package DOES declare main/module/exports — but every declared target is missing from the scanned tree, which is what a build-output entry (dist/, lib/, out/) looks like before the package is built. Point a declared target at the source entry, or build the package before scanning, so reachability can follow it. — clients/typescript
Unreachable from the 44 application, 13 tooling and 160 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
no import path from any entry point (44 application, 13 tooling, 160 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×4) — platform/db/scripts/auth-codegen.ts, platform/db/scripts/patch-auth-schema.mjs, platform/connectors/src/providers/whatsapp/index.ts, …
Nothing imports this binding — it is safe to review for removal. (×3) — platform/connectors/src/media/inbound.ts:4, platform/web/src/components/bot/identity.ts:16, platform/web/src/components/bot/status.tsx:74
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
Imported but not declared in any reachable package.json — installs work only by hoisting accident. — platform/backend/src/routes/workspace-transfers.test.ts:2
Imported only as a TYPE and declared in no reachable package.json. The import is erased at compile time, so nothing is installed and no runtime resolution depends on it — but type-checking a clean clone will fail. Declare the typings it resolves through (or the package itself) in the owning package.json. — platform/configurator-mcp/src/tool-result.ts:5
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Security — Read from this repository's Rust source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository serves HTTP itself (`axum::serve(` (crates/environment-provider-incus/src/server.rs:60)), so its Rust source was also read for the server controls: TLS served or HSTS set, security response headers, cookie flags and inbound validation — each credited where its Rust spelling appears in production source, not proven on every route. A Rocket 0.5 application is credited the headers Rocket's default `Shield` sends unless it attaches its own, and its cookie jar's SameSite=Strict default; a session middleware its default cookie flags.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.
None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `axum::serve(` (crates/environment-provider-incus/src/server.rs:60).
What to do
Set security response headers on what the server sends — actix-web's `DefaultHeaders::new().add((header::X_CONTENT_TYPE_OPTIONS, "nosniff"))`, tower-http's `SetResponseHeaderLayer::overriding(…)` on an axum router, or keep Rocket's default `Shield` — with `Content-Security-Policy`, `X-Content-Type-Options` and a frame policy on every response.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. 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 `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document3.5 / 10Weak✓ Tool-verified
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
`replyFormatted` is exported, takes a document from its caller (line 78) and hands it to `plain`, which calls itself at line 110 (`plain`) with a piece of `node` — and nowhere in `plain` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `plain` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — platform/web/src/components/session/reply-copy.ts:110
What to do
Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
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.
Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 4/9 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`providerRequest` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:22
`admin` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:60
`api` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — platform/cli/src/client.ts:12
`queryFn` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — platform/web/src/auth.ts:31
`sendSampleWebhook` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — platform/web/src/components/bot/triggers.tsx:673
What to do
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. 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 `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped5.2 / 10Adequate✓ Tool-verified
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
`classAttr` is text this program did not author, and it is written into an unquoted attribute through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. HTML text encoding does not help in an unquoted attribute — whitespace ends it; quote the attribute and encode the value. — platform/connectors/src/presentation/telegram.ts:21
`escapeHtml(token.href)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — platform/connectors/src/presentation/telegram.ts:64
What to do
Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen.
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.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×10) — platform/backend/src/static.ts:51, platform/connectors/src/providers/typing.ts:55, platform/web/src/lib/composer-model.ts:108, …
`.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. (×4) — platform/web/src/lib/dictation.ts:24, platform/web/src/lib/audio-capture.ts:22, platform/web/src/lib/audio-capture.ts:35, …
`catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, 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. — platform/web/src/lib/audio-capture.ts:37
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `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.
Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
7/8 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
~2.0 `!` null assertions per 1k TypeScript source lines — 106 assertion(s) across the 54338 source line(s) of the 262 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: REDACTED (7), platform/web/src/pages/SessionsPage.tsx (7), platform/web/src/pages/WorkspacesPage.tsx (7). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
What to do
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 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.
P12 CI test-gate honesty — 4 observation(s) recorded · Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 8 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 — 2 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 — Repo shows no audit-logging mechanism (an audit-log table or model — a struct, Diesel table, SeaORM entity or SQL migration table named for it — a SeaORM ActiveModelBehavior hook or database trigger that records each change, or an event-sourced store beside one) for sensitive changes — absence of evidence is not evidence of a working control. Record an audit trail in code (or document where it lives) so this dimension can be scored.
C5 Data-Subject Rights — Repo shows no corroborated data-subject-rights mechanism (erasure / export-portability / consent) tied to a subject id or GDPR vocabulary — absence of evidence is not evidence of a working control. Implement erasure, data export/portability and consent tracking over the subject's records.
Not included — 34 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.
AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — Not applicable: Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — compose up failed (exit 18 — an image could not be pulled) — postgres Pulling pgadmin Pulling temporal Pulling minio Pulling postgres Error Get "https://registry-1.docker.io/v2/": Forbidden temporal Error Get "https://registry-1.docker.io/v2/": Forbidden minio Error Get "https://registry-1.docker.io/v2/": Forbidden pgadmin Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: pgadmin Pulling minio Pulling temporal Pulling postgres Pulling minio Error Get "https://registry-1.docker.io/v2/": Forbidden pgadmin Error context canceled postgres Error context canceled temporal Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the runtime sandbox reaches registries only through the in-fence pull-through mirror, so an image the mirror does not carry cannot be fetched — this is a limit of our sandbox, not of your stack; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
D11 Test Reliability — Test reliability not scored — polyglot repository, one half's runner produced no measurement
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.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 4 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not measured — polyglot repository, one half has no runner
DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 64 value object(s); 16 domain event(s); its domain events are published by services or handlers — no domain entity raises one
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, 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
P9 Domain vs controller coverage — coverage data present for 1 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `#[bench]`, criterion's `bench_function`/`bench_with_input`, `#[divan::bench]` or `#[library_benchmark]` in any `.rs` file, or criterion, divan, iai or a `[[bench]]` target in a Cargo.toml, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not applicable: Rust spells out every heap allocation and makes borrowed slices (&[T], &str) its ordinary parameter types, so the allocation-aware style this card rewards elsewhere is the language's baseline rather than a rung to climb. TypeScript/JavaScript runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
X26 Unsynchronised callback handoff — Not applicable: this check looks for a collection written by a callback on one thread while the body waiting on it touches it on another, and in this repository's languages no collection is reachable from two threads at once. Rust's compiler refuses the unsynchronised version: a collection shared between a callback's thread and the waiting body must be `Sync`, which a `Vec`, `VecDeque` or `HashMap` is only behind a `Mutex`/`RwLock`, so the race this check looks for cannot be written in safe Rust. TypeScript/JavaScript runs every callback on the one thread that owns its objects: a callback runs only when the body waiting on it has yielded, never alongside it, and a worker thread receives a COPY of what it is sent. A SharedArrayBuffer carries raw bytes, never an Array, Map or Set, so no collection is reachable from two threads at once. Not a gap in the analyzer and not a finding about your code.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
AC2 · Forms & labels· <textarea> without a programmatic label · ×4
<textarea> without a programmatic label platform/web/src/components/session/session-settings-sheet.tsx:314— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<textarea> without a programmatic label platform/web/src/pages/EnvironmentsPage.tsx:949— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<textarea> without a programmatic label platform/web/src/pages/ProfilesPage.tsx:532— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<textarea> without a programmatic label platform/web/src/pages/SessionsPage.tsx:1214— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC2 · Forms & labels· <input> without a programmatic label · ×4
<input> without a programmatic label platform/web/src/pages/EnvironmentsPage.tsx:650— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label platform/web/src/pages/EnvironmentsPage.tsx:1281— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label platform/web/src/pages/EnvironmentsPage.tsx:1408— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
<input> without a programmatic label platform/web/src/pages/EnvironmentsPage.tsx:1427— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
AX8 · Test isolation· Production project references a test project · ×1
Production project references a test project: eval → test-support — `eval` (production) references the test project `test-support`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
Unlisted import 'fflate' platform/backend/src/routes/workspace-transfers.test.ts:2— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
FunctionTooLong: gateway.gatewayRoutes platform/backend/src/routes/gateway.ts:383— FunctionTooLong — gatewayRoutes runs 1302 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1202 over it, 13.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: workspace-transfers.WorkspaceTransfers platform/web/src/components/workspace-transfers.tsx:93— FunctionTooLong — WorkspaceTransfers runs 878 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 778 over it, 8.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: harness::core::admit::admit_command crates/harness/src/core/admit.rs:15— FunctionTooLong — harness::core::admit::admit_command runs 698 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 598 over it, 6.98× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: SessionsPage.SessionDetail platform/web/src/pages/SessionsPage.tsx:1303— FunctionTooLong — SessionDetail runs 697 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 597 over it, 6.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: BotCreatePage.Wizard platform/web/src/pages/BotCreatePage.tsx:142— FunctionTooLong — Wizard runs 558 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 458 over it, 5.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: McpServersPage.ServerDialog platform/web/src/pages/McpServersPage.tsx:359— FunctionTooLong — ServerDialog runs 550 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 450 over it, 5.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: SessionsPage.SessionList platform/web/src/pages/SessionsPage.tsx:195— FunctionTooLong — SessionList runs 424 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 324 over it, 4.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: composer.SessionComposer platform/web/src/components/session/composer.tsx:51— FunctionTooLong — SessionComposer runs 332 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 232 over it, 3.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: api_projection::tool_call_display crates/api-projection/src/lib.rs:2973— FunctionTooLong — api_projection::tool_call_display runs 330 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 230 over it, 3.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: universes.universeRoutes platform/backend/src/routes/universes.ts:140— FunctionTooLong — universeRoutes runs 330 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 230 over it, 3.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: session-settings-sheet.LiveSessionSetup platform/web/src/components/session/session-settings-sheet.tsx:94— FunctionTooLong — LiveSessionSetup runs 292 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 192 over it, 2.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: AdminUniversesPage.AdminUniversesPage platform/web/src/pages/AdminUniversesPage.tsx:60— FunctionTooLong — AdminUniversesPage runs 264 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 164 over it, 2.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: harness::core::drive::tool_call_completed_proposals_inner crates/harness/src/core/drive.rs:1796— FunctionTooLong — harness::core::drive::tool_call_completed_proposals_inner runs 263 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 163 over it, 2.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: CredentialsPage.CredentialList platform/web/src/pages/CredentialsPage.tsx:107— FunctionTooLong — CredentialList runs 262 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 162 over it, 2.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: codemode::engine::run_context crates/codemode/src/engine.rs:235— FunctionTooLong — codemode::engine::run_context runs 254 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 154 over it, 2.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: WorkspacesPage.FileDetail platform/web/src/pages/WorkspacesPage.tsx:303— FunctionTooLong — FileDetail runs 238 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 138 over it, 2.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: SessionsPage.NewSessionDialog platform/web/src/pages/SessionsPage.tsx:921— FunctionTooLong — NewSessionDialog runs 232 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 132 over it, 2.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: environment_daemon::filesystem::scan::scan crates/environment-daemon/src/filesystem/scan.rs:17— FunctionTooLong — environment_daemon::filesystem::scan::scan runs 225 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 125 over it, 2.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: AdminUsersPage.EditUserDialog platform/web/src/pages/AdminUsersPage.tsx:139— FunctionTooLong — EditUserDialog runs 211 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 111 over it, 2.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ChannelsPage.Channels platform/web/src/pages/ChannelsPage.tsx:77— FunctionTooLong — Channels runs 209 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 109 over it, 2.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: model-api-key.OpenAiCompatibleForm platform/web/src/components/models/model-api-key.tsx:329— FunctionTooLong — OpenAiCompatibleForm runs 208 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 108 over it, 2.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: stack.createPlan REDACTED:190— FunctionTooLong — createPlan runs 208 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 108 over it, 2.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: temporal_runtime::gateway::registration::control_session crates/temporal-runtime/src/gateway/registration.rs:530— FunctionTooLong — temporal_runtime::gateway::registration::control_session runs 206 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 106 over it, 2.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: bots.botRoutes platform/backend/src/routes/bots.ts:31— FunctionTooLong — botRoutes runs 204 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 104 over it, 2.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: harness::core::components::run::apply_event crates/harness/src/core/components/run.rs:627— FunctionTooLong — harness::core::components::run::apply_event runs 199 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 99 over it, 1.99× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FileTooLong: service/mod.rs crates/temporal-runtime/src/gateway/service/mod.rs— FileTooLong — 3857 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 78% of them inside a single declaration: GatewayAgentApi (8 blocks, 244-5105), declaring 36 free functions. The bar is 500 significant lines; this is 3357 over it, 7.71× 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: src/lib.rs crates/api-projection/src/lib.rs— FileTooLong — 2618 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 93 free functions. The bar is 500 significant lines; this is 2118 over it, 5.24× 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: bot/triggers.tsx platform/web/src/components/bot/triggers.tsx— FileTooLong — 2229 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1729 over it, 4.46× 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: pages/SessionsPage.tsx platform/web/src/pages/SessionsPage.tsx— FileTooLong — 2083 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1583 over it, 4.17× 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: session/session-config-editor.tsx platform/web/src/components/session/session-config-editor.tsx— FileTooLong — 1874 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1374 over it, 3.75× 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: worker/session_tools.rs crates/temporal-runtime/src/worker/session_tools.rs— FileTooLong — 1755 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 80% of them inside a single declaration: SessionTools (5 blocks, 59-2175). The bar is 500 significant lines; this is 1255 over it, 3.51× 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: core/drive.rs crates/harness/src/core/drive.rs— FileTooLong — 1674 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 34 free functions. The bar is 500 significant lines; this is 1174 over it, 3.35× 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: chat/driver.rs crates/cli/src/chat/driver.rs— FileTooLong — 1668 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 62% of them inside a single declaration: ChatSessionDriver (2 blocks, 236-1637), declaring 37 free functions. The bar is 500 significant lines; this is 1168 over it, 3.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: routes/gateway.ts platform/backend/src/routes/gateway.ts— FileTooLong — 1653 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: gatewayRoutes (383-2319). The bar is 500 significant lines; this is 1153 over it, 3.31× 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: src/session.rs crates/store-pg/src/session.rs— FileTooLong — 1645 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 73% of them inside a single declaration: PgStore (6 blocks, 55-2025). The bar is 500 significant lines; this is 1145 over it, 3.29× 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: components/workflow_tool.rs crates/harness/src/core/components/workflow_tool.rs— FileTooLong — 1641 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 36 free functions. The bar is 500 significant lines; this is 1141 over it, 3.28× 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: components/context.rs crates/harness/src/core/components/context.rs— FileTooLong — 1491 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 74 free functions. The bar is 500 significant lines; this is 991 over it, 2.98× 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: src/anthropic_messages.rs crates/llm-runtime/src/anthropic_messages.rs— FileTooLong — 1466 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 50 free functions. The bar is 500 significant lines; this is 966 over it, 2.93× 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: components/tooling.rs crates/harness/src/core/components/tooling.rs— FileTooLong — 1441 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 39 free functions. The bar is 500 significant lines; this is 941 over it, 2.88× 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: src/environment.rs crates/store-pg/src/environment.rs— FileTooLong — 1290 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 69% of them inside a single declaration: PgStore (4 blocks, 72-1130), declaring 35 free functions. The bar is 500 significant lines; this is 790 over it, 2.58× 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: pages/EnvironmentsPage.tsx platform/web/src/pages/EnvironmentsPage.tsx— FileTooLong — 1246 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 746 over it, 2.49× 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: src/openai_responses.rs crates/llm-runtime/src/openai_responses.rs— FileTooLong — 1212 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 40 free functions. The bar is 500 significant lines; this is 712 over it, 2.42× 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: pages/McpServersPage.tsx platform/web/src/pages/McpServersPage.tsx— FileTooLong — 1162 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 662 over it, 2.32× 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: storage/session.rs crates/harness/src/storage/session.rs— FileTooLong — 1158 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 658 over it, 2.32× 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: src/bots.rs crates/store-pg/src/bots.rs— FileTooLong — 1152 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 83% of them inside a single declaration: PgStore (6 blocks, 75-1234). The bar is 500 significant lines; this is 652 over it, 2.30× 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: src/sessions.rs crates/api/src/sessions.rs— FileTooLong — 1137 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 637 over it, 2.27× 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: components/workspace-transfers.tsx platform/web/src/components/workspace-transfers.tsx— FileTooLong — 1136 significant lines (blank, comment-only and punctuation-only lines excluded), about 77% of them inside a single declaration: WorkspaceTransfers (93-1111). The bar is 500 significant lines; this is 636 over it, 2.27× 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: src/incus.rs crates/environment-provider-incus/src/incus.rs— FileTooLong — 1124 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 69% of them inside a single declaration: IncusClient (3 blocks, 122-1160). The bar is 500 significant lines; this is 624 over it, 2.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: channels/conversation.rs crates/temporal-workflow/src/workflows/channels/conversation.rs— FileTooLong — 1100 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 44 free functions. The bar is 500 significant lines; this is 600 over it, 2.20× 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: src/openai_completions.rs crates/llm-runtime/src/openai_completions.rs— FileTooLong — 1076 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 35 free functions. The bar is 500 significant lines; this is 576 over it, 2.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.
Hotspot: platform/backend/src/routes/gateway.ts platform/backend/src/routes/gateway.ts:383— platform/backend/src/routes/gateway.ts changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 237 in gateway.gatewayRoutes at line 383. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- platform/backend/src/routes/gateway.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: platform/web/src/pages/SessionsPage.tsx platform/web/src/pages/SessionsPage.tsx:1303— platform/web/src/pages/SessionsPage.tsx changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 168 in SessionsPage.SessionDetail at line 1303. 3 of those changes were fix/bug commits, and the other 24 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- platform/web/src/pages/SessionsPage.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: platform/web/src/demo/routes/sessions.ts platform/web/src/demo/routes/sessions.ts:65— platform/web/src/demo/routes/sessions.ts changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 135 in sessions.sessionRoutes at line 65. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- platform/web/src/demo/routes/sessions.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/api-projection/src/lib.rs crates/api-projection/src/lib.rs:670— crates/api-projection/src/lib.rs changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 57 in CoreAgentProjector::project_event_kind at line 670. 2 of those changes were fix/bug commits, and the other 30 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- crates/api-projection/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/harness/src/core/drive.rs crates/harness/src/core/drive.rs:1796— crates/harness/src/core/drive.rs changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in harness::core::drive::tool_call_completed_proposals_inner at line 1796. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- crates/harness/src/core/drive.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: platform/web/src/lib/sessions/transcript.ts platform/web/src/lib/sessions/transcript.ts:257— platform/web/src/lib/sessions/transcript.ts changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in transcript.applyEvents at line 257. 2 of those changes were fix/bug commits, and the other 18 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- platform/web/src/lib/sessions/transcript.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/harness/src/core/admit.rs crates/harness/src/core/admit.rs:15— crates/harness/src/core/admit.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 96 in harness::core::admit::admit_command at line 15. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- crates/harness/src/core/admit.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: platform/web/src/components/session/session-config-editor.tsx platform/web/src/components/session/session-config-editor.tsx:412— platform/web/src/components/session/session-config-editor.tsx changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 67 in session-config-editor.configError at line 412. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- platform/web/src/components/session/session-config-editor.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: platform/web/src/components/session/composer.tsx platform/web/src/components/session/composer.tsx:51— platform/web/src/components/session/composer.tsx changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 110 in composer.SessionComposer at line 51. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- platform/web/src/components/session/composer.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: platform/web/src/pages/McpServersPage.tsx platform/web/src/pages/McpServersPage.tsx:359— platform/web/src/pages/McpServersPage.tsx changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 94 in McpServersPage.ServerDialog at line 359. 1 of those changes was a fix/bug commit, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- platform/web/src/pages/McpServersPage.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/temporal-runtime/src/gateway/service/mod.rs crates/temporal-runtime/src/gateway/service/mod.rs:3296— crates/temporal-runtime/src/gateway/service/mod.rs changed 44 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in GatewayAgentApi::decide_run_approvals at line 3296. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- crates/temporal-runtime/src/gateway/service/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/temporal-runtime/src/worker/session_tools.rs crates/temporal-runtime/src/worker/session_tools.rs:1698— crates/temporal-runtime/src/worker/session_tools.rs changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in SessionTools::invoke_batch at line 1698. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- crates/temporal-runtime/src/worker/session_tools.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: platform/web/src/demo/routes/bots.ts platform/web/src/demo/routes/bots.ts:1047— platform/web/src/demo/routes/bots.ts changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 73 in bots.botRoutes at line 1047. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- platform/web/src/demo/routes/bots.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/cli/src/chat/driver.rs crates/cli/src/chat/driver.rs:1049— crates/cli/src/chat/driver.rs changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in ChatSessionDriver::chat_events_from_session_event at line 1049. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- crates/cli/src/chat/driver.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: platform/web/src/demo/routes/secrets.ts platform/web/src/demo/routes/secrets.ts:443— platform/web/src/demo/routes/secrets.ts changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 96 in secrets.secretRoutes at line 443. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- platform/web/src/demo/routes/secrets.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/tools/src/builtin/mod.rs crates/tools/src/builtin/mod.rs:379— crates/tools/src/builtin/mod.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in BuiltinTool::name_str at line 379. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- crates/tools/src/builtin/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: platform/web/src/components/session/session-settings-sheet.tsx platform/web/src/components/session/session-settings-sheet.tsx:94— platform/web/src/components/session/session-settings-sheet.tsx changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 67 in session-settings-sheet.LiveSessionSetup at line 94. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- platform/web/src/components/session/session-settings-sheet.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: platform/backend/src/routes/universes.ts platform/backend/src/routes/universes.ts:140— platform/backend/src/routes/universes.ts changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 73 in universes.universeRoutes at line 140. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- platform/backend/src/routes/universes.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: platform/web/src/pages/BotCreatePage.tsx platform/web/src/pages/BotCreatePage.tsx:142— platform/web/src/pages/BotCreatePage.tsx changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 91 in BotCreatePage.Wizard at line 142. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- platform/web/src/pages/BotCreatePage.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: platform/web/src/pages/ProfilesPage.tsx platform/web/src/pages/ProfilesPage.tsx:192— platform/web/src/pages/ProfilesPage.tsx changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in ProfilesPage.ProfileEditor at line 192. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- platform/web/src/pages/ProfilesPage.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: platform/web/src/demo/routes/platform.ts platform/web/src/demo/routes/platform.ts:11— platform/web/src/demo/routes/platform.ts changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 73 in platform.platformRoutes at line 11. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- platform/web/src/demo/routes/platform.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/temporal-runtime/src/worker/activities/storage.rs crates/temporal-runtime/src/worker/activities/storage.rs:260— crates/temporal-runtime/src/worker/activities/storage.rs changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in temporal_runtime::worker::activities::storage::prepare_payload_context at line 260. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- crates/temporal-runtime/src/worker/activities/storage.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/harness/src/core/components/tooling.rs crates/harness/src/core/components/tooling.rs:1690— crates/harness/src/core/components/tooling.rs changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in harness::core::components::tooling::defer_tool_batch at line 1690. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- crates/harness/src/core/components/tooling.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: platform/web/src/pages/WorkspacesPage.tsx platform/web/src/pages/WorkspacesPage.tsx:303— platform/web/src/pages/WorkspacesPage.tsx changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in WorkspacesPage.FileDetail at line 303. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- platform/web/src/pages/WorkspacesPage.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: platform/web/src/components/session/transcript-view.tsx platform/web/src/components/session/transcript-view.tsx:169— platform/web/src/components/session/transcript-view.tsx changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in transcript-view.UserBand at line 169. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-20..2026-10-18, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-20 14:37:52 +00:00' --until='2026-10-18 14:37:52 +00:00' --full-history --no-merges -- platform/web/src/components/session/transcript-view.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Duplicated block (10 lines × 2) crates/cli/src/auth_cli.rs:746— crates/cli/src/auth_cli.rs:746-755 | crates/cli/src/mcp_cli.rs:644-653 — 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) crates/cli/src/auth_cli.rs:948— crates/cli/src/auth_cli.rs:948-957 | crates/cli/src/mcp_cli.rs:569-578 — 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) crates/cli/src/auth_cli.rs:992— crates/cli/src/auth_cli.rs:992-1001 | crates/cli/src/auth_cli.rs:1030-1039 — 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) crates/environment-daemon/src/jobs.rs:834— crates/environment-daemon/src/jobs.rs:834-843 | crates/environment-daemon/src/process.rs:740-749 — before extracting anything, compare `crates/environment-daemon/src/jobs.rs` and `crates/environment-daemon/src/process.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) crates/harness/src/core/components/approval.rs:150— crates/harness/src/core/components/approval.rs:150-159 | crates/harness/src/core/components/run.rs:609-618 — 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) crates/harness/src/storage/blobs.rs:556— crates/harness/src/storage/blobs.rs:556-566 | crates/harness/src/storage/blobs.rs:622-631 — 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) crates/llm-clients/src/openai/responses.rs:266— crates/llm-clients/src/openai/responses.rs:266-275 | crates/llm-clients/src/openai/responses.rs:290-299 — 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) crates/llm-runtime/src/anthropic_messages.rs:1743— crates/llm-runtime/src/anthropic_messages.rs:1743-1752 | crates/llm-runtime/src/openai_completions.rs:1260-1269 — before extracting anything, compare `crates/llm-runtime/src/anthropic_messages.rs` and `crates/llm-runtime/src/openai_completions.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) crates/llm-runtime/src/openai_completions.rs:451— crates/llm-runtime/src/openai_completions.rs:451-460 | crates/llm-runtime/src/openai_completions.rs:493-502 — 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) crates/llm-runtime/src/openai_completions.rs:475— crates/llm-runtime/src/openai_completions.rs:475-484 | crates/llm-runtime/src/openai_completions.rs:513-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.
Duplicated block (10 lines × 2) crates/temporal-runtime/src/gateway/http.rs:810— crates/temporal-runtime/src/gateway/http.rs:810-819 | crates/temporal-runtime/src/gateway/http.rs:865-874 — 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) crates/temporal-runtime/src/gateway/service/session_jobs.rs:79— crates/temporal-runtime/src/gateway/service/session_jobs.rs:79-88 | crates/temporal-runtime/src/gateway/service/session_jobs.rs:413-422 — 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) crates/temporal-runtime/src/worker/activities/state.rs:564— crates/temporal-runtime/src/worker/activities/state.rs:564-573 | crates/temporal-runtime/src/worker/activities/state.rs:592-601 — 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) crates/temporal-runtime/src/worker/session_tools.rs:193— crates/temporal-runtime/src/worker/session_tools.rs:193-202 | crates/temporal-runtime/src/worker/session_tools.rs:218-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.
Duplicated block (10 lines × 2) crates/temporal-workflow/src/workflows/bots/controller.rs:304— crates/temporal-workflow/src/workflows/bots/controller.rs:304-313 | crates/temporal-workflow/src/workflows/channels/conversation.rs:289-298 — 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) crates/temporal-workflow/src/workflows/session/drive.rs:625— crates/temporal-workflow/src/workflows/session/drive.rs:625-634 | crates/temporal-workflow/src/workflows/session/drive.rs:724-733 — 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) crates/tools/src/runtime/inline.rs:329— crates/tools/src/runtime/inline.rs:329-338 | crates/tools/src/runtime/inline.rs:393-402 — 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) crates/cli/src/chat/tui/cell.rs:496— crates/cli/src/chat/tui/cell.rs:496-505 | crates/cli/src/chat/tui/markdown.rs:386-395 — 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) crates/eval/src/main.rs:959— crates/eval/src/main.rs:959-968 | crates/temporal-workflow/src/workflows/session/bootstrap.rs:154-163 — 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) crates/tools/src/fs/vfs.rs:956— crates/tools/src/fs/vfs.rs:956-965 | crates/vfs/src/snapshot.rs:787-796 — 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) crates/tools/src/prompts/vfs.rs:55— crates/tools/src/prompts/vfs.rs:55-64 | crates/tools/src/skills/vfs.rs:73-82 — `crates/tools/src/prompts/vfs.rs` and `crates/tools/src/skills/vfs.rs` 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 5 separate duplicated blocks between them, totalling at least 48 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 (10 lines × 2) crates/temporal-runtime/src/universe.rs:275— crates/temporal-runtime/src/universe.rs:275-285 | crates/temporal-runtime/src/universe.rs:316-325 — 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) crates/llm-clients/src/anthropic/messages.rs:1204— crates/llm-clients/src/anthropic/messages.rs:1204-1213 | crates/llm-clients/src/openai/responses.rs:1185-1194 — before extracting anything, compare `crates/llm-clients/src/anthropic/messages.rs` and `crates/llm-clients/src/openai/responses.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 62 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 (10 lines × 2) crates/store-pg/src/session.rs:903— crates/store-pg/src/session.rs:903-912 | crates/store-pg/src/session.rs:1028-1037 — 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) crates/store-pg/src/bots.rs:765— crates/store-pg/src/bots.rs:765-774 | crates/store-pg/src/bots.rs:797-806 — 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.
MethodTooLong: CoreAgentProjector.project_event_kind crates/api-projection/src/lib.rs:670— MethodTooLong — project_event_kind runs 423 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 323 over it, 4.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Operation.execute crates/environment-daemon/src/filesystem/transfer/session.rs:731— MethodTooLong — execute runs 294 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 194 over it, 2.94× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SessionTools.invoke_workflow_tool_call crates/temporal-runtime/src/worker/session_tools.rs:569— MethodTooLong — invoke_workflow_tool_call runs 217 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 117 over it, 2.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TransferManager.execute crates/environment-daemon/src/filesystem/transfer/session.rs:411— MethodTooLong — execute runs 199 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 99 over it, 1.99× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SubagentService.prepare crates/temporal-runtime/src/subagents.rs:206— MethodTooLong — prepare runs 163 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 63 over it, 1.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SessionTools.invoke_environment_control_call crates/temporal-runtime/src/worker/session_tools.rs:974— MethodTooLong — invoke_environment_control_call runs 158 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 58 over it, 1.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EnvironmentJobWorkflow.run crates/temporal-workflow/src/workflows/environment_job.rs:32— MethodTooLong — run runs 147 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 47 over it, 1.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PgStore.delete_closed_sessions_with_options crates/store-pg/src/session.rs:1855— MethodTooLong — delete_closed_sessions_with_options runs 142 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: GatewayAgentApi.decide_run_approvals crates/temporal-runtime/src/gateway/service/mod.rs:3296— MethodTooLong — decide_run_approvals runs 139 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: GatewayAgentApi.start_session_internal crates/temporal-runtime/src/gateway/service/session_lifecycle.rs:239— MethodTooLong — start_session_internal runs 138 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 38 over it, 1.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OAuthFlowService.complete_callback crates/auth/src/flow.rs:237— MethodTooLong — complete_callback runs 132 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 32 over it, 1.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ChatSessionDriver.chat_events_from_session_event crates/cli/src/chat/driver.rs:1049— MethodTooLong — chat_events_from_session_event runs 132 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 32 over it, 1.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SessionTools.invoke_batch crates/temporal-runtime/src/worker/session_tools.rs:1698— MethodTooLong — invoke_batch runs 130 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: JobManager.spawn_and_wait crates/environment-daemon/src/jobs.rs:657— MethodTooLong — spawn_and_wait runs 124 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CodeRunner.run_attempt crates/temporal-runtime/src/code.rs:184— MethodTooLong — run_attempt runs 123 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TranscriptState.apply_chat_event crates/cli/src/chat/tui/transcript.rs:62— MethodTooLong — apply_chat_event runs 120 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 20 over it, 1.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: GatewayAgentApi.append_context crates/temporal-runtime/src/gateway/service/mod.rs:2759— MethodTooLong — append_context runs 116 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: StoredTokenSource.refresh_grant crates/auth/src/broker.rs:242— MethodTooLong — refresh_grant runs 112 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 12 over it, 1.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PgStore.insert_bot_event crates/store-pg/src/bots.rs:907— MethodTooLong — insert_bot_event runs 112 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 12 over it, 1.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PgStore.append_inner crates/store-pg/src/session.rs:56— MethodTooLong — append_inner runs 110 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PgStore.list_sessions_for crates/store-pg/src/session.rs:406— MethodTooLong — list_sessions_for runs 110 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AgentSessionWorkflow.run crates/temporal-workflow/src/workflows/session/mod.rs:137— MethodTooLong — run runs 110 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CoreAgentProjector.project_tool_batches_for_run crates/api-projection/src/lib.rs:1211— MethodTooLong — project_tool_batches_for_run runs 108 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SessionTools.invoke_call_execution crates/temporal-runtime/src/worker/session_tools.rs:1974— MethodTooLong — invoke_call_execution runs 108 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Scanner.advance crates/environment-daemon/src/filesystem/transfer/session.rs:102— MethodTooLong — advance runs 106 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Duplicated block (8 lines × 2) crates/auth/src/mcp_oauth.rs:668— crates/auth/src/mcp_oauth.rs:668-675 | crates/auth/src/mcp_oauth.rs:696-703 — 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) crates/environment-daemon/src/filesystem/scan.rs:20— crates/environment-daemon/src/filesystem/scan.rs:20-27 | crates/environment-daemon/src/filesystem/transfer/session.rs:535-542 — 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) crates/environments/src/memory.rs:231— crates/environments/src/memory.rs:231-238 | crates/environments/src/memory.rs:370-377 — 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) crates/harness/src/core/components/approval.rs:245— crates/harness/src/core/components/approval.rs:245-252 | crates/harness/src/core/components/approval.rs:269-276 — 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) crates/llm-clients/src/anthropic/messages.rs:309— crates/llm-clients/src/anthropic/messages.rs:309-316 | crates/llm-clients/src/anthropic/messages.rs:351-358 — 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) crates/llm-clients/src/openai/responses.rs:433— crates/llm-clients/src/openai/responses.rs:433-440 | crates/llm-clients/src/openai/responses.rs:456-463 — 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) crates/temporal-runtime/src/bots/admission.rs:216— crates/temporal-runtime/src/bots/admission.rs:216-223 | crates/temporal-runtime/src/bots/admission.rs:270-277 — 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) crates/temporal-runtime/src/worker/mcp.rs:894— crates/temporal-runtime/src/worker/mcp.rs:894-901 | crates/temporal-runtime/src/worker/mcp.rs:918-925 — 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) crates/temporal-runtime/src/worker/session_tools.rs:941— crates/temporal-runtime/src/worker/session_tools.rs:941-948 | crates/tools/src/environment/jobs.rs:441-448 — 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) crates/temporal-workflow/src/workflows/bots/controller.rs:316— crates/temporal-workflow/src/workflows/bots/controller.rs:316-323 | crates/temporal-workflow/src/workflows/channels/conversation.rs:301-308 — 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) crates/tools/src/fs/memory.rs:68— crates/tools/src/fs/memory.rs:68-75 | crates/tools/src/fs/vfs.rs:861-868 — 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 (8 lines × 2) crates/tools/src/prompts/vfs.rs:298— crates/tools/src/prompts/vfs.rs:298-305 | crates/tools/src/skills/vfs.rs:300-307 — `crates/tools/src/prompts/vfs.rs` and `crates/tools/src/skills/vfs.rs` 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 5 separate duplicated blocks between them, totalling at least 48 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 (8 lines × 2) crates/tools/src/runtime/inline.rs:359— crates/tools/src/runtime/inline.rs:359-366 | crates/tools/src/runtime/inline.rs:422-429 — 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) crates/tools/src/prompts/assembler.rs:661— crates/tools/src/prompts/assembler.rs:661-668 | crates/tools/src/skills/catalog.rs:476-483 — before extracting anything, compare `crates/tools/src/prompts/assembler.rs` and `crates/tools/src/skills/catalog.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 33 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 (8 lines × 2) crates/tools/src/prompts/vfs.rs:224— crates/tools/src/prompts/vfs.rs:224-231 | crates/tools/src/skills/vfs.rs:226-233 — `crates/tools/src/prompts/vfs.rs` and `crates/tools/src/skills/vfs.rs` 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 5 separate duplicated blocks between them, totalling at least 48 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 (8 lines × 2) crates/api-projection/src/lib.rs:2341— crates/api-projection/src/lib.rs:2341-2348 | crates/temporal-runtime/src/gateway/service/api_config.rs:330-337 — 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) crates/auth/src/lib.rs:235— crates/auth/src/lib.rs:235-242 | crates/mcp/src/lib.rs:793-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.
Duplicated block (8 lines × 2) crates/auth/src/lib.rs:257— crates/auth/src/lib.rs:257-264 | crates/mcp/src/lib.rs:802-809 — 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) crates/harness/src/blob.rs:44— crates/harness/src/blob.rs:44-51 | crates/harness/src/emission.rs:30-37 — 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 (8 lines × 2) crates/tools/src/transfer.rs:480— crates/tools/src/transfer.rs:480-489 | crates/tools/src/transfer.rs:545-552 — 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) crates/temporal-runtime/src/gateway/service/workflow.rs:262— crates/temporal-runtime/src/gateway/service/workflow.rs:262-271 | crates/temporal-runtime/src/gateway/service/workflow.rs:474-481 — 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) crates/mcp/src/lib.rs:639— crates/mcp/src/lib.rs:639-646 | crates/mcp/src/lib.rs:712-721 — 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) crates/temporal-runtime/src/gateway/service/workflow.rs:424— crates/temporal-runtime/src/gateway/service/workflow.rs:424-431 | crates/temporal-runtime/src/gateway/service/workflow.rs:552-560 — 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) crates/harness/src/core/components/tooling.rs:1618— crates/harness/src/core/components/tooling.rs:1618-1625 | crates/harness/src/core/components/tooling.rs:1715-1722 — 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) crates/store-pg/src/environment.rs:246— crates/store-pg/src/environment.rs:246-253 | crates/store-pg/src/environment.rs:286-293 — 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.
+ 5 more in this group — see findings.md.
AC2 · Forms & labels· <Select> field component without a label · ×28
<Select> field component without a label platform/web/src/components/bot/activity.tsx:144— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/components/bot/cron-builder.tsx:188— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/components/bot/cron-builder.tsx:237— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/components/bot/triggers.tsx:224— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/components/bot/triggers.tsx:1129— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/components/bot/triggers.tsx:1502— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/components/bot/triggers.tsx:1519— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/components/bot/triggers.tsx:1564— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/components/bot/triggers.tsx:1912— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/components/bot/triggers.tsx:2017— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/components/bot/triggers.tsx:2061— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/components/bot/triggers.tsx:2149— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/components/bot/triggers.tsx:2301— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/components/session/session-config-editor.tsx:1196— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/components/session/session-config-editor.tsx:1208— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/components/session/session-config-editor.tsx:1230— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/components/session/session-config-editor.tsx:1284— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/components/session/session-config-editor.tsx:1453— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/components/session/session-config-editor.tsx:1502— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/components/session/session-config-editor.tsx:2186— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/components/session/session-settings-sheet.tsx:502— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/pages/AdminEnvironmentProvidersPage.tsx:455— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/pages/AdminEnvironmentProvidersPage.tsx:577— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/pages/BotCreatePage.tsx:657— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label platform/web/src/pages/EnvironmentsPage.tsx:669— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing it renders carries one either (a name prop is the form-submission key, not a label). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
harness::core::admit::admit_command (cognitive 129) crates/harness/src/core/admit.rs:15— harness::core::admit::admit_command has cognitive complexity 129 (threshold 15). Drivers by points: if/else 49 (99 pts), match/switch 7 (15 pts), loops 3 (8 pts), boolean chains 7 (nesting depth added 63). 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.
harness::core::drive::tool_call_completed_proposals_inner (cognitive 112) crates/harness/src/core/drive.rs:1796— harness::core::drive::tool_call_completed_proposals_inner has cognitive complexity 112 (threshold 15). Drivers by points: if/else 26 (85 pts), match/switch 4 (13 pts), loops 3 (8 pts), boolean chains 6 (nesting depth added 73). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
harness::core::components::turn::apply_event (cognitive 47) crates/harness/src/core/components/turn.rs:293— harness::core::components::turn::apply_event has cognitive complexity 47 (threshold 15). Drivers by points: if/else 22 (42 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 21). 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.
harness::core::components::workflow_tool::validate_invocation_against_state (cognitive 42) crates/harness/src/core/components/workflow_tool.rs:1797— harness::core::components::workflow_tool::validate_invocation_against_state has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 5, match/switch 2 (4 pts), loops 1 (2 pts) (nesting depth added 19). 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.
harness::core::components::run::apply_event (cognitive 34) crates/harness/src/core/components/run.rs:627— harness::core::components::run::apply_event has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 1, match/switch 1 (nesting depth added 16). 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.
harness::core::components::tooling::defer_tool_batch (cognitive 34) crates/harness/src/core/components/tooling.rs:1690— harness::core::components::tooling::defer_tool_batch has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 7, match/switch 2 (4 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
harness::core::components::workflow_tool::apply_config_event (cognitive 33) crates/harness/src/core/components/workflow_tool.rs:1082— harness::core::components::workflow_tool::apply_config_event has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
harness::core::components::context::apply_event (cognitive 31) crates/harness/src/core/components/context.rs:1370— harness::core::components::context::apply_event has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 3 (6 pts), boolean chains 5, match/switch 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.
harness::core::components::tooling::plan_next (cognitive 30) crates/harness/src/core/components/tooling.rs:72— harness::core::components::tooling::plan_next has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 2, 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.
harness::core::drive::tool_batch_deferred_proposals (cognitive 30) crates/harness/src/core/drive.rs:1091— harness::core::drive::tool_batch_deferred_proposals has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (18 pts), loops 4 (7 pts), boolean chains 5 (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.
harness::core::components::code_tool::apply_code_tool_event (cognitive 27) crates/harness/src/core/components/code_tool.rs:987— harness::core::components::code_tool::apply_code_tool_event has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (22 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 14). 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.
harness::core::components::approval::apply_approval_event (cognitive 26) crates/harness/src/core/components/approval.rs:161— harness::core::components::approval::apply_approval_event has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 7, match/switch 2 (3 pts) (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.
harness::core::codec::core_agent_event_envelope_kind (cognitive 25) crates/harness/src/core/codec.rs:105— harness::core::codec::core_agent_event_envelope_kind has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 13 (25 pts) (nesting depth added 12). 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.
harness::core::components::code_tool::resume_code_tool_call_proposals (cognitive 24) crates/harness/src/core/components/code_tool.rs:796— harness::core::components::code_tool::resume_code_tool_call_proposals has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, loops 1 (3 pts), match/switch 1 (2 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.
harness::core::components::tooling::apply_event (cognitive 23) crates/harness/src/core/components/tooling.rs:1111— harness::core::components::tooling::apply_event has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (20 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.
harness::core::components::context::standalone_prefix_ids (cognitive 22) crates/harness/src/core/components/context.rs:498— harness::core::components::context::standalone_prefix_ids has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (5 pts), boolean chains 2 (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.
harness::core::components::config::validate_mcp_feature (cognitive 21) crates/harness/src/core/components/config.rs:1158— harness::core::components::config::validate_mcp_feature has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
harness::core::components::workflow_tool::apply_event (cognitive 20) crates/harness/src/core/components/workflow_tool.rs:1217— harness::core::components::workflow_tool::apply_event has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 3 (5 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.
harness::core::drive::attach_promise_control_runtime (cognitive 20) crates/harness/src/core/drive.rs:1011— harness::core::drive::attach_promise_control_runtime has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
harness::core::components::code_tool::close_code_tool_scope_proposals (cognitive 19) crates/harness/src/core/components/code_tool.rs:876— harness::core::components::code_tool::close_code_tool_scope_proposals has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (6 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
harness::core::components::config::validate_features (cognitive 19) crates/harness/src/core/components/config.rs:854— harness::core::components::config::validate_features has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, loops 1 (2 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.
harness::core::components::config::validate_web_feature (cognitive 18) crates/harness/src/core/components/config.rs:1107— harness::core::components::config::validate_web_feature has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 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.
harness::core::components::context::apply_entries_applied (cognitive 18) crates/harness/src/core/components/context.rs:1564— harness::core::components::context::apply_entries_applied has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
harness::core::components::tooling::validate_remote_mcp_server_url (cognitive 18) crates/harness/src/core/components/tooling.rs:573— harness::core::components::tooling::validate_remote_mcp_server_url has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 2 (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.
harness::core::drive::resume_tool_batch_proposals (cognitive 18) crates/harness/src/core/drive.rs:1313— harness::core::drive::resume_tool_batch_proposals has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Duplicated block (11 lines × 2) crates/cli/src/auth_cli.rs:850— crates/cli/src/auth_cli.rs:850-860 | crates/cli/src/auth_cli.rs:890-900 — 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) crates/cli/src/connection.rs:578— crates/cli/src/connection.rs:578-588 | crates/cli/src/connection.rs:690-700 — 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) crates/cli/src/mcp_cli.rs:628— crates/cli/src/mcp_cli.rs:628-638 | crates/cli/src/mcp_cli.rs:671-681 — 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) crates/environment-daemon/src/filesystem.rs:100— crates/environment-daemon/src/filesystem.rs:100-110 | crates/environment-daemon/src/filesystem.rs:142-152 — 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) crates/environment-provider-incus/src/server.rs:370— crates/environment-provider-incus/src/server.rs:370-380 | crates/environment-provider-incus/src/server.rs:406-416 — 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) crates/harness/src/core/components/run.rs:896— crates/harness/src/core/components/run.rs:896-906 | crates/temporal-runtime/src/gateway/service/mod.rs:332-342 — 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) crates/harness/src/storage/session.rs:811— crates/harness/src/storage/session.rs:811-821 | crates/harness/src/storage/session.rs:828-838 — 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) crates/harness/src/storage/session.rs:1377— crates/harness/src/storage/session.rs:1377-1387 | crates/store-pg/src/session.rs:1589-1599 — 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) crates/llm-clients/src/anthropic/messages.rs:328— crates/llm-clients/src/anthropic/messages.rs:328-338 | crates/llm-clients/src/openai/completions.rs:264-274 — before extracting anything, compare `crates/llm-clients/src/anthropic/messages.rs` and `crates/llm-clients/src/openai/completions.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 51 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 (11 lines × 2) crates/llm-runtime/src/anthropic_messages.rs:707— crates/llm-runtime/src/anthropic_messages.rs:707-717 | crates/llm-runtime/src/openai_responses.rs:514-524 — before extracting anything, compare `crates/llm-runtime/src/anthropic_messages.rs` and `crates/llm-runtime/src/openai_responses.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 113 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 (11 lines × 2) crates/store-fs/src/session.rs:411— crates/store-fs/src/session.rs:411-421 | crates/store-pg/src/session.rs:86-96 — before extracting anything, compare `crates/store-fs/src/session.rs` and `crates/store-pg/src/session.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 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 (11 lines × 2) crates/store-fs/src/session.rs:482— crates/store-fs/src/session.rs:482-492 | crates/store-pg/src/session.rs:1109-1119 — before extracting anything, compare `crates/store-fs/src/session.rs` and `crates/store-pg/src/session.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 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 (11 lines × 2) crates/temporal-runtime/src/worker/session_tools.rs:1050— crates/temporal-runtime/src/worker/session_tools.rs:1050-1060 | crates/temporal-runtime/src/worker/session_tools.rs:1097-1108 — 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) crates/temporal-workflow/src/workflows/session/activity_calls.rs:39— crates/temporal-workflow/src/workflows/session/activity_calls.rs:39-49 | crates/temporal-workflow/src/workflows/session/activity_calls.rs:101-111 — 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) crates/tools/src/concurrency.rs:222— crates/tools/src/concurrency.rs:222-232 | crates/tools/src/concurrency.rs:266-276 — 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) crates/tools/src/fs/local.rs:140— crates/tools/src/fs/local.rs:140-150 | crates/tools/src/fs/scoped_local.rs:277-287 — before extracting anything, compare `crates/tools/src/fs/local.rs` and `crates/tools/src/fs/scoped_local.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 128 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 (11 lines × 2) crates/tools/src/prompts/vfs.rs:125— crates/tools/src/prompts/vfs.rs:125-135 | crates/tools/src/skills/vfs.rs:143-153 — `crates/tools/src/prompts/vfs.rs` and `crates/tools/src/skills/vfs.rs` 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 5 separate duplicated blocks between them, totalling at least 48 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 (11 lines × 2) crates/tools/src/prompts/vfs.rs:233— crates/tools/src/prompts/vfs.rs:233-243 | crates/tools/src/skills/vfs.rs:235-245 — `crates/tools/src/prompts/vfs.rs` and `crates/tools/src/skills/vfs.rs` 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 5 separate duplicated blocks between them, totalling at least 48 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 (11 lines × 2) crates/temporal-runtime/src/gateway/service/mod.rs:3251— crates/temporal-runtime/src/gateway/service/mod.rs:3251-3261 | crates/temporal-runtime/src/gateway/service/mod.rs:3515-3527 — 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) crates/store-pg/src/mcp.rs:98— crates/store-pg/src/mcp.rs:98-108 | crates/store-pg/src/mcp.rs:221-231 — 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) crates/store-pg/src/profile.rs:88— crates/store-pg/src/profile.rs:88-98 | crates/store-pg/src/profile.rs:203-213 — 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) crates/environment-daemon/src/jobs.rs:663— crates/environment-daemon/src/jobs.rs:663-673 | crates/environment-daemon/src/process.rs:317-327 — before extracting anything, compare `crates/environment-daemon/src/jobs.rs` and `crates/environment-daemon/src/process.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 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 (11 lines × 2) crates/cli/src/chat/tui/app.rs:585— crates/cli/src/chat/tui/app.rs:585-595 | crates/cli/src/chat/tui/app.rs:599-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.
Duplicated block (11 lines × 2) crates/store-pg/src/vfs.rs:159— crates/store-pg/src/vfs.rs:159-169 | crates/store-pg/src/vfs.rs:285-295 — 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) crates/store-pg/src/session.rs:724— crates/store-pg/src/session.rs:724-734 | crates/store-pg/src/session.rs:753-763 — 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.
harness::core::admit::admit_command (cyclomatic 96) crates/harness/src/core/admit.rs:15— harness::core::admit::admit_command has cyclomatic complexity 96 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
harness::core::codec::core_agent_event_envelope_kind (cyclomatic 57) crates/harness/src/core/codec.rs:105— harness::core::codec::core_agent_event_envelope_kind has cyclomatic complexity 57 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
harness::core::drive::tool_call_completed_proposals_inner (cyclomatic 40) crates/harness/src/core/drive.rs:1796— harness::core::drive::tool_call_completed_proposals_inner has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
harness::core::components::turn::apply_event (cyclomatic 32) crates/harness/src/core/components/turn.rs:293— harness::core::components::turn::apply_event has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
harness::core::components::context::apply_event (cyclomatic 27) crates/harness/src/core/components/context.rs:1370— harness::core::components::context::apply_event has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
harness::core::components::run::apply_event (cyclomatic 26) crates/harness/src/core/components/run.rs:627— harness::core::components::run::apply_event has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
harness::core::components::tooling::defer_tool_batch (cyclomatic 23) crates/harness/src/core/components/tooling.rs:1690— harness::core::components::tooling::defer_tool_batch has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
harness::core::components::workflow_tool::validate_invocation_against_state (cyclomatic 23) crates/harness/src/core/components/workflow_tool.rs:1797— harness::core::components::workflow_tool::validate_invocation_against_state has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
harness::core::drive::tool_batch_deferred_proposals (cyclomatic 22) crates/harness/src/core/drive.rs:1091— harness::core::drive::tool_batch_deferred_proposals has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
harness::core::components::approval::apply_approval_event (cyclomatic 20) crates/harness/src/core/components/approval.rs:161— harness::core::components::approval::apply_approval_event has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
harness::core::components::tooling::plan_next (cyclomatic 20) crates/harness/src/core/components/tooling.rs:72— harness::core::components::tooling::plan_next has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
harness::core::components::tooling::apply_event (cyclomatic 20) crates/harness/src/core/components/tooling.rs:1111— harness::core::components::tooling::apply_event has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
harness::core::components::workflow_tool::apply_config_event (cyclomatic 19) crates/harness/src/core/components/workflow_tool.rs:1082— harness::core::components::workflow_tool::apply_config_event has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
harness::core::components::code_tool::apply_code_tool_event (cyclomatic 17) crates/harness/src/core/components/code_tool.rs:987— harness::core::components::code_tool::apply_code_tool_event has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
harness::core::components::context::high_watermark_compaction_proposal (cyclomatic 17) crates/harness/src/core/components/context.rs:987— harness::core::components::context::high_watermark_compaction_proposal has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
harness::core::components::workflow_tool::apply_event (cyclomatic 17) crates/harness/src/core/components/workflow_tool.rs:1217— harness::core::components::workflow_tool::apply_event has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
harness::core::drive::resume_tool_batch_proposals (cyclomatic 17) crates/harness/src/core/drive.rs:1313— harness::core::drive::resume_tool_batch_proposals has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
harness::core::components::code_tool::resume_code_tool_call_proposals (cyclomatic 16) crates/harness/src/core/components/code_tool.rs:796— harness::core::components::code_tool::resume_code_tool_call_proposals has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
harness::core::components::config::validate_features (cyclomatic 16) crates/harness/src/core/components/config.rs:854— harness::core::components::config::validate_features 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.
temporal_runtime::worker::activities::storage::prepare_payload_context (cognitive 41) crates/temporal-runtime/src/worker/activities/storage.rs:260— temporal_runtime::worker::activities::storage::prepare_payload_context has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 5 (15 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
temporal_runtime::gateway::registration::control_session (cognitive 39) crates/temporal-runtime/src/gateway/registration.rs:530— temporal_runtime::gateway::registration::control_session has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (21 pts), match/switch 10 (17 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
temporal_runtime::worker::mcp::visible_mcp_result (cognitive 34) crates/temporal-runtime/src/worker/mcp.rs:995— temporal_runtime::worker::mcp::visible_mcp_result has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (24 pts), match/switch 3 (9 pts), loops 1 (nesting depth added 20). 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.
temporal_runtime::gateway::http::proxy_provider_route (cognitive 29) crates/temporal-runtime/src/gateway/http.rs:782— temporal_runtime::gateway::http::proxy_provider_route has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 3 (8 pts), boolean chains 2, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (temporal_runtime::gateway::http::proxy_external_route) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
temporal_runtime::gateway::http::proxy_external_route (cognitive 29) crates/temporal-runtime/src/gateway/http.rs:841— temporal_runtime::gateway::http::proxy_external_route has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 3 (8 pts), boolean chains 2, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (temporal_runtime::gateway::http::proxy_provider_route) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
temporal_runtime::run_api_key_command (cognitive 26) crates/temporal-runtime/src/main.rs:341— temporal_runtime::run_api_key_command has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 3 (5 pts), loops 2 (4 pts), boolean chains 2 (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.
temporal_runtime::worker::activities::context_refresh::refresh_context (cognitive 25) crates/temporal-runtime/src/worker/activities/context_refresh.rs:29— temporal_runtime::worker::activities::context_refresh::refresh_context has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (22 pts), match/switch 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
temporal_runtime::gateway::http::environment_route_upgrade (cognitive 24) crates/temporal-runtime/src/gateway/http.rs:501— temporal_runtime::gateway::http::environment_route_upgrade has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 9 (13 pts), if/else 7 (11 pts) (nesting depth added 8). 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.
temporal_runtime::worker::activities::storage::materialize_await_result (cognitive 24) crates/temporal-runtime/src/worker/activities/storage.rs:141— temporal_runtime::worker::activities::storage::materialize_await_result has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 4 (11 pts), if/else 7 (10 pts), loops 2, boolean chains 1 (nesting depth added 10). 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.
temporal_runtime::worker::mcp::compact_search_hit (cognitive 21) crates/temporal-runtime/src/worker/mcp.rs:755— temporal_runtime::worker::mcp::compact_search_hit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 2 (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.
temporal_runtime::channels::activities::emit_chat_event (cognitive 20) crates/temporal-runtime/src/channels/activities.rs:603— temporal_runtime::channels::activities::emit_chat_event has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 6 (7 pts), boolean chains 1, 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.
temporal_runtime::gateway::registration::proxy_registered_route (cognitive 20) crates/temporal-runtime/src/gateway/registration.rs:470— temporal_runtime::gateway::registration::proxy_registered_route has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 2, 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.
temporal_runtime::bots::fires::fetch_exec_payload (cognitive 19) crates/temporal-runtime/src/bots/fires.rs:768— temporal_runtime::bots::fires::fetch_exec_payload has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 3 (7 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
temporal_runtime::gateway::service::mcp_discovery::failure_from_error_chain (cognitive 19) crates/temporal-runtime/src/gateway/service/mcp_discovery.rs:1049— temporal_runtime::gateway::service::mcp_discovery::failure_from_error_chain has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
temporal_runtime::run_roles (cognitive 19) crates/temporal-runtime/src/main.rs:545— temporal_runtime::run_roles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, loops 4 (6 pts), match/switch 3 (5 pts) (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.
temporal_runtime::worker::code::prepare_code_output (cognitive 19) crates/temporal-runtime/src/worker/code.rs:601— temporal_runtime::worker::code::prepare_code_output has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3 (7 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
temporal_runtime::bots::sessions::ensure_session (cognitive 17) crates/temporal-runtime/src/bots/sessions.rs:410— temporal_runtime::bots::sessions::ensure_session has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2, 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.
temporal_runtime::worker::code::finalize (cognitive 17) crates/temporal-runtime/src/worker/code.rs:402— temporal_runtime::worker::code::finalize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), match/switch 6 (7 pts), boolean chains 3 (nesting depth added 2). 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.
temporal_runtime::bots::fires::fetch_http_payload (cognitive 16) crates/temporal-runtime/src/bots/fires.rs:635— temporal_runtime::bots::fires::fetch_http_payload has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (3 pts), match/switch 1 (2 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.
Duplicated block (9 lines × 2) crates/harness/src/core/components/run.rs:1011— crates/harness/src/core/components/run.rs:1011-1019 | crates/harness/src/core/components/run.rs:1032-1040 — 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) crates/harness/src/core/components/tooling.rs:958— crates/harness/src/core/components/tooling.rs:958-966 | crates/harness/src/core/components/tooling.rs:1003-1011 — 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) crates/harness/src/storage/session.rs:891— crates/harness/src/storage/session.rs:891-899 | crates/store-fs/src/session.rs:310-318 — before extracting anything, compare `crates/harness/src/storage/session.rs` and `crates/store-fs/src/session.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 59 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 (9 lines × 2) crates/llm-clients/src/openai/completions.rs:144— crates/llm-clients/src/openai/completions.rs:144-152 | crates/llm-clients/src/openai/responses.rs:162-170 — before extracting anything, compare `crates/llm-clients/src/openai/completions.rs` and `crates/llm-clients/src/openai/responses.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 159 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 (9 lines × 2) crates/llm-runtime/src/anthropic_messages.rs:612— crates/llm-runtime/src/anthropic_messages.rs:612-620 | crates/llm-runtime/src/openai_responses.rs:247-255 — before extracting anything, compare `crates/llm-runtime/src/anthropic_messages.rs` and `crates/llm-runtime/src/openai_responses.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 113 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 (9 lines × 2) crates/llm-runtime/src/openai_completions.rs:263— crates/llm-runtime/src/openai_completions.rs:263-271 | crates/llm-runtime/src/openai_responses.rs:348-356 — before extracting anything, compare `crates/llm-runtime/src/openai_completions.rs` and `crates/llm-runtime/src/openai_responses.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 120 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 (9 lines × 2) crates/store-pg/src/mcp.rs:521— crates/store-pg/src/mcp.rs:521-529 | crates/store-pg/src/mcp.rs:538-546 — 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) crates/tools/src/fs/local.rs:131— crates/tools/src/fs/local.rs:131-139 | crates/tools/src/fs/scoped_local.rs:261-269 — before extracting anything, compare `crates/tools/src/fs/local.rs` and `crates/tools/src/fs/scoped_local.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 128 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 (9 lines × 2) crates/llm-runtime/src/anthropic_messages.rs:896— crates/llm-runtime/src/anthropic_messages.rs:896-904 | crates/llm-runtime/src/openai_responses.rs:577-585 — before extracting anything, compare `crates/llm-runtime/src/anthropic_messages.rs` and `crates/llm-runtime/src/openai_responses.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 113 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 (9 lines × 2) crates/harness/src/core/components/promise.rs:527— crates/harness/src/core/components/promise.rs:527-535 | crates/harness/src/core/components/promise.rs:547-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.
Duplicated block (9 lines × 2) crates/eval/src/main.rs:1168— crates/eval/src/main.rs:1168-1176 | crates/eval/src/main.rs:1184-1192 — 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) crates/eval/src/main.rs:187— crates/eval/src/main.rs:187-195 | crates/eval/src/main.rs:245-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.
Duplicated block (9 lines × 2) crates/llm-runtime/src/anthropic_messages.rs:1779— crates/llm-runtime/src/anthropic_messages.rs:1779-1787 | crates/llm-runtime/src/openai_responses.rs:1303-1311 — before extracting anything, compare `crates/llm-runtime/src/anthropic_messages.rs` and `crates/llm-runtime/src/openai_responses.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 113 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 (9 lines × 2) crates/tools/src/fs/scoped_local.rs:68— crates/tools/src/fs/scoped_local.rs:68-76 | crates/tools/src/fs/scoped_local.rs:251-259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/cli/src/auth_cli.rs:1195— crates/cli/src/auth_cli.rs:1195-1203 | crates/cli/src/auth_cli.rs:1313-1321 — 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) crates/environment-daemon/src/jobs.rs:702— crates/environment-daemon/src/jobs.rs:702-710 | crates/environment-daemon/src/process.rs:363-371 — before extracting anything, compare `crates/environment-daemon/src/jobs.rs` and `crates/environment-daemon/src/process.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 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 (9 lines × 2) crates/store-pg/src/environment.rs:464— crates/store-pg/src/environment.rs:464-472 | crates/store-pg/src/environment.rs:569-577 — 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) crates/tools/src/fs/local.rs:238— crates/tools/src/fs/local.rs:238-246 | crates/tools/src/fs/scoped_local.rs:397-405 — before extracting anything, compare `crates/tools/src/fs/local.rs` and `crates/tools/src/fs/scoped_local.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 128 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 (9 lines × 2) crates/tools/src/concurrency.rs:339— crates/tools/src/concurrency.rs:339-347 | crates/tools/src/concurrency.rs:351-359 — 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) crates/eval/src/main.rs:1133— crates/eval/src/main.rs:1133-1139 | crates/eval/src/main.rs:1143-1149 — 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) crates/harness/src/storage/session.rs:1153— crates/harness/src/storage/session.rs:1153-1159 | crates/store-fs/src/session.rs:481-487 — before extracting anything, compare `crates/harness/src/storage/session.rs` and `crates/store-fs/src/session.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 59 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) crates/store-pg/src/bots.rs:597— crates/store-pg/src/bots.rs:597-603 | crates/store-pg/src/bots.rs:654-660 — 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) crates/temporal-runtime/src/channels/control_plane.rs:250— crates/temporal-runtime/src/channels/control_plane.rs:250-256 | crates/temporal-runtime/src/channels/control_plane.rs:265-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.
Duplicated block (7 lines × 2) crates/temporal-runtime/src/gateway/http.rs:802— crates/temporal-runtime/src/gateway/http.rs:802-808 | crates/temporal-runtime/src/gateway/http.rs:857-863 — 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) crates/temporal-runtime/src/worker/activities/state.rs:316— crates/temporal-runtime/src/worker/activities/state.rs:316-322 | crates/temporal-runtime/src/worker/activities/state.rs:373-379 — 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) crates/tools/src/fs/apply_patch/seek_sequence.rs:26— crates/tools/src/fs/apply_patch/seek_sequence.rs:26-32 | crates/tools/src/fs/apply_patch/seek_sequence.rs:39-45 — 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) crates/tools/src/prompts/assembler.rs:156— crates/tools/src/prompts/assembler.rs:156-162 | crates/tools/src/skills/catalog.rs:122-128 — before extracting anything, compare `crates/tools/src/prompts/assembler.rs` and `crates/tools/src/skills/catalog.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 33 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) crates/vfs/src/snapshot.rs:706— crates/vfs/src/snapshot.rs:706-712 | crates/vfs/src/snapshot.rs:723-729 — 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) crates/llm-clients/src/openai/audio.rs:331— crates/llm-clients/src/openai/audio.rs:331-337 | crates/llm-clients/src/openai/responses.rs:1211-1217 — before extracting anything, compare `crates/llm-clients/src/openai/audio.rs` and `crates/llm-clients/src/openai/responses.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 124 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 (7 lines × 2) crates/bots/src/views.rs:596— crates/bots/src/views.rs:596-602 | crates/channels/src/media.rs:214-220 — 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) crates/llm-clients/src/openai/audio.rs:323— crates/llm-clients/src/openai/audio.rs:323-329 | crates/llm-clients/src/openai/responses.rs:1200-1209 — before extracting anything, compare `crates/llm-clients/src/openai/audio.rs` and `crates/llm-clients/src/openai/responses.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 124 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 (7 lines × 2) crates/api-projection/src/lib.rs:3070— crates/api-projection/src/lib.rs:3070-3076 | crates/api-projection/src/lib.rs:3081-3087 — 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) crates/store-pg/src/environment.rs:710— crates/store-pg/src/environment.rs:710-716 | crates/store-pg/src/environment_registration.rs:139-145 — 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) crates/harness/src/core/components/tooling.rs:1961— crates/harness/src/core/components/tooling.rs:1961-1967 | crates/harness/src/core/drive.rs:1105-1111 — 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) crates/store-pg/src/auth.rs:586— crates/store-pg/src/auth.rs:586-592 | crates/store-pg/src/oauth.rs:536-542 — before extracting anything, compare `crates/store-pg/src/auth.rs` and `crates/store-pg/src/oauth.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 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 (7 lines × 2) crates/temporal-runtime/src/gateway/http.rs:545— crates/temporal-runtime/src/gateway/http.rs:545-551 | crates/temporal-runtime/src/gateway/http.rs:591-597 — 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) crates/auth/src/github.rs:441— crates/auth/src/github.rs:441-447 | crates/auth/src/oauth.rs:789-795 — 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) crates/harness/src/core/components/turn.rs:473— crates/harness/src/core/components/turn.rs:473-479 | crates/harness/src/core/components/turn.rs:518-524 — 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) crates/store-pg/src/cas_sweep.rs:162— crates/store-pg/src/cas_sweep.rs:162-167 | crates/store-pg/src/cas_sweep.rs:233-238 — 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) crates/temporal-runtime/src/gateway/http.rs:702— crates/temporal-runtime/src/gateway/http.rs:702-707 | crates/temporal-runtime/src/gateway/http.rs:737-742 — 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) crates/temporal-runtime/src/gateway/service/session_preparation.rs:98— crates/temporal-runtime/src/gateway/service/session_preparation.rs:98-103 | crates/temporal-runtime/src/gateway/service/session_preparation.rs:183-209 — 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) crates/temporal-workflow/src/workflows/channels/conversation.rs:1065— crates/temporal-workflow/src/workflows/channels/conversation.rs:1065-1070 | crates/temporal-workflow/src/workflows/channels/conversation.rs:1302-1307 — 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) crates/tools/src/fs/local.rs:208— crates/tools/src/fs/local.rs:208-213 | crates/tools/src/fs/scoped_local.rs:357-362 — before extracting anything, compare `crates/tools/src/fs/local.rs` and `crates/tools/src/fs/scoped_local.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 128 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 (6 lines × 2) crates/harness/src/storage/blobs.rs:793— crates/harness/src/storage/blobs.rs:793-798 | crates/temporal-runtime/src/worker/reaper.rs:1181-1186 — 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) crates/llm-clients/src/openai/audio.rs:263— crates/llm-clients/src/openai/audio.rs:263-268 | crates/llm-clients/src/openai/responses.rs:507-512 — before extracting anything, compare `crates/llm-clients/src/openai/audio.rs` and `crates/llm-clients/src/openai/responses.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 124 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 (6 lines × 2) crates/store-pg/src/shared.rs:55— crates/store-pg/src/shared.rs:55-60 | crates/temporal-runtime/src/gateway/registration.rs:860-865 — 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) crates/temporal-runtime/src/gateway/service/session_jobs.rs:537— crates/temporal-runtime/src/gateway/service/session_jobs.rs:537-542 | crates/temporal-runtime/src/worker/activities/environment_jobs.rs:278-283 — 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) crates/tools/src/prompts/assembler.rs:674— crates/tools/src/prompts/assembler.rs:674-679 | crates/tools/src/skills/catalog.rs:485-490 — before extracting anything, compare `crates/tools/src/prompts/assembler.rs` and `crates/tools/src/skills/catalog.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 33 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 (6 lines × 2) crates/api-projection/src/lib.rs:2476— crates/api-projection/src/lib.rs:2476-2481 | crates/temporal-runtime/src/gateway/service/mcp_api.rs:342-347 — 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) crates/temporal-runtime/src/gateway/service/models_api.rs:708— crates/temporal-runtime/src/gateway/service/models_api.rs:708-713 | crates/temporal-runtime/src/universe.rs:421-426 — 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) crates/tools/src/prompts/assembler.rs:591— crates/tools/src/prompts/assembler.rs:591-596 | crates/tools/src/skills/catalog.rs:362-367 — before extracting anything, compare `crates/tools/src/prompts/assembler.rs` and `crates/tools/src/skills/catalog.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 33 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 (6 lines × 2) crates/tools/src/prompts/assembler.rs:692— crates/tools/src/prompts/assembler.rs:692-697 | crates/tools/src/skills/catalog.rs:503-508 — before extracting anything, compare `crates/tools/src/prompts/assembler.rs` and `crates/tools/src/skills/catalog.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 33 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 (6 lines × 2) crates/tools/src/fs/local.rs:31— crates/tools/src/fs/local.rs:31-36 | crates/tools/src/fs/scoped_local.rs:37-45 — before extracting anything, compare `crates/tools/src/fs/local.rs` and `crates/tools/src/fs/scoped_local.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 128 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 (6 lines × 2) crates/llm-clients/src/anthropic/messages.rs:1198— crates/llm-clients/src/anthropic/messages.rs:1198-1203 | crates/llm-clients/src/openai/responses.rs:1179-1184 — before extracting anything, compare `crates/llm-clients/src/anthropic/messages.rs` and `crates/llm-clients/src/openai/responses.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 62 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 (6 lines × 2) crates/auth/src/lib.rs:323— crates/auth/src/lib.rs:323-328 | crates/mcp/src/lib.rs:765-770 — 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) crates/environment-provider-incus/src/incus.rs:228— crates/environment-provider-incus/src/incus.rs:228-233 | crates/environment-provider-incus/src/incus.rs:318-323 — 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.
tools::transfer::capture_selection (cognitive 33) crates/tools/src/transfer.rs:306— tools::transfer::capture_selection has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (24 pts), match/switch 2 (4 pts), loops 3, boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tools::fs::apply_patch::seek_sequence::seek_sequence (cognitive 32) crates/tools/src/fs/apply_patch/seek_sequence.rs:5— tools::fs::apply_patch::seek_sequence::seek_sequence has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 7 (10 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tools::workflow_tool::derive_completion_keys_from_source (cognitive 32) crates/tools/src/workflow_tool.rs:383— tools::workflow_tool::derive_completion_keys_from_source has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 16). 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.
tools::callable::resolve (cognitive 31) crates/tools/src/callable.rs:212— tools::callable::resolve has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 6 (18 pts), if/else 6 (8 pts), loops 3 (5 pts) (nesting depth added 16). 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.
tools::environment_protocol::conformance::assert_environment_data_conformance (cognitive 27) crates/tools/src/environment_protocol/conformance.rs:56— tools::environment_protocol::conformance::assert_environment_data_conformance has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21, boolean chains 6. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
tools::transfer::materialize_selection (cognitive 27) crates/tools/src/transfer.rs:104— tools::transfer::materialize_selection has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 5 (8 pts), boolean chains 2, match/switch 2 (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.
tools::fs::tools::grep::bounded_generic_grep (cognitive 26) crates/tools/src/fs/tools/grep.rs:117— tools::fs::tools::grep::bounded_generic_grep has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tools::fs::apply_patch::engine::compute_replacements (cognitive 22) crates/tools/src/fs/apply_patch/engine.rs:206— tools::fs::apply_patch::engine::compute_replacements has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (20 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.
tools::toolset::register_toolset (cognitive 22) crates/tools/src/toolset.rs:404— tools::toolset::register_toolset has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (8 pts), loops 5 (8 pts), boolean chains 3, match/switch 1 (3 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.
tools::fs::apply_patch::parser::parse_one_hunk (cognitive 21) crates/tools/src/fs/apply_patch/parser.rs:178— tools::fs::apply_patch::parser::parse_one_hunk has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (4 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::environment::sources::scan_query (cognitive 19) crates/tools/src/environment/sources.rs:35— tools::environment::sources::scan_query has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 3 (7 pts) (nesting depth added 6). 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.
tools::fs::apply_patch::parser::parse_update_file_chunk (cognitive 19) crates/tools/src/fs/apply_patch/parser.rs:271— tools::fs::apply_patch::parser::parse_update_file_chunk has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tools::fs::path::normalize_path (cognitive 19) crates/tools/src/fs/path.rs:225— tools::fs::path::normalize_path has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 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.
tools::blobs::invoke_read (cognitive 17) crates/tools/src/blobs.rs:304— tools::blobs::invoke_read has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, match/switch 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.
tools::fs::tools::shared::collect_file_paths_bounded (cognitive 16) crates/tools/src/fs/tools/shared.rs:31— tools::fs::tools::shared::collect_file_paths_bounded has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 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.
tools::prompts::environment::assemble (cognitive 16) crates/tools/src/prompts/environment.rs:19— tools::prompts::environment::assemble has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, 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.
ClassTooLong: GatewayAgentApi crates/temporal-runtime/src/gateway/service/mod.rs:779— ClassTooLong — 3003 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 203 methods, 8 blocks, lines 244-5105. The bar is 400 significant lines; this is 2603 over it, 7.51× 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: SessionTools crates/temporal-runtime/src/worker/session_tools.rs:59— ClassTooLong — 1401 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 31 methods, 5 blocks, lines 59-2175. The bar is 400 significant lines; this is 1001 over it, 3.50× 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: CoreAgentProjector crates/api-projection/src/lib.rs:73— ClassTooLong — 1042 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 29 methods, 2 blocks, lines 73-1440. The bar is 400 significant lines; this is 642 over it, 2.61× 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: ChatSessionDriver crates/cli/src/chat/driver.rs:236— ClassTooLong — 1036 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 51 methods, 2 blocks, lines 236-1637. The bar is 400 significant lines; this is 636 over it, 2.59× 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: IncusClient crates/environment-provider-incus/src/incus.rs:122— ClassTooLong — 771 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 13 methods, 3 blocks, lines 122-1160. The bar is 400 significant lines; this is 371 over it, 1.93× 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: InMemoryEnvironmentRegistryStore crates/environments/src/memory.rs:26— ClassTooLong — 770 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 5 methods, 8 blocks, lines 26-1031. The bar is 400 significant lines; this is 370 over it, 1.93× 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: ControllerState crates/temporal-workflow/src/workflows/bots/controller/state.rs:300— ClassTooLong — 605 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 62 methods, 2 blocks, lines 300-1194. The bar is 400 significant lines; this is 205 over it, 1.51× 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: JobManager crates/environment-daemon/src/jobs.rs:35— ClassTooLong — 556 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 15 methods, 2 blocks, lines 35-861. The bar is 400 significant lines; this is 156 over it, 1.39× 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: GatewayDeploymentApi crates/temporal-runtime/src/gateway/deployment.rs:52— ClassTooLong — 530 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 7 methods, 3 blocks, lines 52-766. The bar is 400 significant lines; this is 130 over it, 1.33× 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: AgentApiService crates/api/src/service.rs:4— ClassTooLong — 498 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 120 methods. The bar is 400 significant lines; this is 98 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: Operation crates/environment-daemon/src/filesystem/transfer/session.rs:296— ClassTooLong — 466 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 9 methods, 3 blocks, lines 296-1244. The bar is 400 significant lines; this is 66 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: InMemorySessionStore crates/harness/src/storage/session.rs:634— ClassTooLong — 462 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 1 methods, 3 blocks, lines 634-1219. The bar is 400 significant lines; this is 62 over it, 1.16× 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: HttpAgentApi crates/cli/src/api_client.rs:63— ClassTooLong — 453 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 71 methods, 2 blocks, lines 63-678. The bar is 400 significant lines; this is 53 over it, 1.13× 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: BuiltinTool crates/tools/src/builtin/mod.rs:99— ClassTooLong — 447 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 33 methods, 2 blocks, lines 99-839. The bar is 400 significant lines; this is 47 over it, 1.12× 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: InlineToolRuntime crates/tools/src/runtime/inline.rs:26— ClassTooLong — 409 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 26 methods, 4 blocks, lines 26-567. The bar is 400 significant lines; this is 9 over it, 1.02× 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: InMemoryBotStore crates/bots/src/memory.rs:42— ClassTooLong — 408 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 3 methods, 6 blocks, lines 42-621. The bar is 400 significant lines; this is 8 over it, 1.02× 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.
R4 · Test Coverage· No test reaches this file · ×16
No test reaches this file platform/cli/src/main.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file platform/db/scripts/check-migrations.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file crates/codemode/src/prelude.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file platform/scripts/generate-config-reference.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file scripts/release/create-sbom.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file platform/connectors/src/host/main.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file platform/cli/src/client.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file platform/cli/src/prompt.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file platform/scripts/check-product-identity.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file platform/cli/src/config.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file platform/backend/src/main.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file platform/connectors/src/host/temporal-metrics.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file platform/db/scripts/auth-codegen.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file platform/db/scripts/patch-auth-schema.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
Swallowed exception (empty catch) platform/backend/src/static.ts:51— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) platform/connectors/src/providers/typing.ts:55— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) platform/web/src/lib/dictation.ts:24— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) platform/web/src/lib/composer-model.ts:108— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) platform/web/src/lib/composer-attachments.ts:88— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) platform/web/src/lib/automatic-sign-in.ts:19— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) platform/web/src/lib/audio-capture.ts:22— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) platform/web/src/lib/audio-capture.ts:35— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) platform/web/src/lib/audio-capture.ts:85— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) platform/web/src/lib/user-preferences.tsx:93— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) platform/web/src/lib/sessions/list-preferences.ts:98— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) platform/web/src/lib/sessions/list-preferences.ts:133— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) platform/web/src/lib/sessions/draft.ts:22— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) platform/web/src/pages/McpServersPage.tsx:469— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Duplicated block (13 lines × 2) crates/api-projection/src/lib.rs:1275— crates/api-projection/src/lib.rs:1275-1287 | crates/api-projection/src/lib.rs:1298-1310 — 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) crates/bots/src/poll.rs:29— crates/bots/src/poll.rs:29-41 | crates/bots/src/render.rs:306-318 — 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) crates/environment-provider-incus/src/incus.rs:1451— crates/environment-provider-incus/src/incus.rs:1451-1463 | crates/environment-provider-incus/src/server.rs:545-557 — 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) crates/harness/src/core/components/turn.rs:558— crates/harness/src/core/components/turn.rs:558-570 | crates/llm-runtime/src/anthropic_messages.rs:1569-1581 — 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 (13 lines × 2) crates/store-pg/src/environment.rs:579— crates/store-pg/src/environment.rs:579-591 | crates/store-pg/src/environment.rs:684-696 — 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) crates/store-pg/src/session.rs:102— crates/store-pg/src/session.rs:102-114 | crates/store-pg/src/session.rs:1595-1607 — 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) crates/temporal-runtime/src/environments/provider_controllers.rs:306— crates/temporal-runtime/src/environments/provider_controllers.rs:306-318 | crates/temporal-runtime/src/environments/provider_controllers.rs:341-353 — 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) crates/temporal-workflow/src/workflows/session/drive.rs:636— crates/temporal-workflow/src/workflows/session/drive.rs:636-648 | crates/temporal-workflow/src/workflows/session/drive.rs:735-747 — 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) crates/tools/src/fs/local.rs:214— crates/tools/src/fs/local.rs:214-226 | crates/tools/src/fs/scoped_local.rs:373-385 — before extracting anything, compare `crates/tools/src/fs/local.rs` and `crates/tools/src/fs/scoped_local.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 128 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 (13 lines × 2) crates/llm-clients/src/openai/audio.rs:42— crates/llm-clients/src/openai/audio.rs:42-54 | crates/llm-clients/src/openai/responses.rs:47-59 — before extracting anything, compare `crates/llm-clients/src/openai/audio.rs` and `crates/llm-clients/src/openai/responses.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 124 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 (13 lines × 2) crates/harness/src/core/components/workflow_tool.rs:1645— crates/harness/src/core/components/workflow_tool.rs:1645-1657 | crates/harness/src/core/components/workflow_tool.rs:1803-1815 — 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) crates/store-pg/src/session.rs:971— crates/store-pg/src/session.rs:971-983 | crates/store-pg/src/session.rs:1872-1884 — 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.
temporal_runtime::gateway::registration::control_session (cyclomatic 32) crates/temporal-runtime/src/gateway/registration.rs:530— temporal_runtime::gateway::registration::control_session has cyclomatic complexity 32 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
temporal_runtime::worker::code::finalize (cyclomatic 23) crates/temporal-runtime/src/worker/code.rs:402— temporal_runtime::worker::code::finalize has cyclomatic complexity 23 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
temporal_runtime::channels::activities::emit_chat_event (cyclomatic 21) crates/temporal-runtime/src/channels/activities.rs:603— temporal_runtime::channels::activities::emit_chat_event has cyclomatic complexity 21 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
temporal_runtime::gateway::http::proxy_provider_route (cyclomatic 21) crates/temporal-runtime/src/gateway/http.rs:782— temporal_runtime::gateway::http::proxy_provider_route has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (temporal_runtime::gateway::http::proxy_external_route) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
temporal_runtime::gateway::http::proxy_external_route (cyclomatic 21) crates/temporal-runtime/src/gateway/http.rs:841— temporal_runtime::gateway::http::proxy_external_route has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (temporal_runtime::gateway::http::proxy_provider_route) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
temporal_runtime::worker::activities::storage::prepare_payload_context (cyclomatic 21) crates/temporal-runtime/src/worker/activities/storage.rs:260— temporal_runtime::worker::activities::storage::prepare_payload_context has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
temporal_runtime::worker::activities::context_refresh::refresh_context (cyclomatic 20) crates/temporal-runtime/src/worker/activities/context_refresh.rs:29— temporal_runtime::worker::activities::context_refresh::refresh_context has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
temporal_runtime::gateway::http::environment_route_upgrade (cyclomatic 18) crates/temporal-runtime/src/gateway/http.rs:501— temporal_runtime::gateway::http::environment_route_upgrade has cyclomatic complexity 18 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
temporal_runtime::run_api_key_command (cyclomatic 17) crates/temporal-runtime/src/main.rs:341— temporal_runtime::run_api_key_command has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
temporal_runtime::worker::mcp::visible_mcp_result (cyclomatic 17) crates/temporal-runtime/src/worker/mcp.rs:995— temporal_runtime::worker::mcp::visible_mcp_result has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
temporal_runtime::worker::activities::storage::materialize_await_result (cyclomatic 16) crates/temporal-runtime/src/worker/activities/storage.rs:141— temporal_runtime::worker::activities::storage::materialize_await_result has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
TooManyMethods: GatewayAgentApi crates/temporal-runtime/src/gateway/service/mod.rs:779— TooManyMethods — 203 methods, declared across 19 files: service/mod.rs (49), service/bots_api.rs (25), service/authorization.rs (23), service/workflow.rs (23), +15 more file(s). The bar is 30 methods; this is 173 over it, 6.77× 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: HttpAgentApi crates/cli/src/api_client.rs:63— TooManyMethods — 71 methods. The bar is 30 methods; this is 41 over it, 2.37× 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.
TooManyMethods: ControllerState crates/temporal-workflow/src/workflows/bots/controller/state.rs:300— TooManyMethods — 62 methods. The bar is 30 methods; this is 32 over it, 2.07× 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.
TooManyMethods: ChatSessionDriver crates/cli/src/chat/driver.rs:236— TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× 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.
TooManyMethods: PgStore crates/store-pg/src/lib.rs:211— TooManyMethods — 45 methods, declared across 11 files: src/session.rs (13), src/lib.rs (11), src/bots.rs (4), src/cas_sweep.rs (4), +7 more file(s). 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: WorkerActivities crates/temporal-runtime/src/worker/activities/mod.rs:78— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 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.
TooManyMethods: EnvironmentService crates/temporal-runtime/src/environments/mod.rs:24— TooManyMethods — 33 methods, declared across 5 files: environments/lifecycle.rs (15), environments/registration.rs (6), environments/providers.rs (5), environments/credentials.rs (4), +1 more file(s). The bar is 30 methods; this is 3 over it, 1.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: BuiltinTool crates/tools/src/builtin/mod.rs:99— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 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.
TooManyMethods: WorkflowActivities crates/temporal-workflow/src/activities.rs:62— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× 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.
TooManyMethods: EnvironmentDataClient crates/environment-client/src/data.rs:39— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× 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.
TooManyMethods: SessionTools crates/temporal-runtime/src/worker/session_tools.rs:59— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× 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.
Duplicated block (12 lines × 2) crates/llm-clients/src/openai/audio.rs:276— crates/llm-clients/src/openai/audio.rs:276-287 | crates/llm-clients/src/openai/responses.rs:1225-1236 — before extracting anything, compare `crates/llm-clients/src/openai/audio.rs` and `crates/llm-clients/src/openai/responses.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 124 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) crates/store-pg/src/environment.rs:325— crates/store-pg/src/environment.rs:325-336 | crates/store-pg/src/environment.rs:432-443 — 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) crates/temporal-runtime/src/gateway/service/mod.rs:1069— crates/temporal-runtime/src/gateway/service/mod.rs:1069-1080 | crates/temporal-runtime/src/gateway/service/mod.rs:1094-1105 — 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) crates/tools/src/fs/apply_patch/seek_sequence.rs:34— crates/tools/src/fs/apply_patch/seek_sequence.rs:34-45 | crates/tools/src/fs/apply_patch/seek_sequence.rs:47-58 — 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) crates/tools/src/fs/vfs.rs:507— crates/tools/src/fs/vfs.rs:507-518 | crates/tools/src/fs/vfs.rs:650-661 — 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) crates/cli/src/chat/driver.rs:2202— crates/cli/src/chat/driver.rs:2202-2213 | crates/cli/src/chat/tui/cell.rs:696-707 — 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) crates/environments/src/memory.rs:967— crates/environments/src/memory.rs:967-978 | crates/store-pg/src/environment.rs:1044-1055 — 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) crates/temporal-runtime/src/gateway/service/session_preparation.rs:80— crates/temporal-runtime/src/gateway/service/session_preparation.rs:80-94 | crates/temporal-runtime/src/gateway/service/session_preparation.rs:168-179 — 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) crates/harness/src/core/admit.rs:786— crates/harness/src/core/admit.rs:786-797 | crates/harness/src/core/admit.rs:827-838 — 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) crates/tools/src/fs/local.rs:179— crates/tools/src/fs/local.rs:179-190 | crates/tools/src/fs/scoped_local.rs:323-334 — before extracting anything, compare `crates/tools/src/fs/local.rs` and `crates/tools/src/fs/scoped_local.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 128 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) crates/test-support/src/runner/drive.rs:164— crates/test-support/src/runner/drive.rs:164-175 | crates/test-support/src/runner/drive.rs:400-411 — 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.
tools::environment_protocol::conformance::assert_environment_data_conformance (cyclomatic 28) crates/tools/src/environment_protocol/conformance.rs:56— tools::environment_protocol::conformance::assert_environment_data_conformance has cyclomatic complexity 28 (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.
tools::definitions::resolve (cyclomatic 20) crates/tools/src/definitions.rs:87— tools::definitions::resolve has cyclomatic complexity 20 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
tools::fs::apply_patch::seek_sequence::seek_sequence (cyclomatic 19) crates/tools/src/fs/apply_patch/seek_sequence.rs:5— tools::fs::apply_patch::seek_sequence::seek_sequence has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tools::workflow_tool::derive_completion_keys_from_source (cyclomatic 19) crates/tools/src/workflow_tool.rs:383— tools::workflow_tool::derive_completion_keys_from_source has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tools::builtin::canonical::invoke_json (cyclomatic 18) crates/tools/src/builtin/canonical.rs:330— tools::builtin::canonical::invoke_json has cyclomatic complexity 18 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
tools::callable::resolve (cyclomatic 18) crates/tools/src/callable.rs:212— tools::callable::resolve has cyclomatic complexity 18 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
tools::transfer::capture_selection (cyclomatic 18) crates/tools/src/transfer.rs:306— tools::transfer::capture_selection has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tools::toolset::register_toolset (cyclomatic 17) crates/tools/src/toolset.rs:404— tools::toolset::register_toolset has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
tools::transfer::materialize_selection (cyclomatic 17) crates/tools/src/transfer.rs:104— tools::transfer::materialize_selection has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tools::blobs::invoke_read (cyclomatic 16) crates/tools/src/blobs.rs:304— tools::blobs::invoke_read has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GatewayAgentApi::decide_run_approvals (cognitive 32) crates/temporal-runtime/src/gateway/service/mod.rs:3296— GatewayAgentApi::decide_run_approvals has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 4 (8 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GatewayAgentApi::wait_for_context_append_outcomes (cognitive 29) crates/temporal-runtime/src/gateway/service/workflow.rs:134— GatewayAgentApi::wait_for_context_append_outcomes has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 3 (6 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (GatewayAgentApi::wait_for_context_keys_removed) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
GatewayAgentApi::wait_for_context_keys_removed (cognitive 29) crates/temporal-runtime/src/gateway/service/workflow.rs:192— GatewayAgentApi::wait_for_context_keys_removed has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 3 (6 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (GatewayAgentApi::wait_for_context_append_outcomes) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
GatewayAgentApi::replace_context (cognitive 27) crates/temporal-runtime/src/gateway/service/mod.rs:2922— GatewayAgentApi::replace_context has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 3 (7 pts), loops 3 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GatewayAgentApi::append_context (cognitive 26) crates/temporal-runtime/src/gateway/service/mod.rs:2759— GatewayAgentApi::append_context has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 5 (12 pts), if/else 8 (11 pts), loops 3 (nesting depth added 10). 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.
GatewayAgentApi::put_bot_trigger_record (cognitive 23) crates/temporal-runtime/src/gateway/service/bots_api.rs:237— GatewayAgentApi::put_bot_trigger_record has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 6 (10 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GatewayAgentApi::ingest_bot_webhook (cognitive 21) crates/temporal-runtime/src/bots/hooks.rs:54— GatewayAgentApi::ingest_bot_webhook has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11, match/switch 7 (10 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GatewayAgentApi::wait_for_approval_decision (cognitive 19) crates/temporal-runtime/src/gateway/service/workflow.rs:466— GatewayAgentApi::wait_for_approval_decision has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 1, 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.
GatewayAgentApi::start_session_internal (cognitive 18) crates/temporal-runtime/src/gateway/service/session_lifecycle.rs:239— GatewayAgentApi::start_session_internal has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, match/switch 4 (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.
GatewayAgentApi::wait_for_steering_accepted (cognitive 17) crates/temporal-runtime/src/gateway/service/workflow.rs:417— GatewayAgentApi::wait_for_steering_accepted has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), boolean chains 1, 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.
Duplicated block (15 lines × 2) crates/harness/src/core/components/run.rs:902— crates/harness/src/core/components/run.rs:902-916 | crates/harness/src/core/components/run.rs:919-933 — 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 (15 lines × 2) crates/llm-clients/src/openai/completions.rs:757— crates/llm-clients/src/openai/completions.rs:757-771 | crates/llm-clients/src/openai/responses.rs:1157-1171 — before extracting anything, compare `crates/llm-clients/src/openai/completions.rs` and `crates/llm-clients/src/openai/responses.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 159 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 (15 lines × 2) crates/llm-clients/src/openai/responses.rs:240— crates/llm-clients/src/openai/responses.rs:240-254 | crates/llm-clients/src/openai/responses.rs:380-394 — 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 (15 lines × 2) crates/temporal-runtime/src/gateway/service/workflow.rs:432— crates/temporal-runtime/src/gateway/service/workflow.rs:432-446 | crates/temporal-runtime/src/gateway/service/workflow.rs:480-494 — 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 (15 lines × 2) crates/temporal-workflow/src/workflows/session/session_state.rs:327— crates/temporal-workflow/src/workflows/session/session_state.rs:327-341 | crates/temporal-workflow/src/workflows/session/workflow_starts.rs:186-200 — 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 lines × 2) crates/tools/src/fs/local.rs:88— crates/tools/src/fs/local.rs:88-102 | crates/tools/src/fs/scoped_local.rs:206-220 — before extracting anything, compare `crates/tools/src/fs/local.rs` and `crates/tools/src/fs/scoped_local.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 128 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 (15 lines × 2) crates/tools/src/fs/local.rs:191— crates/tools/src/fs/local.rs:191-205 | crates/tools/src/fs/scoped_local.rs:340-354 — before extracting anything, compare `crates/tools/src/fs/local.rs` and `crates/tools/src/fs/scoped_local.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 128 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 (15 lines × 2) crates/tools/src/workflow_tool.rs:433— crates/tools/src/workflow_tool.rs:433-447 | crates/tools/src/workflow_tool.rs:474-488 — 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 (15 lines × 2) crates/store-pg/src/channels.rs:40— crates/store-pg/src/channels.rs:40-54 | crates/store-pg/src/channels.rs:211-226 — 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 (15 lines × 2) crates/store-pg/src/environment.rs:341— crates/store-pg/src/environment.rs:341-355 | crates/store-pg/src/environment.rs:448-462 — 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.
cli::connection::handle (cognitive 46) crates/cli/src/connection.rs:501— cli::connection::handle has cognitive complexity 46 (threshold 15). Drivers by points: if/else 24 (38 pts), boolean chains 4, loops 1 (3 pts), match/switch 1 (nesting depth added 16). 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.
cli::chat::tui::app::spawn_driver_task (cognitive 34) crates/cli/src/chat/tui/app.rs:109— cli::chat::tui::app::spawn_driver_task has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 3 (9 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 19). 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.
cli::chat::tui::insert_history::insert_history_lines_with_mode (cognitive 25) crates/cli/src/chat/tui/insert_history.rs:37— cli::chat::tui::insert_history::insert_history_lines_with_mode has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 4 (10 pts), boolean chains 1, match/switch 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.
cli::administration_cli::universe (cognitive 23) crates/cli/src/administration_cli.rs:32— cli::administration_cli::universe has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 1 (3 pts), 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.
cli::chat::tui::app::run_shell (cognitive 22) crates/cli/src/chat/tui/app.rs:27— cli::chat::tui::app::run_shell has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli::chat::tui::wrapping::adaptive_wrap_line (cognitive 20) crates/cli/src/chat/tui/wrapping.rs:18— cli::chat::tui::wrapping::adaptive_wrap_line has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli::chat::driver::handle (cognitive 19) crates/cli/src/chat/driver.rs:110— cli::chat::driver::handle has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (13 pts), loops 3 (6 pts) (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
cli::administration_cli::api_key (cognitive 18) crates/cli/src/administration_cli.rs:194— cli::administration_cli::api_key has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (3 pts), match/switch 1 (nesting depth added 8). 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.
cli::profile_cli::handle (cognitive 16) crates/cli/src/profile_cli.rs:183— cli::profile_cli::handle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 6). 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.
Duplicated block (14 lines × 2) crates/cli/src/mcp_cli.rs:727— crates/cli/src/mcp_cli.rs:727-740 | crates/cli/src/mcp_cli.rs:775-788 — 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) crates/environment-daemon/src/jobs.rs:756— crates/environment-daemon/src/jobs.rs:756-769 | crates/environment-daemon/src/jobs.rs:777-790 — 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) crates/llm-clients/src/openai/completions.rs:122— crates/llm-clients/src/openai/completions.rs:122-135 | crates/llm-clients/src/openai/responses.rs:140-153 — before extracting anything, compare `crates/llm-clients/src/openai/completions.rs` and `crates/llm-clients/src/openai/responses.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) crates/temporal-runtime/src/environments/lifecycle.rs:442— crates/temporal-runtime/src/environments/lifecycle.rs:442-455 | crates/temporal-runtime/src/environments/lifecycle.rs:588-601 — 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) crates/temporal-runtime/src/gateway/service/models_api.rs:241— crates/temporal-runtime/src/gateway/service/models_api.rs:241-254 | crates/temporal-runtime/src/gateway/service/models_api.rs:451-464 — 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) crates/temporal-workflow/src/workflows/session/session_state.rs:343— crates/temporal-workflow/src/workflows/session/session_state.rs:343-356 | crates/temporal-workflow/src/workflows/session/workflow_starts.rs:202-215 — 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 (14 lines × 2) crates/llm-runtime/src/openai_completions.rs:233— crates/llm-runtime/src/openai_completions.rs:233-246 | crates/llm-runtime/src/openai_responses.rs:218-232 — before extracting anything, compare `crates/llm-runtime/src/openai_completions.rs` and `crates/llm-runtime/src/openai_responses.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) crates/store-pg/src/environment.rs:369— crates/store-pg/src/environment.rs:369-383 | crates/store-pg/src/environment.rs:470-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.
Duplicated block (14 lines × 2) crates/llm-runtime/src/openai_completions.rs:1181— crates/llm-runtime/src/openai_completions.rs:1181-1194 | crates/llm-runtime/src/openai_responses.rs:1082-1095 — before extracting anything, compare `crates/llm-runtime/src/openai_completions.rs` and `crates/llm-runtime/src/openai_responses.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 120 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.
environment_daemon::filesystem::scan::scan (cognitive 162) crates/environment-daemon/src/filesystem/scan.rs:17— environment_daemon::filesystem::scan::scan has cognitive complexity 162 (threshold 15). Drivers by points: if/else 38 (126 pts), loops 6 (16 pts), boolean chains 14, match/switch 2 (6 pts) (nesting depth added 102). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
environment_daemon::filesystem::transfer::capture (cognitive 26) crates/environment-daemon/src/filesystem/transfer/mod.rs:48— environment_daemon::filesystem::transfer::capture has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (7 pts), match/switch 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
environment_daemon::jobs::validate_and_resolve_start (cognitive 26) crates/environment-daemon/src/jobs.rs:949— environment_daemon::jobs::validate_and_resolve_start has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (6 pts), boolean chains 2 (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.
environment_daemon::filesystem::transfer::materialize (cognitive 25) crates/environment-daemon/src/filesystem/transfer/mod.rs:140— environment_daemon::filesystem::transfer::materialize has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 5 (9 pts), match/switch 1 (2 pts) (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.
environment_daemon::filesystem::search_text_blocking (cognitive 22) crates/environment-daemon/src/filesystem.rs:472— environment_daemon::filesystem::search_text_blocking has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
environment_daemon::filesystem::glob_files_blocking (cognitive 19) crates/environment-daemon/src/filesystem.rs:600— environment_daemon::filesystem::glob_files_blocking has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 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.
environment_daemon::jobs::read_job_stream (cognitive 19) crates/environment-daemon/src/jobs.rs:892— environment_daemon::jobs::read_job_stream has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 1 (2 pts), boolean chains 1, 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.
environment_daemon::registration::control_session (cognitive 19) crates/environment-daemon/src/registration.rs:101— environment_daemon::registration::control_session has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (9 pts), match/switch 5 (9 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.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×8
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/cli/src/auth_cli.rs:715— crates/cli/src/auth_cli.rs:715-740 | crates/cli/src/auth_cli.rs:768-783 | crates/cli/src/auth_cli.rs:785-800 | crates/cli/src/auth_cli.rs:1347-1366 — 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) crates/cli/src/auth_cli.rs:1048— crates/cli/src/auth_cli.rs:1048-1102 | crates/cli/src/auth_cli.rs:1104-1126 | crates/cli/src/auth_cli.rs:1205-1227 | crates/cli/src/auth_cli.rs:1259-1289 — 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) crates/environments/src/memory.rs:229— crates/environments/src/memory.rs:229-289 | crates/environments/src/memory.rs:294-362 | crates/environments/src/memory.rs:367-419 | crates/environments/src/memory.rs:424-513 — 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) crates/harness/src/storage/session.rs:1375— crates/harness/src/storage/session.rs:1375-1397 | crates/store-fs/src/session.rs:403-456 | crates/store-pg/src/session.rs:59-186 | crates/store-pg/src/session.rs:1586-1659 — 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) crates/llm-clients/src/anthropic/messages.rs:1246— crates/llm-clients/src/anthropic/messages.rs:1246-1266 | crates/llm-clients/src/openai/audio.rs:295-319 | crates/llm-clients/src/openai/completions.rs:830-854 | crates/llm-clients/src/openai/responses.rs:1244-1268 — 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) crates/llm-runtime/src/openai_completions.rs:184— crates/llm-runtime/src/openai_completions.rs:184-246 | crates/llm-runtime/src/openai_completions.rs:258-283 | crates/llm-runtime/src/openai_responses.rs:166-232 | crates/llm-runtime/src/openai_responses.rs:343-375 — 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) crates/temporal-runtime/src/environments/lifecycle.rs:46— crates/temporal-runtime/src/environments/lifecycle.rs:46-143 | crates/temporal-runtime/src/environments/lifecycle.rs:441-494 | crates/temporal-runtime/src/environments/lifecycle.rs:531-570 | crates/temporal-runtime/src/environments/lifecycle.rs:575-647 — 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) crates/temporal-runtime/src/gateway/service/mod.rs:2276— crates/temporal-runtime/src/gateway/service/mod.rs:2276-2331 | crates/temporal-runtime/src/gateway/service/mod.rs:2585-2639 | crates/temporal-runtime/src/gateway/service/mod.rs:2726-2757 | crates/temporal-runtime/src/gateway/service/mod.rs:3794-3820 — 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.
Duplicated block (5 lines × 2) crates/environment-daemon/src/filesystem/transfer/session.rs:106— crates/environment-daemon/src/filesystem/transfer/session.rs:106-110 | crates/environment-daemon/src/filesystem/transfer/session.rs:1139-1143 — 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 (5 lines × 2) crates/temporal-workflow/src/workflows/session/admissions.rs:266— crates/temporal-workflow/src/workflows/session/admissions.rs:266-270 | crates/test-support/src/runner/drive.rs:618-622 — 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) crates/tools/src/fs/local.rs:228— crates/tools/src/fs/local.rs:228-232 | crates/tools/src/fs/scoped_local.rs:387-391 — before extracting anything, compare `crates/tools/src/fs/local.rs` and `crates/tools/src/fs/scoped_local.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 128 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 (5 lines × 2) crates/auth/src/broker.rs:544— crates/auth/src/broker.rs:544-548 | crates/auth/src/flow.rs:426-430 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/store-fs/src/blob.rs:33— crates/store-fs/src/blob.rs:33-37 | crates/store-fs/src/session.rs:33-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/tools/src/transfer.rs:685— crates/tools/src/transfer.rs:685-689 | crates/tools/src/transfer.rs:737-741 — 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 (5 lines × 2) crates/mcp/src/lib.rs:633— crates/mcp/src/lib.rs:633-637 | crates/mcp/src/lib.rs:706-710 — 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 (5 lines × 2) crates/codemode/src/engine.rs:363— crates/codemode/src/engine.rs:363-367 | crates/codemode/src/engine.rs:407-411 — 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.
temporal_workflow::workflows::session::code_tools::run_dispatch_loop (cognitive 39) crates/temporal-workflow/src/workflows/session/code_tools.rs:773— temporal_workflow::workflows::session::code_tools::run_dispatch_loop has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 4 (10 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 20). 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.
temporal_workflow::workflows::session::admissions::admit_admissions (cognitive 38) crates/temporal-workflow/src/workflows/session/admissions.rs:7— temporal_workflow::workflows::session::admissions::admit_admissions has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (29 pts), match/switch 3 (7 pts), boolean chains 1, loops 1 (nesting depth added 22). 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.
temporal_workflow::workflows::session::drive::drive_until_idle (cognitive 25) crates/temporal-workflow/src/workflows/session/drive.rs:116— temporal_workflow::workflows::session::drive::drive_until_idle has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 4 (11 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
temporal_workflow::workflows::bots::controller::run_controller (cognitive 24) crates/temporal-workflow/src/workflows/bots/controller.rs:213— temporal_workflow::workflows::bots::controller::run_controller has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (4 pts), match/switch 1 (4 pts), boolean chains 2 (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.
temporal_workflow::workflows::bots::controller::state::validate_event (cognitive 16) crates/temporal-workflow/src/workflows/bots/controller/state.rs:1199— temporal_workflow::workflows::bots::controller::state::validate_event has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4 (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.
temporal_workflow::workflows::channels::conversation::prepare_message_media (cognitive 16) crates/temporal-workflow/src/workflows/channels/conversation.rs:588— temporal_workflow::workflows::channels::conversation::prepare_message_media has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 2 (7 pts), if/else 2 (6 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.
temporal_workflow::workflows::session::promise_sources::process_pending_source_resolutions (cognitive 16) crates/temporal-workflow/src/workflows/session/promise_sources.rs:253— temporal_workflow::workflows::session::promise_sources::process_pending_source_resolutions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 3 (7 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (8 lines × 3) crates/environment-daemon/src/filesystem.rs:439— crates/environment-daemon/src/filesystem.rs:439-446 | crates/environment-daemon/src/jobs.rs:832-839 | crates/environment-daemon/src/process.rs:738-745 — before extracting anything, compare `crates/environment-daemon/src/jobs.rs` and `crates/environment-daemon/src/process.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) crates/harness/src/storage/session.rs:811— crates/harness/src/storage/session.rs:811-818 | crates/harness/src/storage/session.rs:828-835 | crates/harness/src/storage/session.rs:850-857 — 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 (8 lines × 3) crates/llm-clients/src/anthropic/messages.rs:1233— crates/llm-clients/src/anthropic/messages.rs:1233-1240 | crates/llm-clients/src/openai/audio.rs:282-289 | crates/llm-clients/src/openai/responses.rs:1231-1238 — before extracting anything, compare `crates/llm-clients/src/anthropic/messages.rs` and `crates/llm-clients/src/openai/responses.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 62 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 (8 lines × 3) crates/temporal-runtime/src/worker/activities/state.rs:294— crates/temporal-runtime/src/worker/activities/state.rs:294-301 | crates/temporal-runtime/src/worker/activities/state.rs:324-331 | crates/temporal-runtime/src/worker/activities/state.rs:381-388 — 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 (8 lines × 3) crates/environment-protocol/src/registration.rs:219— crates/environment-protocol/src/registration.rs:219-226 | crates/environments/src/lib.rs:137-144 | crates/temporal-runtime/src/gateway/service/bots_api.rs:63-70 — 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 (8 lines × 3) crates/llm-clients/src/openai/audio.rs:66— crates/llm-clients/src/openai/audio.rs:66-73 | crates/llm-clients/src/openai/completions.rs:66-73 | crates/llm-clients/src/openai/responses.rs:73-80 — before extracting anything, compare `crates/llm-clients/src/openai/audio.rs` and `crates/llm-clients/src/openai/completions.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) crates/llm-clients/src/anthropic/messages.rs:1178— crates/llm-clients/src/anthropic/messages.rs:1178-1185 | crates/llm-clients/src/openai/completions.rs:755-763 | crates/llm-clients/src/openai/responses.rs:1155-1163 — before extracting anything, compare `crates/llm-clients/src/anthropic/messages.rs` and `crates/llm-clients/src/openai/completions.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 51 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.
Off the main sequence: @lightspeed-ai/platform-db — @lightspeed-ai/platform-db: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: codemode — codemode: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: environment-protocol — environment-protocol: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 9 project(s), so it's rigid to change.
Off the main sequence: llm-clients — llm-clients: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: api — api: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 12 project(s), so it's rigid to change.
Off the main sequence: harness — harness: abstractness 0.03, instability 0.00, distance 0.97 — zone of pain — concrete and depended on by 13 project(s), so it's rigid to change.
Off the main sequence: @lightspeed-ai/sdk — @lightspeed-ai/sdk: abstractness 0.22, instability 0.00, distance 0.78 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
GatewayAgentApi::ingest_bot_webhook (cyclomatic 21) crates/temporal-runtime/src/bots/hooks.rs:54— GatewayAgentApi::ingest_bot_webhook has cyclomatic complexity 21 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
GatewayAgentApi::put_bot_trigger_record (cyclomatic 19) crates/temporal-runtime/src/gateway/service/bots_api.rs:237— GatewayAgentApi::put_bot_trigger_record has cyclomatic complexity 19 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
GatewayAgentApi::replace_context (cyclomatic 19) crates/temporal-runtime/src/gateway/service/mod.rs:2922— GatewayAgentApi::replace_context has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GatewayAgentApi::decide_run_approvals (cyclomatic 18) crates/temporal-runtime/src/gateway/service/mod.rs:3296— GatewayAgentApi::decide_run_approvals has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GatewayAgentApi::start_session_internal (cyclomatic 18) crates/temporal-runtime/src/gateway/service/session_lifecycle.rs:239— GatewayAgentApi::start_session_internal has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
GatewayAgentApi::append_context (cyclomatic 17) crates/temporal-runtime/src/gateway/service/mod.rs:2759— GatewayAgentApi::append_context has cyclomatic complexity 17 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
llm_runtime::compaction::compact (cognitive 55) crates/llm-runtime/src/compaction.rs:77— llm_runtime::compaction::compact has cognitive complexity 55 (threshold 15). Drivers by points: if/else 12 (42 pts), loops 3 (6 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 35). 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.
llm_runtime::anthropic_messages::materialize_tools (cognitive 28) crates/llm-runtime/src/anthropic_messages.rs:1087— llm_runtime::anthropic_messages::materialize_tools has cognitive complexity 28 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (9 pts), match/switch 3 (8 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
llm_runtime::openai_completions::materialize_message (cognitive 27) crates/llm-runtime/src/openai_completions.rs:633— llm_runtime::openai_completions::materialize_message has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 4, match/switch 2 (3 pts) (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.
llm_runtime::openai_completions::materialize_messages_tracked (cognitive 22) crates/llm-runtime/src/openai_completions.rs:427— llm_runtime::openai_completions::materialize_messages_tracked has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, 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.
llm_runtime::openai_responses::materialize_input_item (cognitive 20) crates/llm-runtime/src/openai_responses.rs:597— llm_runtime::openai_responses::materialize_input_item has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 3 (7 pts), boolean chains 2 (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.
llm_runtime::media::normalize_image (cognitive 16) crates/llm-runtime/src/media.rs:291— llm_runtime::media::normalize_image has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, 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.
Duplicated block (6 lines × 3) crates/harness/src/core/components/tooling.rs:1838— crates/harness/src/core/components/tooling.rs:1838-1843 | crates/harness/src/core/components/tooling.rs:1913-1918 | crates/harness/src/core/components/tooling.rs:2034-2039 — 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 (6 lines × 3) crates/temporal-runtime/src/gateway/service/mod.rs:3212— crates/temporal-runtime/src/gateway/service/mod.rs:3212-3217 | crates/temporal-runtime/src/gateway/service/mod.rs:3236-3241 | crates/temporal-runtime/src/gateway/service/mod.rs:3490-3495 — 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 (6 lines × 3) crates/bots/src/filter.rs:268— crates/bots/src/filter.rs:268-273 | crates/bots/src/poll.rs:332-337 | crates/bots/src/webhook.rs:288-293 — 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 (6 lines × 3) crates/store-fs/src/blob.rs:26— crates/store-fs/src/blob.rs:26-31 | crates/store-fs/src/session.rs:26-31 | crates/store-fs/src/vfs.rs:24-29 — 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 (6 lines × 3) crates/llm-clients/src/anthropic/messages.rs:1227— crates/llm-clients/src/anthropic/messages.rs:1227-1232 | crates/llm-clients/src/openai/audio.rs:276-281 | crates/llm-clients/src/openai/responses.rs:1225-1230 — before extracting anything, compare `crates/llm-clients/src/anthropic/messages.rs` and `crates/llm-clients/src/openai/responses.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 62 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 (6 lines × 3) crates/store-pg/src/environment.rs:779— crates/store-pg/src/environment.rs:779-784 | crates/store-pg/src/environment.rs:872-877 | crates/store-pg/src/environment.rs:886-891 — 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.
Focus outline removed inline platform/web/src/components/resize-handle.tsx:165— <div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline platform/web/src/components/session/composer-model-picker.tsx:73— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline platform/web/src/pages/EnvironmentsPage.tsx:949— <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline platform/web/src/pages/ProfilesPage.tsx:408— <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline platform/web/src/pages/WorkspacesPage.tsx:562— <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
PgStore::delete_closed_sessions_with_options (cognitive 21) crates/store-pg/src/session.rs:1855— PgStore::delete_closed_sessions_with_options has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 3, 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, 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.
PgStore::put_stream (cognitive 18) crates/store-pg/src/blob.rs:274— PgStore::put_stream has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1 (2 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.
PgStore::put_bot (cognitive 18) crates/store-pg/src/bots.rs:224— PgStore::put_bot has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 3 (7 pts), boolean chains 1, 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.
PgStore::put_bot_trigger (cognitive 18) crates/store-pg/src/bots.rs:498— PgStore::put_bot_trigger has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 4 (7 pts), boolean chains 1, loops 1 (nesting depth added 8). 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.
PgStore::resolve_segments (cognitive 18) crates/store-pg/src/session.rs:267— PgStore::resolve_segments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 1 (2 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.
Duplicated block (17 lines × 2) crates/cli/src/auth_cli.rs:1260— crates/cli/src/auth_cli.rs:1260-1276 | crates/cli/src/auth_cli.rs:1292-1308 — 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) crates/harness/src/storage/session.rs:699— crates/harness/src/storage/session.rs:699-715 | crates/store-fs/src/session.rs:209-225 — before extracting anything, compare `crates/harness/src/storage/session.rs` and `crates/store-fs/src/session.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 59 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 (17 lines × 2) crates/llm-clients/src/openai/completions.rs:98— crates/llm-clients/src/openai/completions.rs:98-114 | crates/llm-clients/src/openai/responses.rs:111-127 — before extracting anything, compare `crates/llm-clients/src/openai/completions.rs` and `crates/llm-clients/src/openai/responses.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 159 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 (17 lines × 2) crates/store-fs/src/blob.rs:137— crates/store-fs/src/blob.rs:137-153 | crates/store-pg/src/object.rs:153-169 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17 lines × 2) crates/store-fs/src/blob.rs:223— crates/store-fs/src/blob.rs:223-239 | crates/store-pg/src/shared.rs:10-26 — 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 (16 lines × 2) crates/llm-clients/src/openai/responses.rs:295— crates/llm-clients/src/openai/responses.rs:295-310 | crates/llm-clients/src/openai/responses.rs:458-473 — 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 (16 lines × 2) crates/temporal-runtime/src/gateway/http.rs:824— crates/temporal-runtime/src/gateway/http.rs:824-839 | crates/temporal-runtime/src/gateway/http.rs:879-894 — 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 (16 lines × 2) crates/tools/src/fs/local.rs:251— crates/tools/src/fs/local.rs:251-266 | crates/tools/src/fs/scoped_local.rs:410-425 — before extracting anything, compare `crates/tools/src/fs/local.rs` and `crates/tools/src/fs/scoped_local.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 128 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 lines × 2) crates/llm-runtime/src/params.rs:265— crates/llm-runtime/src/params.rs:265-280 | crates/llm-runtime/src/params.rs:329-344 — 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 (16 lines × 2) crates/test-support/src/runner/drive.rs:96— crates/test-support/src/runner/drive.rs:96-111 | crates/test-support/src/runner/drive.rs:535-550 — 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 × 3) crates/cli/src/mcp_cli.rs:731— crates/cli/src/mcp_cli.rs:731-740 | crates/cli/src/mcp_cli.rs:779-788 | crates/cli/src/vfs_cli.rs:456-465 — 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 (10 lines × 3) crates/harness/src/core/components/tooling.rs:921— crates/harness/src/core/components/tooling.rs:921-930 | crates/harness/src/core/components/tooling.rs:988-997 | crates/harness/src/core/components/tooling.rs:1028-1037 — 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 (10 lines × 3) crates/llm-runtime/src/openai_completions.rs:211— crates/llm-runtime/src/openai_completions.rs:211-220 | crates/llm-runtime/src/openai_completions.rs:270-279 | crates/llm-runtime/src/openai_responses.rs:197-206 — before extracting anything, compare `crates/llm-runtime/src/openai_completions.rs` and `crates/llm-runtime/src/openai_responses.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) crates/temporal-runtime/src/gateway/service/session_preparation.rs:80— crates/temporal-runtime/src/gateway/service/session_preparation.rs:80-91 | crates/temporal-runtime/src/gateway/service/session_preparation.rs:168-177 | crates/temporal-runtime/src/gateway/service/session_preparation.rs:247-256 — 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 (10 lines × 3) crates/store-pg/src/bots.rs:603— crates/store-pg/src/bots.rs:603-612 | crates/store-pg/src/bots.rs:660-669 | crates/store-pg/src/bots.rs:697-706 — 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.
Outbound HTTP without resilience crates/cli/src/api_client.rs:92— `reqwest::Client::builder(` 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 crates/environment-provider-incus/src/edge.rs:34— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience REDACTED:23— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience REDACTED:55— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience REDACTED:61— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
X2 · Cancellation propagation· Async function without AbortSignal · ×5
Async function without AbortSignal: providerRequest REDACTED:22— `providerRequest` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: admin REDACTED:60— `admin` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: api platform/cli/src/client.ts:12— `api` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: queryFn platform/web/src/auth.ts:31— `queryFn` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: sendSampleWebhook platform/web/src/components/bot/triggers.tsx:673— `sendSampleWebhook` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
SessionTools::invoke_workflow_tool_call (cognitive 31) crates/temporal-runtime/src/worker/session_tools.rs:569— SessionTools::invoke_workflow_tool_call has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (25 pts), match/switch 4 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionTools::invoke_batch (cognitive 28) crates/temporal-runtime/src/worker/session_tools.rs:1698— SessionTools::invoke_batch has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 9, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SessionTools::invoke_environment_control_call (cognitive 27) crates/temporal-runtime/src/worker/session_tools.rs:974— SessionTools::invoke_environment_control_call has cognitive complexity 27 (threshold 15). Drivers by points: match/switch 7 (15 pts), if/else 6 (10 pts), loops 1 (2 pts) (nesting depth added 13). 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.
SessionTools::read_environment_jobs (cognitive 25) crates/temporal-runtime/src/worker/session_tools.rs:438— SessionTools::read_environment_jobs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 5 (11 pts), 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.
Duplicated block (9 lines × 3) crates/environments/src/memory.rs:247— crates/environments/src/memory.rs:247-255 | crates/environments/src/memory.rs:320-328 | crates/environments/src/memory.rs:378-386 — 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) crates/harness/src/core/components/context.rs:2040— crates/harness/src/core/components/context.rs:2040-2048 | crates/temporal-runtime/src/gateway/service/mod.rs:474-482 | crates/tools/src/prompts/assembler.rs:700-708 — 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 (9 lines × 3) crates/llm-clients/src/openai/audio.rs:75— crates/llm-clients/src/openai/audio.rs:75-83 | crates/llm-clients/src/openai/completions.rs:75-83 | crates/llm-clients/src/openai/responses.rs:82-90 — before extracting anything, compare `crates/llm-clients/src/openai/audio.rs` and `crates/llm-clients/src/openai/completions.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 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 (9 lines × 3) crates/store-pg/src/bots.rs:338— crates/store-pg/src/bots.rs:338-351 | crates/store-pg/src/bots.rs:615-623 | crates/store-pg/src/bots.rs:632-640 — 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) crates/store-pg/src/environment.rs:313— crates/store-pg/src/environment.rs:313-319 | crates/store-pg/src/environment.rs:420-426 | crates/store-pg/src/environment.rs:540-546 — 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) crates/temporal-runtime/src/worker/activities/state.rs:567— crates/temporal-runtime/src/worker/activities/state.rs:567-573 | crates/temporal-runtime/src/worker/activities/state.rs:579-585 | crates/temporal-runtime/src/worker/activities/state.rs:595-601 — 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) crates/store-pg/src/bots.rs:301— crates/store-pg/src/bots.rs:301-307 | crates/store-pg/src/bots.rs:423-429 | crates/store-pg/src/bots.rs:443-450 — 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) crates/temporal-runtime/src/gateway/http.rs:801— crates/temporal-runtime/src/gateway/http.rs:801-807 | crates/temporal-runtime/src/gateway/http.rs:856-862 | crates/temporal-runtime/src/gateway/registration.rs:483-489 — 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.
P12 · CI test-gate honesty· Workspace package's tests never run by CI · ×4
Workspace package's tests never run by CI platform/backend/package.json:8— `platform/backend` is a workspace package with 189 test(s) in 26 file(s) (e.g. `platform/backend/src/universe-slugs.test.ts`, `platform/backend/src/subscriptions.test.ts`), but no CI command runs them — no step names the package and no workspace-wide command reaches it, so its tests gate nothing. Run its tests in CI, or delete them.
Workspace package's tests never run by CI platform/configurator-mcp/package.json:26— `platform/configurator-mcp` is a workspace package with 20 test(s) in 4 file(s) (e.g. `platform/configurator-mcp/test/tool-result.test.ts`, `platform/configurator-mcp/test/request-auth.test.ts`), but no CI command runs them — no step names the package and no workspace-wide command reaches it, so its tests gate nothing. Run its tests in CI, or delete them.
Workspace package's tests never run by CI platform/connectors/package.json:10— `platform/connectors` is a workspace package with 63 test(s) in 18 file(s) (e.g. `platform/connectors/test/whatsapp-registry.test.ts`, `platform/connectors/test/whatsapp-media.test.ts`), but no CI command runs them — no step names the package and no workspace-wide command reaches it, so its tests gate nothing. Run its tests in CI, or delete them.
Workspace package's tests never run by CI platform/web/package.json:10— `platform/web` is a workspace package with 645 test(s) in 103 file(s) (e.g. `platform/web/src/App.test.tsx`, `platform/web/src/pages/WorkspacesPage.blob-view.test.tsx`), but no CI command runs them — no step names the package and no workspace-wide command reaches it, so its tests gate nothing. Run its tests in CI, or delete them.
R10 · Code Duplication· Duplicated block with local edits (18 matched lines × 2 locations) · ×4
Duplicated block with local edits (18 matched lines × 2 locations) platform/configurator-mcp/src/upstream-client.ts:74— platform/configurator-mcp/src/upstream-client.ts:74 · platform/connectors/src/providers/telegram/media.ts:136 — the two spans are one implementation copied and then locally edited — 92 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (18 matched lines × 2 locations) platform/web/src/components/bot/chat.tsx:21— platform/web/src/components/bot/chat.tsx:21 · platform/web/src/components/bot/detail.tsx:130 — the two spans are one implementation copied and then locally edited — 69 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (18 matched lines × 2 locations) platform/web/src/components/bot/send-event-dialog.tsx:51— platform/web/src/components/bot/send-event-dialog.tsx:51 · platform/web/src/pages/MembersPage.tsx:285 — the two spans are one implementation copied and then locally edited — 90 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (18 matched lines × 2 locations) platform/web/src/pages/GeneralSettingsPage.tsx:254— platform/web/src/pages/GeneralSettingsPage.tsx:254 · platform/web/src/pages/ProfilesPage.tsx:371 — the two spans are one implementation copied and then locally edited — 80 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
cli::connection::handle (cyclomatic 27) crates/cli/src/connection.rs:501— cli::connection::handle has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cli::chat::driver::print_event (cyclomatic 19) crates/cli/src/chat/driver.rs:2119— cli::chat::driver::print_event has cyclomatic complexity 19 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: ChatSessionDriver::chat_events_from_session_event (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
cli::chat::tui::app::spawn_driver_task (cyclomatic 16) crates/cli/src/chat/tui/app.rs:109— cli::chat::tui::app::spawn_driver_task has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ChatTuiApp::apply_slash_command (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
temporal_workflow::workflows::session::code_tools::run_dispatch_loop (cyclomatic 26) crates/temporal-workflow/src/workflows/session/code_tools.rs:773— temporal_workflow::workflows::session::code_tools::run_dispatch_loop has cyclomatic complexity 26 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
temporal_workflow::workflows::session::admissions::admit_admissions (cyclomatic 17) crates/temporal-workflow/src/workflows/session/admissions.rs:7— temporal_workflow::workflows::session::admissions::admit_admissions has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
temporal_workflow::workflows::session::drive::drive_until_idle (cyclomatic 17) crates/temporal-workflow/src/workflows/session/drive.rs:116— temporal_workflow::workflows::session::drive::drive_until_idle has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SessionTools::invoke_batch (cyclomatic 24) crates/temporal-runtime/src/worker/session_tools.rs:1698— SessionTools::invoke_batch has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
SessionTools::invoke_workflow_tool_call (cyclomatic 19) crates/temporal-runtime/src/worker/session_tools.rs:569— SessionTools::invoke_workflow_tool_call has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SessionTools::invoke_environment_control_call (cyclomatic 19) crates/temporal-runtime/src/worker/session_tools.rs:974— SessionTools::invoke_environment_control_call has cyclomatic complexity 19 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
bots::validate::validate_poll_source (cognitive 41) crates/bots/src/validate.rs:247— bots::validate::validate_poll_source has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (28 pts), boolean chains 8, loops 2 (4 pts), match/switch 1 (nesting depth added 19). 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.
bots::validate::validate_trigger_document (cognitive 32) crates/bots/src/validate.rs:336— bots::validate::validate_trigger_document has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 5, match/switch 3 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bots::render::render_node (cognitive 29) crates/bots/src/render.rs:154— bots::render::render_node has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (4 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JobManager::spawn_and_wait (cognitive 33) crates/environment-daemon/src/jobs.rs:657— JobManager::spawn_and_wait has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (21 pts), loops 4 (5 pts), match/switch 2 (4 pts), boolean chains 3 (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.
JobManager::schedule_ready_jobs (cognitive 31) crates/environment-daemon/src/jobs.rs:435— JobManager::schedule_ready_jobs has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JobManager::cancel_jobs (cognitive 18) crates/environment-daemon/src/jobs.rs:322— JobManager::cancel_jobs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2, match/switch 1 (2 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.
Duplicated block (35 lines × 2) crates/llm-runtime/src/anthropic_messages.rs:1276— crates/llm-runtime/src/anthropic_messages.rs:1276-1310 | crates/llm-runtime/src/openai_responses.rs:877-911 — before extracting anything, compare `crates/llm-runtime/src/anthropic_messages.rs` and `crates/llm-runtime/src/openai_responses.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 113 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 (35 lines × 2) crates/llm-runtime/src/anthropic_messages.rs:1477— crates/llm-runtime/src/anthropic_messages.rs:1477-1511 | crates/llm-runtime/src/openai_completions.rs:1196-1230 — before extracting anything, compare `crates/llm-runtime/src/anthropic_messages.rs` and `crates/llm-runtime/src/openai_completions.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 76 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 (35 lines × 2) crates/temporal-runtime/src/worker/activities/common.rs:110— crates/temporal-runtime/src/worker/activities/common.rs:110-144 | crates/test-support/src/runner/drive.rs:714-748 — before extracting anything, compare `crates/temporal-runtime/src/worker/activities/common.rs` and `crates/test-support/src/runner/drive.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 93 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 (19 lines × 2) crates/harness/src/storage/session.rs:980— crates/harness/src/storage/session.rs:980-998 | crates/harness/src/storage/session.rs:1031-1049 — 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 (19 lines × 2) crates/temporal-runtime/src/worker/activities/common.rs:151— crates/temporal-runtime/src/worker/activities/common.rs:151-169 | crates/test-support/src/runner/drive.rs:755-773 — before extracting anything, compare `crates/temporal-runtime/src/worker/activities/common.rs` and `crates/test-support/src/runner/drive.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 93 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 (19 lines × 2) crates/cli/src/chat/tui/app.rs:620— crates/cli/src/chat/tui/app.rs:620-638 | crates/cli/src/chat/tui/bottom_pane/mod.rs:468-486 — 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 × 4) crates/cli/src/auth_cli.rs:730— crates/cli/src/auth_cli.rs:730-740 | crates/cli/src/auth_cli.rs:773-783 | crates/cli/src/auth_cli.rs:790-800 | crates/cli/src/auth_cli.rs:1356-1366 — 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 lines × 4) crates/cli/src/auth_cli.rs:1092— crates/cli/src/auth_cli.rs:1092-1102 | crates/cli/src/auth_cli.rs:1116-1126 | crates/cli/src/auth_cli.rs:1217-1227 | crates/cli/src/auth_cli.rs:1279-1289 — 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 lines × 4) crates/llm-clients/src/anthropic/messages.rs:1249— crates/llm-clients/src/anthropic/messages.rs:1249-1259 | crates/llm-clients/src/openai/audio.rs:302-312 | crates/llm-clients/src/openai/completions.rs:837-847 | crates/llm-clients/src/openai/responses.rs:1251-1261 — before extracting anything, compare `crates/llm-clients/src/anthropic/messages.rs` and `crates/llm-clients/src/openai/completions.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 51 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 (8–9 lines × 2) crates/bots/src/views.rs:281— crates/bots/src/views.rs:281-289 | crates/bots/src/views.rs:310-317 — 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–9 lines × 2) crates/temporal-runtime/src/gateway/service/workflow.rs:148— crates/temporal-runtime/src/gateway/service/workflow.rs:148-155 | crates/temporal-runtime/src/gateway/service/workflow.rs:213-221 — 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–9 lines × 2) crates/temporal-runtime/src/worker/activities/state.rs:291— crates/temporal-runtime/src/worker/activities/state.rs:291-298 | crates/temporal-runtime/src/worker/activities/state.rs: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.
P6 · Release Hygiene· Release pipeline publishes an empty version · ×3
Release pipeline publishes an empty version .github/workflows/release-tag.yml:63— `.github/workflows/release-tag.yml:63` writes `version=$LIGHTSPEED_PRODUCT_VERSION` to `$GITHUB_OUTPUT`, but `$LIGHTSPEED_PRODUCT_VERSION` is assigned nowhere in that `run:` block, and nowhere else in the workflow. The block runs under `set -u`, so the step ABORTS instead of publishing — the release never reaches the publisher.
Release pipeline publishes an empty version REDACTED:59— `REDACTED:59` writes `version=$LIGHTSPEED_PRODUCT_VERSION` to `$GITHUB_OUTPUT`, but `$LIGHTSPEED_PRODUCT_VERSION` is assigned nowhere in that `run:` block, and nowhere else in the workflow. The block runs under `set -u`, so the step ABORTS instead of publishing — the release never reaches the publisher.
Release pipeline publishes an empty version REDACTED:60— `REDACTED:60` writes `rust_version=$LIGHTSPEED_RELEASE_RUST_VERSION` to `$GITHUB_OUTPUT`, but `$LIGHTSPEED_RELEASE_RUST_VERSION` is assigned nowhere in that `run:` block, and nowhere else in the workflow. The block runs under `set -u`, so the step ABORTS instead of publishing — the release never reaches the publisher.
R10 · Code Duplication· Duplicated block with local edits (17 matched lines × 2 locations) · ×3
Duplicated block with local edits (17 matched lines × 2 locations) platform/web/src/components/bot/setup.tsx:1050— platform/web/src/components/bot/setup.tsx:1050 · platform/web/src/pages/EnvironmentsPage.tsx:1159 — the two spans are one implementation copied and then locally edited — 102 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (17 matched lines × 2 locations) platform/web/src/pages/ChannelsPage.tsx:269— platform/web/src/pages/ChannelsPage.tsx:269 · platform/web/src/pages/GeneralSettingsPage.tsx:254 — the two spans are one implementation copied and then locally edited — 71 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (17 matched lines × 2 locations) platform/web/src/pages/EnvironmentsPage.tsx:1277— platform/web/src/pages/EnvironmentsPage.tsx:1277 · platform/web/src/pages/EnvironmentsPage.tsx:1423 — the two spans are one implementation copied and then locally edited — 106 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
AC2 · Forms & labels· <Textarea> field component without a label · ×2
<Textarea> field component without a label platform/web/src/components/bot/setup.tsx:345— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Textarea> field component without a label platform/web/src/components/models/model-api-key.tsx:538— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
environment_daemon::filesystem::scan::scan (cyclomatic 59) crates/environment-daemon/src/filesystem/scan.rs:17— environment_daemon::filesystem::scan::scan has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
environment_daemon::registration::control_session (cyclomatic 19) crates/environment-daemon/src/registration.rs:101— environment_daemon::registration::control_session has cyclomatic complexity 19 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
bots::validate::validate_trigger_document (cyclomatic 25) crates/bots/src/validate.rs:336— bots::validate::validate_trigger_document has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
bots::validate::validate_poll_source (cyclomatic 23) crates/bots/src/validate.rs:247— bots::validate::validate_poll_source has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
llm_runtime::compaction::compact (cyclomatic 22) crates/llm-runtime/src/compaction.rs:77— llm_runtime::compaction::compact has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
llm_runtime::openai_completions::materialize_message (cyclomatic 18) crates/llm-runtime/src/openai_completions.rs:633— llm_runtime::openai_completions::materialize_message has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Operation::execute (cognitive 144) crates/environment-daemon/src/filesystem/transfer/session.rs:731— Operation::execute has cognitive complexity 144 (threshold 15). Drivers by points: if/else 51 (115 pts), boolean chains 20, match/switch 3 (7 pts), loops 1 (2 pts) (nesting depth added 69). 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.
Operation::advance_staging (cognitive 45) crates/environment-daemon/src/filesystem/transfer/session.rs:1135— Operation::advance_staging has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (38 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 28). 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.
TransferManager::execute (cognitive 75) crates/environment-daemon/src/filesystem/transfer/session.rs:411— TransferManager::execute has cognitive complexity 75 (threshold 15). Drivers by points: if/else 31 (58 pts), boolean chains 12, loops 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 30). 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.
TransferManager::cleanup_expired (cognitive 23) crates/environment-daemon/src/filesystem/transfer/session.rs:335— TransferManager::cleanup_expired has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (18 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TranscriptState::apply_chat_event (cognitive 32) crates/cli/src/chat/tui/transcript.rs:62— TranscriptState::apply_chat_event has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (23 pts), match/switch 4 (7 pts), loops 1 (2 pts) (nesting depth added 17). 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.
TranscriptState::apply_delta (cognitive 21) crates/cli/src/chat/tui/transcript.rs:327— TranscriptState::apply_delta has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 11). 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.
CoreAgentProjector::project_event_kind (cognitive 31) crates/api-projection/src/lib.rs:670— CoreAgentProjector::project_event_kind has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 15 (31 pts) (nesting depth added 16). 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.
CoreAgentProjector::project_tool_batches_for_run (cognitive 21) crates/api-projection/src/lib.rs:1211— CoreAgentProjector::project_tool_batches_for_run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (5 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProcessManager::read_process (cognitive 29) crates/environment-daemon/src/process.rs:521— ProcessManager::read_process has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (20 pts), match/switch 2 (6 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProcessManager::write_process (cognitive 16) crates/environment-daemon/src/process.rs:591— ProcessManager::write_process has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), match/switch 1 (2 pts), boolean chains 1 (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.
environment_provider_incus::edge::proxy_websocket (cognitive 28) crates/environment-provider-incus/src/edge.rs:146— environment_provider_incus::edge::proxy_websocket has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 5 (16 pts), if/else 3 (9 pts), boolean chains 2, loops 1 (nesting depth added 17). 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.
environment_provider_incus::relay::proxy_with_idle (cognitive 21) crates/environment-provider-incus/src/relay.rs:52— environment_provider_incus::relay::proxy_with_idle has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 2 (4 pts), boolean chains 2, 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.
eval::run_cli (cognitive 19) crates/eval/src/main.rs:366— eval::run_cli has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 10). 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.
eval::collect_observations (cognitive 18) crates/eval/src/main.rs:970— eval::collect_observations has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 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.
SubagentService::linked_attachments (cognitive 18) crates/temporal-runtime/src/subagents.rs:431— SubagentService::linked_attachments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (5 pts) (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.
SubagentService::prepare (cognitive 17) crates/temporal-runtime/src/subagents.rs:206— SubagentService::prepare has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), match/switch 4, boolean chains 1 (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.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×2
Change coupling: schema_export.rs ↔ mod.rs crates/api/src/schema_export.rs:1— `crates/api/src/schema_export.rs` and `crates/temporal-runtime/src/gateway/service/mod.rs` 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) 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 6 shared commits counted here, the most recent 3 are `96f53174` updat mcp (at that commit the file was still `crates/temporal-server/src/gateway/service/mod.rs`); `9632333e` job tests (at that commit the file was still `crates/temporal-server/src/gateway/service/mod.rs`); `43e0c9bf` profiles cli (at that commit the file was still `crates/temporal-server/src/gateway/service/mod.rs`) — run `git show` on any of them.
Change coupling: main.rs ↔ drive.rs crates/eval/src/main.rs:1— `crates/eval/src/main.rs` and `crates/harness/src/core/drive.rs` 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 `48b0e890` tools config (at that commit the file was still `crates/engine/src/core/drive.rs`); `c93c566c` manual compaction (at that commit the file was still `crates/engine/src/core/drive.rs`); `e6bde85d` compaction oai inital (at that commit the file was still `crates/engine/src/core/drive.rs`) — run `git show` on any of them.
Duplicated block (25 lines × 2) crates/environment-protocol/src/shared.rs:408— crates/environment-protocol/src/shared.rs:408-432 | crates/tools/src/fs/path.rs:235-259 — 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 (25 lines × 2) crates/store-pg/src/profile.rs:22— crates/store-pg/src/profile.rs:22-50 | crates/store-pg/src/profile.rs:226-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 (18–19 lines × 2) crates/temporal-runtime/src/gateway/service/mod.rs:3263— crates/temporal-runtime/src/gateway/service/mod.rs:3263-3281 | crates/temporal-runtime/src/gateway/service/mod.rs:3533-3550 — 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 (18–19 lines × 2) crates/temporal-runtime/src/worker/activities/environment_jobs.rs:405— crates/temporal-runtime/src/worker/activities/environment_jobs.rs:405-422 | crates/temporal-runtime/src/worker/activities/environment_jobs.rs:503-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 (18 lines × 2) crates/environments/src/memory.rs:389— crates/environments/src/memory.rs:389-406 | crates/environments/src/memory.rs:483-500 — 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 (18 lines × 2) crates/temporal-runtime/src/worker/activities/state.rs:324— crates/temporal-runtime/src/worker/activities/state.rs:324-341 | crates/temporal-runtime/src/worker/activities/state.rs:381-398 — 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–15 lines × 2) crates/temporal-runtime/src/gateway/service/environments.rs:43— crates/temporal-runtime/src/gateway/service/environments.rs:43-55 | crates/temporal-runtime/src/gateway/service/workflow.rs:314-328 — 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–15 lines × 2) crates/temporal-runtime/src/gateway/service/mod.rs:4666— crates/temporal-runtime/src/gateway/service/mod.rs:4666-4678 | crates/temporal-runtime/src/gateway/service/mod.rs:4689-4703 — 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 × 3) crates/cli/src/mcp_cli.rs:703— crates/cli/src/mcp_cli.rs:703-714 | crates/cli/src/mcp_cli.rs:746-757 | crates/cli/src/vfs_cli.rs:429-440 — 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 (12 lines × 3) crates/llm-clients/src/anthropic/messages.rs:1155— crates/llm-clients/src/anthropic/messages.rs:1155-1166 | crates/llm-clients/src/openai/completions.rs:732-743 | crates/llm-clients/src/openai/responses.rs:1131-1142 — before extracting anything, compare `crates/llm-clients/src/anthropic/messages.rs` and `crates/llm-clients/src/openai/completions.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 51 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 (11–12 lines × 2) crates/api/src/bin/export-schema.rs:15— crates/api/src/bin/export-schema.rs:15-26 | crates/temporal-workflow/src/bin/export-workflow-contract.rs:16-26 — 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–12 lines × 2) crates/cli/src/chat/tui/custom_terminal.rs:129— crates/cli/src/chat/tui/custom_terminal.rs:129-140 | crates/cli/src/chat/tui/custom_terminal.rs:176-186 — 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 × 3) crates/llm-clients/src/openai/audio.rs:122— crates/llm-clients/src/openai/audio.rs:122-132 | crates/llm-clients/src/openai/completions.rs:127-137 | crates/llm-clients/src/openai/responses.rs:145-155 — before extracting anything, compare `crates/llm-clients/src/openai/audio.rs` and `crates/llm-clients/src/openai/completions.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 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 (11 lines × 3) crates/llm-runtime/src/anthropic_messages.rs:1380— crates/llm-runtime/src/anthropic_messages.rs:1380-1390 | crates/llm-runtime/src/openai_completions.rs:1446-1456 | crates/llm-runtime/src/openai_responses.rs:972-982 — before extracting anything, compare `crates/llm-runtime/src/anthropic_messages.rs` and `crates/llm-runtime/src/openai_completions.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 76 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 (7 lines × 4) crates/temporal-runtime/src/gateway/service/mod.rs:2279— crates/temporal-runtime/src/gateway/service/mod.rs:2279-2285 | crates/temporal-runtime/src/gateway/service/mod.rs:2588-2594 | crates/temporal-runtime/src/gateway/service/mod.rs:2729-2735 | crates/temporal-runtime/src/gateway/service/mod.rs:3797-3803 — 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 (7 lines × 4) crates/store-pg/src/environment.rs:322— crates/store-pg/src/environment.rs:322-328 | crates/store-pg/src/environment.rs:429-435 | crates/store-pg/src/environment.rs:549-555 | crates/store-pg/src/environment.rs:625-631 — 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–7 lines × 2) crates/cli/src/chat/tui/cell.rs:661— crates/cli/src/chat/tui/cell.rs:661-667 | crates/cli/src/chat/tui/cell.rs:674-679 — 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–7 lines × 2) crates/temporal-runtime/src/gateway/service/mod.rs:2286— crates/temporal-runtime/src/gateway/service/mod.rs:2286-2292 | crates/temporal-runtime/src/gateway/service/skills.rs:33-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 3) crates/tools/src/environment/jobs.rs:456— crates/tools/src/environment/jobs.rs:456-460 | crates/tools/src/environment_protocol/remote.rs:677-681 | crates/tools/src/environment_protocol/remote.rs:683-687 — 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 (5 lines × 3) crates/llm-clients/src/anthropic/messages.rs:311— crates/llm-clients/src/anthropic/messages.rs:311-318 | crates/llm-clients/src/anthropic/messages.rs:353-360 | crates/llm-clients/src/openai/completions.rs:241-245 — before extracting anything, compare `crates/llm-clients/src/anthropic/messages.rs` and `crates/llm-clients/src/openai/completions.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 51 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 (31 lines × 2 locations) platform/backend/src/routes/gateway.ts:1359— platform/backend/src/routes/gateway.ts:1359 · platform/backend/src/routes/gateway.ts:1403 — 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 (31 lines × 2 locations) platform/web/src/components/ui/field.tsx:10— platform/web/src/components/ui/field.tsx:10 · platform/web/src/components/ui/message.tsx:5 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (20 lines × 2 locations) platform/connectors/src/providers/telegram/media.ts:86— platform/connectors/src/providers/telegram/media.ts:86 · REDACTED:157 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (20 lines × 2 locations) platform/web/src/pages/ProfilesPage.tsx:98— platform/web/src/pages/ProfilesPage.tsx:98 · platform/web/src/pages/SessionsPage.tsx:184 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (18 lines × 2 locations) platform/web/src/components/icons/bot.tsx:8— platform/web/src/components/icons/bot.tsx:8 · platform/web/src/components/icons/bot.tsx:40 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
Duplicated block (18 lines × 2 locations) platform/web/src/pages/ProfilesPage.tsx:124— platform/web/src/pages/ProfilesPage.tsx:124 · platform/web/src/pages/WorkspacesPage.tsx:200 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
X24 · Document value interpolated into markup unescaped· Untrusted text written into markup unescaped · ×2
Untrusted text written into markup unescaped platform/connectors/src/presentation/telegram.ts:21— `classAttr` is text this program did not author, and it is written into an unquoted attribute through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. HTML text encoding does not help in an unquoted attribute — whitespace ends it; quote the attribute and encode the value.
Untrusted text written into markup unescaped platform/connectors/src/presentation/telegram.ts:64— `escapeHtml(token.href)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path.
AC2 · Forms & labels· <fieldset> without a <legend> · ×1
<fieldset> without a <legend> platform/web/src/components/models/model-defaults.tsx:117— A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
AC2 · Forms & labels· <Combobox> field component without a label · ×1
<Combobox> field component without a label platform/web/src/components/session/session-config-editor.tsx:1761— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 132 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
gateway.gatewayRoutes (cyclomatic 237) platform/backend/src/routes/gateway.ts:383— gateway.gatewayRoutes has cyclomatic complexity 237 (threshold 15). Most of this is not in the body itself: 1 of the 237 points is its own statement and the rest belongs to 107 function literals inside it that branch (lines 560, 1357, 1402, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
workspace-transfers.WorkspaceTransfers (cyclomatic 178) platform/web/src/components/workspace-transfers.tsx:93— workspace-transfers.WorkspaceTransfers has cyclomatic complexity 178 (threshold 15). Of this number, 53 points are the body's own statements and 125 belong to 39 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SessionsPage.SessionDetail (cyclomatic 168) platform/web/src/pages/SessionsPage.tsx:1303— SessionsPage.SessionDetail has cyclomatic complexity 168 (threshold 15). Of this number, 90 points are the body's own statements and 78 belong to 39 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
composer.SessionComposer (cyclomatic 110) platform/web/src/components/session/composer.tsx:51— composer.SessionComposer has cyclomatic complexity 110 (threshold 15). Of this number, 56 points are the body's own statements and 54 belong to 16 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpServersPage.ServerDialog (cyclomatic 94) platform/web/src/pages/McpServersPage.tsx:359— McpServersPage.ServerDialog has cyclomatic complexity 94 (threshold 15). Of this number, 57 points are the body's own statements and 37 belong to 11 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BotCreatePage.Wizard (cyclomatic 91) platform/web/src/pages/BotCreatePage.tsx:142— BotCreatePage.Wizard has cyclomatic complexity 91 (threshold 15). Of this number, 56 points are the body's own statements and 35 belong to 9 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
auth.createAuth.handler (cyclomatic 82) platform/backend/src/auth.ts:119— auth.createAuth.handler has cyclomatic complexity 82 (threshold 15). Most of this is not in the body itself: 1 of the 82 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 119, 180). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Operation::execute (cyclomatic 79) crates/environment-daemon/src/filesystem/transfer/session.rs:731— Operation::execute has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
universes.universeRoutes (cyclomatic 73) platform/backend/src/routes/universes.ts:140— universes.universeRoutes has cyclomatic complexity 73 (threshold 15). Most of this is not in the body itself: 1 of the 73 points is its own statement and the rest belongs to 30 function literals inside it that branch (lines 250, 524, 569, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SessionsPage.SessionList (cyclomatic 68) platform/web/src/pages/SessionsPage.tsx:195— SessionsPage.SessionList has cyclomatic complexity 68 (threshold 15). Of this number, 39 points are the body's own statements and 29 belong to 17 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
session-config-editor.configError (cyclomatic 67) platform/web/src/components/session/session-config-editor.tsx:412— session-config-editor.configError has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
session-settings-sheet.LiveSessionSetup (cyclomatic 67) platform/web/src/components/session/session-settings-sheet.tsx:94— session-settings-sheet.LiveSessionSetup has cyclomatic complexity 67 (threshold 15). Of this number, 44 points are the body's own statements and 23 belong to 8 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
session-config-editor.normalizeSessionConfig (cyclomatic 63) platform/web/src/components/session/session-config-editor.tsx:253— session-config-editor.normalizeSessionConfig has cyclomatic complexity 63 (threshold 15). Of this number, 55 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SessionsPage.NewSessionDialog (cyclomatic 62) platform/web/src/pages/SessionsPage.tsx:921— SessionsPage.NewSessionDialog has cyclomatic complexity 62 (threshold 15). Of this number, 43 points are the body's own statements and 19 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CoreAgentProjector::project_event_kind (cyclomatic 57) crates/api-projection/src/lib.rs:670— CoreAgentProjector::project_event_kind has cyclomatic complexity 57 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
session-resources.SessionResourceChips (cyclomatic 53) platform/web/src/components/session/session-resources.tsx:70— session-resources.SessionResourceChips has cyclomatic complexity 53 (threshold 15). Of this number, 46 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
transcript.applyEvents (cyclomatic 53) platform/web/src/lib/sessions/transcript.ts:257— transcript.applyEvents has cyclomatic complexity 53 (threshold 15). Of this number, 49 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WorkspacesPage.FileDetail (cyclomatic 53) platform/web/src/pages/WorkspacesPage.tsx:303— WorkspacesPage.FileDetail has cyclomatic complexity 53 (threshold 15). Of this number, 27 points are the body's own statements and 26 belong to 8 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
api_projection::tool_call_display (cyclomatic 49) crates/api-projection/src/lib.rs:2973— api_projection::tool_call_display has cyclomatic complexity 49 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
AdminUsersPage.EditUserDialog (cyclomatic 46) platform/web/src/pages/AdminUsersPage.tsx:139— AdminUsersPage.EditUserDialog has cyclomatic complexity 46 (threshold 15). Of this number, 23 points are the body's own statements and 23 belong to 7 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
setup.OtherBotsSection (cyclomatic 45) platform/web/src/components/bot/setup.tsx:791— setup.OtherBotsSection has cyclomatic complexity 45 (threshold 15). Of this number, 34 points are the body's own statements and 11 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TransferManager::execute (cyclomatic 44) crates/environment-daemon/src/filesystem/transfer/session.rs:411— TransferManager::execute has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tool-picker.ToolPicker (cyclomatic 44) platform/web/src/components/mcp/tool-picker.tsx:48— tool-picker.ToolPicker has cyclomatic complexity 44 (threshold 15). Of this number, 31 points are the body's own statements and 13 belong to 6 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
transcript.applyNonToolCallItem (cyclomatic 41) platform/web/src/lib/sessions/transcript.ts:735— transcript.applyNonToolCallItem has cyclomatic complexity 41 (threshold 15). Of this number, 39 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
auth.createAuth (cyclomatic 40) platform/backend/src/auth.ts:38— auth.createAuth has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 8 of the 40 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 76, 61, 85, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
tail.useSessionTail (cyclomatic 40) platform/web/src/lib/sessions/tail.ts:38— tail.useSessionTail has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 2 of the 40 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 96, 71, 46, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
deleted-sessions.DeletedSessionsContent (cyclomatic 39) platform/web/src/components/admin/deleted-sessions.tsx:18— deleted-sessions.DeletedSessionsContent has cyclomatic complexity 39 (threshold 15). Of this number, 22 points are the body's own statements and 17 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
setup.SessionProfileSection (cyclomatic 39) platform/web/src/components/bot/setup.tsx:380— setup.SessionProfileSection has cyclomatic complexity 39 (threshold 15). Of this number, 25 points are the body's own statements and 14 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
bots.botRoutes (cyclomatic 36) platform/backend/src/routes/bots.ts:31— bots.botRoutes has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 1 of the 36 points is its own statement and the rest belongs to 17 function literals inside it that branch (lines 74, 182, 218, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ProfilesPage.ProfileEditor (cyclomatic 35) platform/web/src/pages/ProfilesPage.tsx:192— ProfilesPage.ProfileEditor has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 13 of the 35 points are its own statements and the rest belongs to 8 function items inside it that branch (submit, switchTab, a function literal at line 244, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
codemode::engine::run_context (cyclomatic 33) crates/codemode/src/engine.rs:235— codemode::engine::run_context has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
resize-handle.ResizeHandle (cyclomatic 33) platform/web/src/components/resize-handle.tsx:82— resize-handle.ResizeHandle has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 6 of the 33 points are its own statements and the rest belongs to 8 function items inside it that branch (key, a function literal at line 101, a function literal at line 179, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
run-sections.sectionsByRun (cyclomatic 33) platform/web/src/lib/sessions/run-sections.ts:74— run-sections.sectionsByRun has cyclomatic complexity 33 (threshold 15). Of this number, 21 points are the body's own statements and 12 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EnvironmentsPage.EnvironmentCard (cyclomatic 33) platform/web/src/pages/EnvironmentsPage.tsx:293— EnvironmentsPage.EnvironmentCard has cyclomatic complexity 33 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
LoginPage.LoginPage (cyclomatic 33) platform/web/src/pages/LoginPage.tsx:15— LoginPage.LoginPage has cyclomatic complexity 33 (threshold 15). Of this number, 17 points are the body's own statements and 16 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
TranscriptState::apply_chat_event (cyclomatic 32) crates/cli/src/chat/tui/transcript.rs:62— TranscriptState::apply_chat_event has cyclomatic complexity 32 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
triggers.TriggersSection (cyclomatic 32) platform/web/src/components/bot/triggers.tsx:748— triggers.TriggersSection has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 15 of the 32 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 852, 877). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
add-model-provider-dialog.AddModelProviderDialog (cyclomatic 32) platform/web/src/components/models/add-model-provider-dialog.tsx:28— add-model-provider-dialog.AddModelProviderDialog has cyclomatic complexity 32 (threshold 15). Of this number, 29 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
composer-model-picker.ModelPicker (cyclomatic 32) platform/web/src/components/session/composer-model-picker.tsx:16— composer-model-picker.ModelPicker has cyclomatic complexity 32 (threshold 15). Of this number, 17 points are the body's own statements and 15 belong to 6 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
transcript.applyItems (cyclomatic 32) platform/web/src/lib/sessions/transcript.ts:642— transcript.applyItems has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
stack.createPlan (cyclomatic 32) REDACTED:190— stack.createPlan has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
(anonymous).outputHelper (cyclomatic 32) crates/codemode/src/prelude.js:99— (anonymous).outputHelper has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 1 of the 32 points is its own statement and the rest belongs to one function literal inside it that branches (line 100). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
env.loadOidc (cyclomatic 31) platform/backend/src/env.ts:110— env.loadOidc has cyclomatic complexity 31 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EnvironmentsPage.ProviderList (cyclomatic 31) platform/web/src/pages/EnvironmentsPage.tsx:92— EnvironmentsPage.ProviderList has cyclomatic complexity 31 (threshold 15). Of this number, 23 points are the body's own statements and 8 belong to 7 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
session-resources.sessionResources (cyclomatic 30) platform/web/src/lib/sessions/session-resources.ts:72— session-resources.sessionResources has cyclomatic complexity 30 (threshold 15). Of this number, 15 points are the body's own statements and 15 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
McpServersPage.OAuthDialog (cyclomatic 30) platform/web/src/pages/McpServersPage.tsx:1082— McpServersPage.OAuthDialog has cyclomatic complexity 30 (threshold 15). Of this number, 24 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
activity.BotActivity (cyclomatic 29) platform/web/src/components/bot/activity.tsx:65— activity.BotActivity has cyclomatic complexity 29 (threshold 15). Of this number, 22 points are the body's own statements and 7 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
session-config-editor.ModelFields (cyclomatic 29) platform/web/src/components/session/session-config-editor.tsx:837— session-config-editor.ModelFields has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 13 of the 29 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 931, 968, 850, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Scanner::advance (cyclomatic 28) crates/environment-daemon/src/filesystem/transfer/session.rs:102— Scanner::advance has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
connector.createWhatsAppConnector.run (cyclomatic 28) platform/connectors/src/providers/whatsapp/connector.ts:78— connector.createWhatsAppConnector.run has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 2 of the 28 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 114, a function literal at line 209, a function literal at line 90, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
workspace-transfers.WorkspaceActionsMenu (cyclomatic 28) platform/web/src/components/workspace-transfers.tsx:1148— workspace-transfers.WorkspaceActionsMenu has cyclomatic complexity 28 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
McpServersPage.ServerList (cyclomatic 28) platform/web/src/pages/McpServersPage.tsx:90— McpServersPage.ServerList has cyclomatic complexity 28 (threshold 15). Of this number, 19 points are the body's own statements and 9 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
company-identity.companyClaimsReader (cyclomatic 27) platform/backend/src/company-identity.ts:33— company-identity.companyClaimsReader has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to one function literal inside it that branches (line 35). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
cron-builder.cronBuilderFromExpression (cyclomatic 27) platform/web/src/components/bot/cron-builder.tsx:74— cron-builder.cronBuilderFromExpression has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
model-defaults.DefaultModelDialog (cyclomatic 27) platform/web/src/components/models/model-defaults.tsx:76— model-defaults.DefaultModelDialog has cyclomatic complexity 27 (threshold 15). Of this number, 14 points are the body's own statements and 13 belong to 7 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
reply-copy.replyFormatted::plain (cyclomatic 27) platform/web/src/components/session/reply-copy.ts:102— reply-copy.replyFormatted::plain has cyclomatic complexity 27 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
WorkspacesPage.WorkspacesPage (cyclomatic 27) platform/web/src/pages/WorkspacesPage.tsx:58— WorkspacesPage.WorkspacesPage has cyclomatic complexity 27 (threshold 15). Of this number, 21 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EnvironmentJobWorkflow::run (cyclomatic 26) crates/temporal-workflow/src/workflows/environment_job.rs:32— EnvironmentJobWorkflow::run has cyclomatic complexity 26 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
transcript.reconcileRuns (cyclomatic 26) platform/web/src/lib/sessions/transcript.ts:581— transcript.reconcileRuns has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SetupsPage.ConfiguratorKeyDialog (cyclomatic 26) platform/web/src/pages/SetupsPage.tsx:226— SetupsPage.ConfiguratorKeyDialog has cyclomatic complexity 26 (threshold 15). Of this number, 20 points are the body's own statements and 6 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
stack.main (cyclomatic 26) REDACTED:42— stack.main has cyclomatic complexity 26 (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.
SessionsPage.SessionLineage (cyclomatic 25) platform/web/src/pages/SessionsPage.tsx:2303— SessionsPage.SessionLineage has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SlashCommandKind::command_with_args (cyclomatic 24) crates/cli/src/chat/tui/slash.rs:199— SlashCommandKind::command_with_args has cyclomatic complexity 24 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
detail.BotDetail (cyclomatic 24) platform/web/src/components/bot/detail.tsx:130— detail.BotDetail has cyclomatic complexity 24 (threshold 15). Of this number, 12 points are the body's own statements and 12 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
session-config-editor.EnvironmentFields (cyclomatic 24) platform/web/src/components/session/session-config-editor.tsx:1913— session-config-editor.EnvironmentFields has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 3 of the 24 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 1973, 2014, 1949, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
tool-trace.ToolCallRow (cyclomatic 24) platform/web/src/components/session/tool-trace.tsx:295— tool-trace.ToolCallRow has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SetupsPage.SetupCard (cyclomatic 24) platform/web/src/pages/SetupsPage.tsx:107— SetupsPage.SetupCard has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AgentSessionWorkflow::run (cyclomatic 23) crates/temporal-workflow/src/workflows/session/mod.rs:137— AgentSessionWorkflow::run has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
setups.ensureCredential (cyclomatic 23) platform/backend/src/routes/setups.ts:265— setups.ensureCredential has cyclomatic complexity 23 (threshold 15). Of this number, 16 points are the body's own statements and 7 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
connector.toInboundMessage (cyclomatic 23) platform/connectors/src/providers/telegram/connector.ts:179— connector.toInboundMessage has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
model-api-key.OpenAiCompatibleForm (cyclomatic 23) platform/web/src/components/models/model-api-key.tsx:329— model-api-key.OpenAiCompatibleForm has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 393, a function literal at line 422, changeProvider). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
(anonymous).clone (cyclomatic 23) crates/codemode/src/prelude.js:28— (anonymous).clone has cyclomatic complexity 23 (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.
MethodGroup::of (cyclomatic 22) crates/api/src/access.rs:175— MethodGroup::of has cyclomatic complexity 22 (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.
JobManager::spawn_and_wait (cyclomatic 22) crates/environment-daemon/src/jobs.rs:657— JobManager::spawn_and_wait has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
channel-accounts.channelUniverseRoutes (cyclomatic 22) platform/backend/src/routes/channel-accounts.ts:80— channel-accounts.channelUniverseRoutes has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 11 function literals inside it that branch (lines 133, 114, 218, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
inbound.parseChannelInboundMedia (cyclomatic 22) platform/connectors/src/media/inbound.ts:11— inbound.parseChannelInboundMedia has cyclomatic complexity 22 (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.
ComposerState::handle_key (cyclomatic 21) crates/cli/src/chat/tui/bottom_pane/composer.rs:39— ComposerState::handle_key has cyclomatic complexity 21 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
activity.EventRow (cyclomatic 21) platform/web/src/components/bot/activity.tsx:319— activity.EventRow has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
tool-trace.ToolCallDetail (cyclomatic 21) platform/web/src/components/session/tool-trace.tsx:401— tool-trace.ToolCallDetail has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
workspace-file-tree.WorkspaceFileTree::key (cyclomatic 21) platform/web/src/components/workspace-file-tree.tsx:43— workspace-file-tree.WorkspaceFileTree::key has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
CredentialsPage.CredentialList (cyclomatic 21) platform/web/src/pages/CredentialsPage.tsx:107— CredentialsPage.CredentialList has cyclomatic complexity 21 (threshold 15). Of this number, 17 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
delete-session-dialog.DeleteSessionDialog (cyclomatic 20) platform/web/src/components/session/delete-session-dialog.tsx:9— delete-session-dialog.DeleteSessionDialog has cyclomatic complexity 20 (threshold 15). Of this number, 12 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
session-config-editor.VfsFields (cyclomatic 20) platform/web/src/components/session/session-config-editor.tsx:1359— session-config-editor.VfsFields has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 1430, 1464, 1386, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
transcript-view.UserBand (cyclomatic 20) platform/web/src/components/session/transcript-view.tsx:169— transcript-view.UserBand has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SessionsPage.SessionListItem (cyclomatic 20) platform/web/src/pages/SessionsPage.tsx:814— SessionsPage.SessionListItem has cyclomatic complexity 20 (threshold 15). 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
environment_provider_incus::edge::proxy_websocket (cyclomatic 19) crates/environment-provider-incus/src/edge.rs:146— environment_provider_incus::edge::proxy_websocket has cyclomatic complexity 19 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
EnvironmentRecord::validate (cyclomatic 19) crates/environments/src/lib.rs:606— EnvironmentRecord::validate has cyclomatic complexity 19 (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.
SubagentService::prepare (cyclomatic 19) crates/temporal-runtime/src/subagents.rs:206— SubagentService::prepare has cyclomatic complexity 19 (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.
environment-card.BotEnvironmentCard (cyclomatic 19) platform/web/src/components/bot/environment-card.tsx:27— environment-card.BotEnvironmentCard has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
triggers.TriggerFormCard (cyclomatic 19) platform/web/src/components/bot/triggers.tsx:317— triggers.TriggerFormCard has cyclomatic complexity 19 (threshold 15). 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, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
model-defaults.ModelDefaultsSection (cyclomatic 19) platform/web/src/components/models/model-defaults.tsx:27— model-defaults.ModelDefaultsSection has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 45). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
session-config-editor.FeaturePanel (cyclomatic 19) platform/web/src/components/session/session-config-editor.tsx:1287— session-config-editor.FeaturePanel has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
session-config-editor.SourceDiscoveryFields (cyclomatic 19) platform/web/src/components/session/session-config-editor.tsx:1841— session-config-editor.SourceDiscoveryFields has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AdminApiKeysPage.AdminApiKeysPage (cyclomatic 19) platform/web/src/pages/AdminApiKeysPage.tsx:55— AdminApiKeysPage.AdminApiKeysPage has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ApiKeysPage.ApiKeyList (cyclomatic 19) platform/web/src/pages/ApiKeysPage.tsx:63— ApiKeysPage.ApiKeyList has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
BlobPage.BlobDetail (cyclomatic 19) platform/web/src/pages/BlobPage.tsx:34— BlobPage.BlobDetail has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CredentialsPage.PasteCredentialDialog (cyclomatic 19) platform/web/src/pages/CredentialsPage.tsx:456— CredentialsPage.PasteCredentialDialog has cyclomatic complexity 19 (threshold 15). Of this number, 10 points are the body's own statements and 9 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
auth::providers::validate_model_endpoint (cyclomatic 18) crates/auth/src/providers.rs:177— auth::providers::validate_model_endpoint has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
company-identity.admitCompanyIdentity (cyclomatic 18) platform/backend/src/company-identity.ts:69— company-identity.admitCompanyIdentity has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to one function literal inside it that branches (line 74). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
app-shell.AppShell (cyclomatic 18) platform/web/src/components/app-shell.tsx:94— app-shell.AppShell has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: 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.
trigger-summary.deliverySentence (cyclomatic 18) platform/web/src/components/bot/trigger-summary.ts:102— trigger-summary.deliverySentence has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
github-app.GitHubAppDetails (cyclomatic 18) platform/web/src/components/credentials/github-app.tsx:197— github-app.GitHubAppDetails has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
session-config-editor.WebFields (cyclomatic 18) platform/web/src/components/session/session-config-editor.tsx:1550— session-config-editor.WebFields has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AdminChannelsPage.AdminChannelsPage (cyclomatic 18) platform/web/src/pages/AdminChannelsPage.tsx:33— AdminChannelsPage.AdminChannelsPage has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
stack.parseCli (cyclomatic 18) REDACTED:122— stack.parseCli has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MemberClient.call (cyclomatic 17) platform/backend/src/runtime-client.ts:84— MemberClient.call has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
subscriptions.parseCodexCredential (cyclomatic 17) platform/backend/src/subscriptions.ts:69— subscriptions.parseCodexCredential has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
media.createTelegramMediaActivities.prepareChannelMedia (cyclomatic 17) platform/connectors/src/providers/telegram/media.ts:39— media.createTelegramMediaActivities.prepareChannelMedia has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
App.App (cyclomatic 17) platform/web/src/App.tsx:46— App.App has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
triggers.triggerDraftSummary (cyclomatic 17) platform/web/src/components/bot/triggers.tsx:620— triggers.triggerDraftSummary has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
reply-copy.replyMarkdown::visit (cyclomatic 17) platform/web/src/components/session/reply-copy.ts:31— reply-copy.replyMarkdown::visit has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
run-section.RunStrip (cyclomatic 17) platform/web/src/components/session/run-section.tsx:69— run-section.RunStrip has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
session-config-editor.SessionConfigEditor (cyclomatic 17) platform/web/src/components/session/session-config-editor.tsx:572— session-config-editor.SessionConfigEditor has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 665, a function literal at line 614, onChange). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
tool-trace.ToolGroupTrace (cyclomatic 17) platform/web/src/components/session/tool-trace.tsx:218— tool-trace.ToolGroupTrace has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tool-discovery.useMcpToolDiscovery (cyclomatic 17) platform/web/src/lib/mcp/tool-discovery.ts:35— tool-discovery.useMcpToolDiscovery has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AdminEnvironmentProvidersPage.BindUniverseDialog (cyclomatic 17) platform/web/src/pages/AdminEnvironmentProvidersPage.tsx:512— AdminEnvironmentProvidersPage.BindUniverseDialog has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 belong to 5 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
OAuthFlowService::complete_callback (cyclomatic 16) crates/auth/src/flow.rs:237— OAuthFlowService::complete_callback has cyclomatic complexity 16 (threshold 15). 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. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ProviderArgs::load (cyclomatic 16) crates/environment-provider-incus/src/config.rs:103— ProviderArgs::load has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CodeRunner::run_attempt (cyclomatic 16) crates/temporal-runtime/src/code.rs:184— CodeRunner::run_attempt has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
gateway.withGateway (cyclomatic 16) platform/backend/src/routes/gateway.ts:2418— gateway.withGateway has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
delivery.deliver (cyclomatic 16) platform/connectors/src/providers/whatsapp/delivery.ts:64— delivery.deliver has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
media.describeWhatsAppMedia (cyclomatic 16) REDACTED:75— media.describeWhatsAppMedia 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.
workspace-transfers.workspaceDownload (cyclomatic 16) platform/shared/src/workspace-transfers.ts:337— workspace-transfers.workspaceDownload has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 3 function items inside it that branch (collect, archive, a function literal at line 377). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
status.botStatus (cyclomatic 16) platform/web/src/components/bot/status.tsx:14— status.botStatus has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
trigger-summary.triggerSummary (cyclomatic 16) platform/web/src/components/bot/trigger-summary.ts:48— trigger-summary.triggerSummary has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
triggers.SavedTriggerFormCard (cyclomatic 16) platform/web/src/components/bot/triggers.tsx:495— triggers.SavedTriggerFormCard has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
triggers.AddTriggerInline (cyclomatic 16) platform/web/src/components/bot/triggers.tsx:2488— triggers.AddTriggerInline has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
session-actions-menu.SessionActionsMenu (cyclomatic 16) platform/web/src/components/session/session-actions-menu.tsx:24— session-actions-menu.SessionActionsMenu has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AdminUniversesPage.AdminUniversesPage (cyclomatic 16) platform/web/src/pages/AdminUniversesPage.tsx:60— AdminUniversesPage.AdminUniversesPage has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ModelsPage.Models (cyclomatic 16) platform/web/src/pages/ModelsPage.tsx:29— ModelsPage.Models has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
cli-connection.prepareCliConnection::provision (cyclomatic 16) scripts/dev/cli-connection.mjs:35— cli-connection.prepareCliConnection::provision 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.
gateway.gatewayRoutes (cognitive 240) platform/backend/src/routes/gateway.ts:383— gateway.gatewayRoutes has cognitive complexity 240 (threshold 15). Drivers by points: if/else 174 (185 pts), ternaries 23 (24 pts), boolean chains 20, error handling 7 (10 pts), loops 1 (nesting depth added 15). None of this is in the body itself: all 240 points belong to 107 function literals inside it that branch (lines 560, 1357, 1402, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
workspace-transfers.WorkspaceTransfers (cognitive 159) platform/web/src/components/workspace-transfers.tsx:93— workspace-transfers.WorkspaceTransfers has cognitive complexity 159 (threshold 15). Drivers by points: if/else 52 (59 pts), boolean chains 57, ternaries 26 (33 pts), error handling 8, loops 2 (nesting depth added 14). Of this number, 36 points are the body's own statements and 123 belong to 39 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
SessionsPage.SessionDetail (cognitive 142) platform/web/src/pages/SessionsPage.tsx:1303— SessionsPage.SessionDetail has cognitive complexity 142 (threshold 15). Drivers by points: boolean chains 60, ternaries 35 (50 pts), if/else 26 (27 pts), error handling 4, loops 1 (nesting depth added 16). Of this number, 60 points are the body's own statements and 82 belong to 39 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
auth.createAuth.handler (cognitive 118) platform/backend/src/auth.ts:119— auth.createAuth.handler has cognitive complexity 118 (threshold 15). Drivers by points: if/else 35 (62 pts), boolean chains 29, ternaries 10 (25 pts), error handling 1 (2 pts) (nesting depth added 43). None of this is in the body itself: all 118 points belong to 2 function literals inside it that branch (lines 119, 180). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
session-config-editor.normalizeSessionConfig (cognitive 111) platform/web/src/components/session/session-config-editor.tsx:253— session-config-editor.normalizeSessionConfig has cognitive complexity 111 (threshold 15). Drivers by points: if/else 33 (75 pts), loops 10 (23 pts), ternaries 2 (7 pts), boolean chains 6 (nesting depth added 60). Of this number, 107 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpServersPage.ServerDialog (cognitive 102) platform/web/src/pages/McpServersPage.tsx:359— McpServersPage.ServerDialog has cognitive complexity 102 (threshold 15). Drivers by points: ternaries 33 (56 pts), boolean chains 29, if/else 15 (16 pts), error handling 1 (nesting depth added 24). Of this number, 63 points are the body's own statements and 39 belong to 11 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session-config-editor.configError (cognitive 92) platform/web/src/components/session/session-config-editor.tsx:412— session-config-editor.configError has cognitive complexity 92 (threshold 15). Drivers by points: if/else 32 (56 pts), boolean chains 22, ternaries 5 (10 pts), loops 4 (nesting depth added 29). 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.
BotCreatePage.Wizard (cognitive 90) platform/web/src/pages/BotCreatePage.tsx:142— BotCreatePage.Wizard has cognitive complexity 90 (threshold 15). Drivers by points: ternaries 31 (44 pts), boolean chains 32, if/else 9 (12 pts), error handling 1, loops 1 (nesting depth added 16). Of this number, 56 points are the body's own statements and 34 belong to 9 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
universes.universeRoutes (cognitive 74) platform/backend/src/routes/universes.ts:140— universes.universeRoutes has cognitive complexity 74 (threshold 15). Drivers by points: if/else 56 (58 pts), boolean chains 8, ternaries 6 (7 pts), error handling 1 (nesting depth added 3). None of this is in the body itself: all 74 points belong to 30 function literals inside it that branch (lines 250, 524, 569, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
session-settings-sheet.LiveSessionSetup (cognitive 70) platform/web/src/components/session/session-settings-sheet.tsx:94— session-settings-sheet.LiveSessionSetup has cognitive complexity 70 (threshold 15). Drivers by points: ternaries 15 (30 pts), boolean chains 24, if/else 16 (nesting depth added 15). Of this number, 45 points are the body's own statements and 25 belong to 8 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scanner::advance (cognitive 69) crates/environment-daemon/src/filesystem/transfer/session.rs:102— Scanner::advance has cognitive complexity 69 (threshold 15). Drivers by points: if/else 20 (55 pts), loops 3 (7 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 40). 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.
transcript.applyNonToolCallItem (cognitive 67) platform/web/src/lib/sessions/transcript.ts:735— transcript.applyNonToolCallItem has cognitive complexity 67 (threshold 15). Drivers by points: ternaries 16 (46 pts), if/else 6 (11 pts), boolean chains 9, match/switch 1 (nesting depth added 35). 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.
composer.SessionComposer (cognitive 60) platform/web/src/components/session/composer.tsx:51— composer.SessionComposer has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 29 (50 pts), boolean chains 41, if/else 24 (25 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (composer.SessionComposer::submit) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
transcript.applyEvents (cognitive 60) platform/web/src/lib/sessions/transcript.ts:257— transcript.applyEvents has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 9 (27 pts), if/else 9 (24 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 36). Of this number, 48 points are the body's own statements and 12 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionsPage.NewSessionDialog (cognitive 60) platform/web/src/pages/SessionsPage.tsx:921— SessionsPage.NewSessionDialog has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 20 (31 pts), boolean chains 24, if/else 5 (nesting depth added 11). Of this number, 39 points are the body's own statements and 21 belong to 6 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionsPage.SessionList (cognitive 59) platform/web/src/pages/SessionsPage.tsx:195— SessionsPage.SessionList has cognitive complexity 59 (threshold 15). Drivers by points: boolean chains 30, if/else 11 (13 pts), ternaries 11 (13 pts), loops 2, error handling 1 (nesting depth added 4). Of this number, 30 points are the body's own statements and 29 belong to 17 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
deleted-sessions.DeletedSessionsContent (cognitive 55) platform/web/src/components/admin/deleted-sessions.tsx:18— deleted-sessions.DeletedSessionsContent has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 12 (23 pts), boolean chains 15, if/else 6 (8 pts), loops 5 (7 pts), error handling 1 (2 pts) (nesting depth added 16). Of this number, 30 points are the body's own statements and 25 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transcript.applyItems (cognitive 53) platform/web/src/lib/sessions/transcript.ts:642— transcript.applyItems has cognitive complexity 53 (threshold 15). Drivers by points: if/else 18 (42 pts), boolean chains 8, ternaries 1 (2 pts), loops 1 (nesting depth added 25). 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.
(anonymous).outputHelper (cognitive 48) crates/codemode/src/prelude.js:99— (anonymous).outputHelper has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (31 pts), boolean chains 8, loops 3 (6 pts), ternaries 3 (nesting depth added 16). None of this is in the body itself: all 48 points belong to one function literal inside it that branches (line 100). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
tail.useSessionTail (cognitive 47) platform/web/src/lib/sessions/tail.ts:38— tail.useSessionTail has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 9, error handling 2 (4 pts), ternaries 2 (3 pts), loops 2 (nesting depth added 19). Most of this is not in the body itself: 1 of the 47 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 96, 46, 56, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
setup.OtherBotsSection (cognitive 46) platform/web/src/components/bot/setup.tsx:791— setup.OtherBotsSection has cognitive complexity 46 (threshold 15). Drivers by points: boolean chains 21, if/else 8 (13 pts), ternaries 8 (12 pts) (nesting depth added 9). Of this number, 26 points are the body's own statements and 20 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EnvironmentJobWorkflow::run (cognitive 44) crates/temporal-workflow/src/workflows/environment_job.rs:32— EnvironmentJobWorkflow::run has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 5 (11 pts), loops 4 (8 pts), boolean chains 6 (nesting depth added 20). 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.
tool-picker.ToolPicker (cognitive 44) platform/web/src/components/mcp/tool-picker.tsx:48— tool-picker.ToolPicker has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 18 (25 pts), boolean chains 13, if/else 5 (6 pts) (nesting depth added 8). Of this number, 27 points are the body's own statements and 17 belong to 6 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session-resources.sessionResources (cognitive 42) platform/web/src/lib/sessions/session-resources.ts:72— session-resources.sessionResources has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 11 (28 pts), if/else 8 (10 pts), boolean chains 4 (nesting depth added 19). Of this number, 16 points are the body's own statements and 26 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
auth.createAuth (cognitive 41) platform/backend/src/auth.ts:38— auth.createAuth has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 11 (14 pts), boolean chains 13, if/else 9 (12 pts), error handling 1 (2 pts) (nesting depth added 7). Most of this is not in the body itself: 8 of the 41 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 76, 61, 85, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
codemode::engine::run_context (cognitive 40) crates/codemode/src/engine.rs:235— codemode::engine::run_context has cognitive complexity 40 (threshold 15). Drivers by points: if/else 22 (31 pts), match/switch 4 (6 pts), boolean chains 2, 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.
connector.createWhatsAppConnector.run (cognitive 40) platform/connectors/src/providers/whatsapp/connector.ts:78— connector.createWhatsAppConnector.run has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 9 (18 pts), if/else 13 (17 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 14). Most of this is not in the body itself: 1 of the 40 points is its own statement and the rest belongs to 4 function items inside it that branch (a function literal at line 114, a function literal at line 209, a function literal at line 90, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
run-sections.sectionsByRun (cognitive 40) platform/web/src/lib/sessions/run-sections.ts:74— run-sections.sectionsByRun has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 8, ternaries 3 (4 pts), loops 2 (nesting depth added 13). Of this number, 31 points are the body's own statements and 9 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AdminUsersPage.EditUserDialog (cognitive 40) platform/web/src/pages/AdminUsersPage.tsx:139— AdminUsersPage.EditUserDialog has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 15, ternaries 7 (8 pts) (nesting depth added 3). Most of this is not in the body itself: 15 of the 40 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 200, a function literal at line 188, a function literal at line 233, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
gateway.withGateway (cognitive 37) platform/backend/src/routes/gateway.ts:2418— gateway.withGateway has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (33 pts), ternaries 1 (3 pts), error handling 1 (nesting depth added 22). 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.
ProfilesPage.ProfileEditor (cognitive 37) platform/web/src/pages/ProfilesPage.tsx:192— ProfilesPage.ProfileEditor has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 10, ternaries 3 (5 pts), error handling 2 (3 pts) (nesting depth added 5). Most of this is not in the body itself: 11 of the 37 points are its own statements and the rest belongs to 8 function items inside it that branch (submit, switchTab, a function literal at line 244, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
WorkspacesPage.FileDetail (cognitive 37) platform/web/src/pages/WorkspacesPage.tsx:303— WorkspacesPage.FileDetail has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 20, ternaries 9, if/else 8. Of this number, 20 points are the body's own statements and 17 belong to 8 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AgentSessionWorkflow::run (cognitive 35) crates/temporal-workflow/src/workflows/session/mod.rs:137— AgentSessionWorkflow::run has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (23 pts), match/switch 5 (11 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
triggers.TriggersSection (cognitive 35) platform/web/src/components/bot/triggers.tsx:748— triggers.TriggersSection has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 12 (22 pts), boolean chains 13 (nesting depth added 10). Most of this is not in the body itself: 10 of the 35 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 852, 877). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
reply-copy.replyFormatted (cognitive 35) platform/web/src/components/session/reply-copy.ts:78— reply-copy.replyFormatted has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 6, loops 3 (5 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 14). Of this number, 25 points are the body's own statements and 10 belong to one function item 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.
stack.createPlan (cognitive 35) REDACTED:190— stack.createPlan has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 10 (15 pts), boolean chains 10, if/else 8 (10 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.
bots.botRoutes (cognitive 32) platform/backend/src/routes/bots.ts:31— bots.botRoutes has cognitive complexity 32 (threshold 15). Drivers by points: if/else 25, boolean chains 6, ternaries 1. None of this is in the body itself: all 32 points belong to 17 function literals inside it that branch (lines 257, 74, 182, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
workspace-transfers.prepareWorkspaceUpload (cognitive 32) platform/shared/src/workspace-transfers.ts:248— workspace-transfers.prepareWorkspaceUpload has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 3 (4 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 17). Of this number, 28 points are the body's own statements and 4 belong to one function item 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.
stack.main (cognitive 32) REDACTED:42— stack.main has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 5, loops 3 (5 pts), error handling 1 (nesting depth added 7). 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.
connector.toInboundMessage (cognitive 31) platform/connectors/src/providers/telegram/connector.ts:179— connector.toInboundMessage has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 22 (31 pts) (nesting depth added 9). Of this number, 29 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
model-api-key.ProviderModelList (cognitive 29) platform/web/src/components/models/model-api-key.tsx:735— model-api-key.ProviderModelList has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 8 (23 pts), boolean chains 6 (nesting depth added 15). Of this number, 21 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
session-config-editor.ModelFields (cognitive 29) platform/web/src/components/session/session-config-editor.tsx:837— session-config-editor.ModelFields has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12, ternaries 8 (10 pts), boolean chains 7 (nesting depth added 2). Most of this is not in the body itself: 14 of the 29 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 931, 908, 891, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
WorkspacesPage.WorkspacesPage (cognitive 29) platform/web/src/pages/WorkspacesPage.tsx:58— WorkspacesPage.WorkspacesPage has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 6 (13 pts), boolean chains 9, if/else 6 (7 pts) (nesting depth added 8). Of this number, 24 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodeRunner::run_attempt (cognitive 28) crates/temporal-runtime/src/code.rs:184— CodeRunner::run_attempt has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 5 (10 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
model-defaults.DefaultModelDialog (cognitive 28) platform/web/src/components/models/model-defaults.tsx:76— model-defaults.DefaultModelDialog has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 11 (15 pts), boolean chains 8, if/else 4, error handling 1 (nesting depth added 4). Of this number, 15 points are the body's own statements and 13 belong to 7 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
session-config-editor.VfsFields (cognitive 28) platform/web/src/components/session/session-config-editor.tsx:1359— session-config-editor.VfsFields has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 7 (15 pts), boolean chains 6, if/else 4 (5 pts), loops 2 (nesting depth added 9). Most of this is not in the body itself: 8 of the 28 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 1430, 1464, 1386, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
transcript.reconcileRuns (cognitive 28) platform/web/src/lib/sessions/transcript.ts:581— transcript.reconcileRuns has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 6, match/switch 1 (2 pts), loops 1, ternaries 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.
trigger-summary.deliverySentence (cognitive 27) platform/web/src/components/bot/trigger-summary.ts:102— trigger-summary.deliverySentence has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 9 (10 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
resize-handle.ResizeHandle (cognitive 27) platform/web/src/components/resize-handle.tsx:82— resize-handle.ResizeHandle has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 6, ternaries 5 (6 pts) (nesting depth added 2). Most of this is not in the body itself: 5 of the 27 points are its own statements and the rest belongs to 8 function items inside it that branch (key, a function literal at line 196, a function literal at line 207, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
company-identity.companyClaimsReader (cognitive 26) platform/backend/src/company-identity.ts:33— company-identity.companyClaimsReader has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 8 (nesting depth added 9). None of this is in the body itself: all 26 points belong to one function literal inside it that branches (line 35). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
setup.SessionProfileSection (cognitive 26) platform/web/src/components/bot/setup.tsx:380— setup.SessionProfileSection has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 15, ternaries 7 (8 pts), if/else 3 (nesting depth added 1). Of this number, 19 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
composer-model-picker.ModelPicker (cognitive 26) platform/web/src/components/session/composer-model-picker.tsx:16— composer-model-picker.ModelPicker has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 12, ternaries 8 (11 pts), if/else 2, error handling 1 (nesting depth added 3). Most of this is not in the body itself: 12 of the 26 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 74, save, a function literal at line 85, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
session-resources.SessionResourceChips (cognitive 26) platform/web/src/components/session/session-resources.tsx:70— session-resources.SessionResourceChips has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 26. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EnvironmentsPage.EnvironmentCard (cognitive 26) platform/web/src/pages/EnvironmentsPage.tsx:293— EnvironmentsPage.EnvironmentCard has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 16, ternaries 7 (10 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
detail.BotDetail (cognitive 25) platform/web/src/components/bot/detail.tsx:130— detail.BotDetail has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 10 (14 pts), boolean chains 9, if/else 2 (nesting depth added 4). Most of this is not in the body itself: 12 of the 25 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 218, setSettingsOpen, sessionHref). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
(anonymous).clone (cognitive 25) crates/codemode/src/prelude.js:28— (anonymous).clone has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 8, loops 2, ternaries 1 (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.
api_projection::tool_call_display (cognitive 24) crates/api-projection/src/lib.rs:2973— api_projection::tool_call_display has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 4 (7 pts), boolean chains 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.
env.loadOidc (cognitive 24) platform/backend/src/env.ts:110— env.loadOidc has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 15, if/else 8, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
triggers.triggerDraftSummary (cognitive 24) platform/web/src/components/bot/triggers.tsx:620— triggers.triggerDraftSummary has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 9 (21 pts), boolean chains 2, match/switch 1 (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.
delete-session-dialog.DeleteSessionDialog (cognitive 24) platform/web/src/components/session/delete-session-dialog.tsx:9— delete-session-dialog.DeleteSessionDialog has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 7, boolean chains 6 (nesting depth added 4). Of this number, 14 points are the body's own statements and 10 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
workspace-transfers.WorkspaceActionsMenu (cognitive 24) platform/web/src/components/workspace-transfers.tsx:1148— workspace-transfers.WorkspaceActionsMenu has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 16, ternaries 5 (7 pts), if/else 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
cli-connection.prepareCliConnection (cognitive 24) scripts/dev/cli-connection.mjs:22— cli-connection.prepareCliConnection has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 5, ternaries 3, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to one function item inside it that branches (provision). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ProviderArgs::load (cognitive 23) crates/environment-provider-incus/src/config.rs:103— ProviderArgs::load has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3, loops 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.
NativeMcpRuntime::find_tools (cognitive 23) crates/temporal-runtime/src/worker/mcp.rs:401— NativeMcpRuntime::find_tools has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (5 pts), match/switch 2 (4 pts), boolean chains 2 (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.
setups.setupRoutes (cognitive 23) platform/backend/src/routes/setups.ts:69— setups.setupRoutes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (7 pts), boolean chains 2, error handling 2 (nesting depth added 9). None of this is in the body itself: all 23 points belong to 2 function literals inside it that branch (lines 83, 74). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
activity.BotActivity (cognitive 23) platform/web/src/components/bot/activity.tsx:65— activity.BotActivity has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 12, loops 4 (6 pts), ternaries 5 (nesting depth added 2). Of this number, 16 points are the body's own statements and 7 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
trigger-summary.triggerSummary (cognitive 23) platform/web/src/components/bot/trigger-summary.ts:48— trigger-summary.triggerSummary has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 9 (20 pts), if/else 1 (2 pts), match/switch 1 (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.
model-api-key.OpenAiCompatibleForm (cognitive 23) platform/web/src/components/models/model-api-key.tsx:329— model-api-key.OpenAiCompatibleForm has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 10 (12 pts), boolean chains 6, if/else 5 (nesting depth added 2). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 393, a function literal at line 422, changeProvider). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
session-config-editor.workspaceAttachmentsError (cognitive 23) platform/web/src/components/session/session-config-editor.tsx:520— session-config-editor.workspaceAttachmentsError has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 2, 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.
LoginPage.LoginPage (cognitive 23) platform/web/src/pages/LoginPage.tsx:15— LoginPage.LoginPage has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, ternaries 4 (6 pts), if/else 4, error handling 2 (nesting depth added 2). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to 4 function items inside it that branch (companySignIn, submit, a function literal at line 41, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
MethodGroup::of (cognitive 22) crates/api/src/access.rs:175— MethodGroup::of has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WorkflowToolEmissionReadProjection::observe_config (cognitive 22) crates/harness/src/core/components/workflow_tool.rs:962— WorkflowToolEmissionReadProjection::observe_config has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 3 (6 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.
company-identity.admitCompanyIdentity (cognitive 22) platform/backend/src/company-identity.ts:69— company-identity.admitCompanyIdentity has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 4 (6 pts), boolean chains 4 (nesting depth added 4). None of this is in the body itself: all 22 points belong to one function literal inside it that branches (line 74). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
environment-card.BotEnvironmentCard (cognitive 22) platform/web/src/components/bot/environment-card.tsx:27— environment-card.BotEnvironmentCard has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (15 pts), boolean chains 7 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
EnvironmentsPage.ProviderList (cognitive 22) platform/web/src/pages/EnvironmentsPage.tsx:92— EnvironmentsPage.ProviderList has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 19, ternaries 3. Of this number, 15 points are the body's own statements and 7 belong to 7 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
McpServersPage.OAuthDialog (cognitive 22) platform/web/src/pages/McpServersPage.tsx:1082— McpServersPage.OAuthDialog has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 14, ternaries 5 (6 pts), if/else 2 (nesting depth added 1). Of this number, 17 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SetupsPage.SetupCard (cognitive 22) platform/web/src/pages/SetupsPage.tsx:107— SetupsPage.SetupCard has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 10 (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.
setups.ensureCredential (cognitive 21) platform/backend/src/routes/setups.ts:265— setups.ensureCredential has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, ternaries 2, match/switch 1 (nesting depth added 5). Of this number, 15 points are the body's own statements and 6 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
reply-copy.replyMarkdown::visit (cognitive 21) platform/web/src/components/session/reply-copy.ts:31— reply-copy.replyMarkdown::visit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 7, ternaries 1 (3 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.
session-config-editor.EnvironmentFields (cognitive 21) platform/web/src/components/session/session-config-editor.tsx:1913— session-config-editor.EnvironmentFields has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, if/else 7, ternaries 4. Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 1973, 2014, 1991, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
cli-connection.seedDevelopmentModelDefaults (cognitive 21) scripts/dev/cli-connection.mjs:85— cli-connection.seedDevelopmentModelDefaults has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 3 (4 pts), boolean chains 3, loops 1 (nesting depth added 7). Of this number, 13 points are the body's own statements and 8 belong to one function item 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.
FsSessionStore::delete_closed_sessions (cognitive 20) crates/store-fs/src/session.rs:320— FsSessionStore::delete_closed_sessions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 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.
channel-accounts.channelUniverseRoutes (cognitive 20) platform/backend/src/routes/channel-accounts.ts:80— channel-accounts.channelUniverseRoutes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 2, error handling 2, ternaries 1 (nesting depth added 1). None of this is in the body itself: all 20 points belong to 11 function literals inside it that branch (lines 133, 114, 218, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
inbound.parseChannelInboundMedia (cognitive 20) platform/connectors/src/media/inbound.ts:11— inbound.parseChannelInboundMedia has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 7, ternaries 6 (7 pts), if/else 6 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
delivery.deliver (cognitive 20) platform/connectors/src/providers/whatsapp/delivery.ts:64— delivery.deliver has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 3 (10 pts), if/else 2 (4 pts), boolean chains 3, loops 1 (2 pts), match/switch 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.
model-api-key.providerModelCatalog (cognitive 20) platform/web/src/components/models/model-api-key.tsx:686— model-api-key.providerModelCatalog has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, loops 1 (nesting depth added 7). Of this number, 16 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transcript-motion.TranscriptMotionProvider (cognitive 20) platform/web/src/components/session/transcript-motion.tsx:9— transcript-motion.TranscriptMotionProvider has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 9). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 2 function items inside it that branch (a function literal at line 20, canAnimate). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
run-section.RunStrip (cognitive 20) platform/web/src/components/session/run-section.tsx:69— run-section.RunStrip has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (13 pts), boolean chains 7 (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.
session-config-editor.SessionConfigEditor (cognitive 20) platform/web/src/components/session/session-config-editor.tsx:572— session-config-editor.SessionConfigEditor has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 9, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 614, a function literal at line 665, onChange). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
tool-trace.ToolCallRow (cognitive 20) platform/web/src/components/session/tool-trace.tsx:295— tool-trace.ToolCallRow has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9, boolean chains 6, if/else 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CredentialsPage.PasteCredentialDialog (cognitive 20) platform/web/src/pages/CredentialsPage.tsx:456— CredentialsPage.PasteCredentialDialog has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 11 (13 pts), if/else 4, boolean chains 3 (nesting depth added 2). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 487, submit, a function literal at line 546). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
auth::providers::validate_model_endpoint (cognitive 19) crates/auth/src/providers.rs:177— auth::providers::validate_model_endpoint has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 2, match/switch 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.
environment_protocol::shared::normalize_path (cognitive 19) crates/environment-protocol/src/shared.rs:398— environment_protocol::shared::normalize_path has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 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.
EnvironmentRecord::validate (cognitive 19) crates/environments/src/lib.rs:606— EnvironmentRecord::validate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 4, match/switch 1 (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.
AnthropicMessagesLlmAdapter::generate (cognitive 19) crates/llm-runtime/src/anthropic_messages.rs:214— AnthropicMessagesLlmAdapter::generate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 2 (3 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.
MemberClient.call (cognitive 19) platform/backend/src/runtime-client.ts:84— MemberClient.call has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4 (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.
activity.EventRow (cognitive 19) platform/web/src/components/bot/activity.tsx:319— activity.EventRow has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 14, ternaries 4 (5 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
triggers.pollPayload (cognitive 19) platform/web/src/components/bot/triggers.tsx:1779— triggers.pollPayload has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (17 pts), boolean chains 2 (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.
tool-trace.ToolGroupTrace (cognitive 19) platform/web/src/components/session/tool-trace.tsx:218— tool-trace.ToolGroupTrace has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 10 (15 pts), boolean chains 3, if/else 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.
file-references.filesFromAttachments (cognitive 19) platform/web/src/lib/file-references.ts:23— file-references.filesFromAttachments has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (6 pts), boolean chains 4, 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.
MessageCell::display_lines (cognitive 18) crates/cli/src/chat/tui/cell.rs:71— MessageCell::display_lines has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 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.
CompletionStream::next_chunk (cognitive 18) crates/llm-clients/src/openai/completions.rs:729— CompletionStream::next_chunk has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 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.
ResponseStream::next_event (cognitive 18) crates/llm-clients/src/openai/responses.rs:1130— ResponseStream::next_event has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 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.
subscriptions.parseCodexCredential (cognitive 18) platform/backend/src/subscriptions.ts:69— subscriptions.parseCodexCredential has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (9 pts), if/else 5 (6 pts), boolean chains 2, error handling 1 (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.
ConnectorHealthTracker.refresh (cognitive 18) platform/connectors/src/host/lifecycle.ts:109— ConnectorHealthTracker.refresh has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (15 pts), boolean chains 2, if/else 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
App.App (cognitive 18) platform/web/src/App.tsx:46— App.App has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, ternaries 2 (4 pts) (nesting depth added 3). Of this number, 16 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
app-shell.AppShell (cognitive 18) platform/web/src/components/app-shell.tsx:94— app-shell.AppShell has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 6, if/else 1 (nesting depth added 3). Of this number, 17 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cron-builder.cronBuilderFromExpression (cognitive 18) platform/web/src/components/bot/cron-builder.tsx:74— cron-builder.cronBuilderFromExpression has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 8. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
add-model-provider-dialog.AddModelProviderDialog (cognitive 18) platform/web/src/components/models/add-model-provider-dialog.tsx:28— add-model-provider-dialog.AddModelProviderDialog has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 13, if/else 3, ternaries 2. Of this number, 14 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
composer.SessionComposer::submit (cognitive 18) platform/web/src/components/session/composer.tsx:183— composer.SessionComposer::submit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 5 (8 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. This shape REPEATS in the file: one other method here (composer.SessionComposer) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
resource-features.setupResourceFeatureError (cognitive 18) platform/web/src/lib/sessions/resource-features.ts:40— resource-features.setupResourceFeatureError has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
workspace-transfers.droppedEntries (cognitive 18) platform/web/src/lib/workspace-transfers.ts:72— workspace-transfers.droppedEntries has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 3 (6 pts), ternaries 1 (nesting depth added 6). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to one function item inside it that branches (visit). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
McpServersPage.ServerList (cognitive 18) platform/web/src/pages/McpServersPage.tsx:90— McpServersPage.ServerList has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 13, if/else 3, ternaries 2. Of this number, 15 points are the body's own statements and 3 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SessionsPage.SessionListItem (cognitive 18) platform/web/src/pages/SessionsPage.tsx:814— SessionsPage.SessionListItem has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 12, ternaries 5 (6 pts) (nesting depth added 1). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SetupsPage.ConfiguratorKeyDialog (cognitive 18) platform/web/src/pages/SetupsPage.tsx:226— SetupsPage.ConfiguratorKeyDialog has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, ternaries 6 (7 pts), if/else 2 (nesting depth added 1). Of this number, 12 points are the body's own statements and 6 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
OAuthFlowService::complete_callback (cognitive 17) crates/auth/src/flow.rs:237— OAuthFlowService::complete_callback has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), match/switch 6 (7 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.
DaemonArgs::into_config (cognitive 17) crates/environment-daemon/src/config.rs:299— DaemonArgs::into_config has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 5 (8 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.
store_pg::object::put_streamed_object (cognitive 17) crates/store-pg/src/object.rs:115— store_pg::object::put_streamed_object has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 1, match/switch 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.
ingress.normalizeTelegramMedia (cognitive 17) platform/connectors/src/providers/telegram/ingress.ts:92— ingress.normalizeTelegramMedia has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7 (nesting depth added 3). 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.
media.createTelegramMediaActivities.prepareChannelMedia (cognitive 17) platform/connectors/src/providers/telegram/media.ts:39— media.createTelegramMediaActivities.prepareChannelMedia has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, error handling 3, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
chat.BotChat (cognitive 17) platform/web/src/components/bot/chat.tsx:21— chat.BotChat has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (10 pts), boolean chains 5, if/else 2 (nesting depth added 5). Of this number, 16 points are the body's own statements and 1 belongs to one function item 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.
triggers.AddTriggerInline (cognitive 17) platform/web/src/components/bot/triggers.tsx:2488— triggers.AddTriggerInline has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (7 pts), if/else 6, boolean chains 4 (nesting depth added 2). Of this number, 10 points are the body's own statements and 7 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
setup.ProfileSwitcher (cognitive 17) platform/web/src/components/bot/setup.tsx:568— setup.ProfileSwitcher has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (13 pts), boolean chains 4 (nesting depth added 6). Of this number, 14 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session-config-editor.modelPickerOptions (cognitive 17) platform/web/src/components/session/session-config-editor.tsx:1049— session-config-editor.modelPickerOptions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 5, ternaries 2 (3 pts), loops 1 (nesting depth added 5). Of this number, 13 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session-config-editor.ContextFields (cognitive 17) platform/web/src/components/session/session-config-editor.tsx:1271— session-config-editor.ContextFields has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 3, ternaries 3. Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1276, 1284, 1284). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
transcript-view.UserBand (cognitive 17) platform/web/src/components/session/transcript-view.tsx:169— transcript-view.UserBand has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, ternaries 6 (7 pts), if/else 2 (nesting depth added 1). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
workspace-file-tree.WorkspaceFileTree (cognitive 17) platform/web/src/components/workspace-file-tree.tsx:24— workspace-file-tree.WorkspaceFileTree has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, match/switch 1 (nesting depth added 4). None of this is in the body itself: all 17 points belong to 3 function items inside it that branch (key, a function literal at line 113, a function literal at line 29). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
transcript.toolTarget (cognitive 17) platform/web/src/lib/sessions/transcript.ts:1184— transcript.toolTarget has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 2 (6 pts), boolean chains 2, error handling 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.
EnvironmentsPage.CreateRegistrationKeyDialog (cognitive 17) platform/web/src/pages/EnvironmentsPage.tsx:863— EnvironmentsPage.CreateRegistrationKeyDialog has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 4, if/else 1 (nesting depth added 4). Of this number, 11 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
stack.parseCli (cognitive 17) REDACTED:122— stack.parseCli has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 8. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IncusClient::wait_operation (cognitive 16) crates/environment-provider-incus/src/incus.rs:353— IncusClient::wait_operation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 2, match/switch 1 (2 pts), 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.
RemoteMcpToolSpec::validate (cognitive 16) crates/harness/src/core/components/tooling.rs:464— RemoteMcpToolSpec::validate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, loops 1 (2 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.
content.stageDocumentation (cognitive 16) docs/site/scripts/content.mjs:143— content.stageDocumentation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 5, boolean chains 2 (nesting depth added 4). Of this number, 15 points are the body's own statements and 1 belongs to one function item 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.
connector.createTelegramConnector.run (cognitive 16) platform/connectors/src/providers/telegram/connector.ts:107— connector.createTelegramConnector.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
workspace-transfers.workspaceDownload (cognitive 16) platform/shared/src/workspace-transfers.ts:337— workspace-transfers.workspaceDownload has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, ternaries 5 (6 pts), loops 2 (3 pts), error handling 1 (nesting depth added 2). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 3 function items inside it that branch (collect, archive, a function literal at line 377). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
api.extractMessage (cognitive 16) platform/web/src/api.ts:36— api.extractMessage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 4). Of this number, 8 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
triggers.ChatRowDetail (cognitive 16) platform/web/src/components/bot/triggers.tsx:1277— triggers.ChatRowDetail has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (10 pts), boolean chains 6 (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.
tool-trace.ToolCallDetail (cognitive 16) platform/web/src/components/session/tool-trace.tsx:401— tool-trace.ToolCallDetail has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, ternaries 6 (7 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
BlobPage.BlobDetail (cognitive 16) platform/web/src/pages/BlobPage.tsx:34— BlobPage.BlobDetail has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 14, ternaries 2. Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D22 · Internal API Consistency· Ambiguous parsing intent · ×1
Ambiguous parsing intent: `parse` suggests general deserialization (e.g. from wire format), while `of` suggests construction from a specific domain concept (a method name). In other types like `Visibility`, only `parse` is used. If `of` is just a convenience for `parse`, it creates redundancy. If they serve different purposes, the naming convention is inconsistent with the rest of the API (which uses `parse` for string-to-type conversion). — Remove `MethodGroup.of` and use `MethodGroup.parse` for all string-to-type conversions, or rename `parse` to `from_str` to align with standard Rust conventions if `of` is intended as a distinct factory method. (signatures: MethodGroup.of(method: str): MethodGroup | MethodGroup.parse(value: str): Self)
D22 · Internal API Consistency· Inconsistent response structure for read operations · ×1
Inconsistent response structure for read operations: `BotReadResponse` includes `access` metadata, whereas `AuthGrantReadResponse`, `AuthClientReadResponse`, `AuthProviderReadResponse`, and `BotTriggerReadResponse` only return the primary entity (e.g., `grant: AuthGrantView`). This forces consumers to handle two different response shapes for similar 'read' operations. — Standardize read responses to return only the primary entity. If access metadata is required, provide a separate endpoint or include it in a unified wrapper type, or add `access` to all other read responses for consistency. (signatures: BotReadResponse.bot: BotView | BotReadResponse.access: ResourceAccessSummary)
TooManyFields: ControllerState crates/temporal-workflow/src/workflows/bots/controller/state.rs:300— TooManyFields — 39 stored fields beside 62 methods. The bar is 30 stored fields; this is 9 over it, 1.30× 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.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×1
D4 · Code Duplication· Near-duplicate member family (4 members, 16 shared lines) · ×1
Near-duplicate member family (4 members, 16 shared lines) crates/store-pg/src/environment.rs:301— crates/store-pg/src/environment.rs:301-395 | crates/store-pg/src/environment.rs:400-495 | crates/store-pg/src/environment.rs:500-597 | crates/store-pg/src/environment.rs:602-702 — 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 (36 shared lines) crates/temporal-runtime/src/gateway/service/mod.rs:3233— crates/temporal-runtime/src/gateway/service/mod.rs:3233-3294 | crates/temporal-runtime/src/gateway/service/mod.rs:3487-3581 — These two members are variants of one another: 36 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.
Near-duplicate member pair (34 shared lines) crates/temporal-runtime/src/gateway/http.rs:792— crates/temporal-runtime/src/gateway/http.rs:792-839 | crates/temporal-runtime/src/gateway/http.rs:849-894 — These two members are variants of one another: 34 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.
Duplicated block (39 lines × 2) crates/temporal-runtime/src/worker/activities/common.rs:180— crates/temporal-runtime/src/worker/activities/common.rs:180-218 | crates/test-support/src/runner/drive.rs:784-822 — before extracting anything, compare `crates/temporal-runtime/src/worker/activities/common.rs` and `crates/test-support/src/runner/drive.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 93 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 (32 lines × 2) crates/environments/src/memory.rs:231— crates/environments/src/memory.rs:231-262 | crates/environments/src/memory.rs:304-335 — 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 (27 lines × 2) crates/harness/src/core/components/tooling.rs:1544— crates/harness/src/core/components/tooling.rs:1544-1570 | crates/harness/src/core/components/tooling.rs:1575-1601 — 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 lines × 3) crates/llm-clients/src/openai/audio.rs:297— crates/llm-clients/src/openai/audio.rs:297-319 | crates/llm-clients/src/openai/completions.rs:832-854 | crates/llm-clients/src/openai/responses.rs:1246-1268 — before extracting anything, compare `crates/llm-clients/src/openai/audio.rs` and `crates/llm-clients/src/openai/completions.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 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 (23 lines × 2) crates/llm-runtime/src/openai_completions.rs:208— crates/llm-runtime/src/openai_completions.rs:208-230 | crates/llm-runtime/src/openai_responses.rs:194-216 — before extracting anything, compare `crates/llm-runtime/src/openai_completions.rs` and `crates/llm-runtime/src/openai_responses.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 120 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 (20 lines × 3) crates/environments/src/memory.rs:270— crates/environments/src/memory.rs:270-289 | crates/environments/src/memory.rs:343-362 | crates/environments/src/memory.rs:400-419 — 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 (19–20 lines × 2) crates/temporal-runtime/src/gateway/service/mcp_discovery.rs:656— crates/temporal-runtime/src/gateway/service/mcp_discovery.rs:656-674 | crates/temporal-runtime/src/gateway/service/mcp_discovery.rs:707-726 — 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–18 lines × 2) crates/llm-runtime/src/openai_completions.rs:191— crates/llm-runtime/src/openai_completions.rs:191-207 | crates/llm-runtime/src/openai_responses.rs:173-190 — before extracting anything, compare `crates/llm-runtime/src/openai_completions.rs` and `crates/llm-runtime/src/openai_responses.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 120 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) crates/temporal-runtime/src/worker/activities/storage.rs:386— crates/temporal-runtime/src/worker/activities/storage.rs:386-401 | crates/temporal-runtime/src/worker/activities/storage.rs:414-430 — 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 (16 lines × 3) crates/temporal-workflow/src/config.rs:177— crates/temporal-workflow/src/config.rs:177-192 | crates/temporal-workflow/src/workflows/bots/mod.rs:52-67 | crates/temporal-workflow/src/workflows/channels/mod.rs:43-58 — 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 (15–16 lines × 2) crates/harness/src/storage/session.rs:1474— crates/harness/src/storage/session.rs:1474-1489 | crates/store-fs/src/session.rs:539-553 — before extracting anything, compare `crates/harness/src/storage/session.rs` and `crates/store-fs/src/session.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 59 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 (11–15 lines × 2) crates/environment-daemon/src/filesystem.rs:520— crates/environment-daemon/src/filesystem.rs:520-534 | crates/environment-daemon/src/filesystem.rs:626-636 — 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 × 3) crates/environment-daemon/src/filesystem.rs:799— crates/environment-daemon/src/filesystem.rs:799-812 | crates/environment-daemon/src/jobs.rs:1384-1397 | crates/environment-daemon/src/process.rs:1126-1139 — before extracting anything, compare `crates/environment-daemon/src/jobs.rs` and `crates/environment-daemon/src/process.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12–13 lines × 3) crates/temporal-runtime/src/environments/lifecycle.rs:446— crates/temporal-runtime/src/environments/lifecycle.rs:446-458 | crates/temporal-runtime/src/environments/lifecycle.rs:540-551 | crates/temporal-runtime/src/environments/lifecycle.rs:592-604 — 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 (10–13 lines × 2) crates/llm-clients/src/openai/completions.rs:230— crates/llm-clients/src/openai/completions.rs:230-239 | crates/llm-clients/src/openai/responses.rs:197-209 — before extracting anything, compare `crates/llm-clients/src/openai/completions.rs` and `crates/llm-clients/src/openai/responses.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 4) crates/temporal-runtime/src/environments/lifecycle.rs:76— crates/temporal-runtime/src/environments/lifecycle.rs:76-87 | crates/temporal-runtime/src/environments/lifecycle.rs:449-460 | crates/temporal-runtime/src/environments/lifecycle.rs:542-553 | crates/temporal-runtime/src/environments/lifecycle.rs:595-606 — 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–12 lines × 3) crates/llm-runtime/src/anthropic_messages.rs:1475— crates/llm-runtime/src/anthropic_messages.rs:1475-1486 | crates/llm-runtime/src/openai_completions.rs:1195-1205 | crates/llm-runtime/src/openai_responses.rs:1096-1106 — before extracting anything, compare `crates/llm-runtime/src/anthropic_messages.rs` and `crates/llm-runtime/src/openai_completions.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–11 lines × 2) crates/llm-clients/src/openai/responses.rs:319— crates/llm-clients/src/openai/responses.rs:319-328 | crates/llm-clients/src/openai/responses.rs:339-349 — 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–10 lines × 8) crates/llm-clients/src/openai/responses.rs:208— crates/llm-clients/src/openai/responses.rs:208-216 | crates/llm-clients/src/openai/responses.rs:247-256 | crates/llm-clients/src/openai/responses.rs:271-280 | crates/llm-clients/src/openai/responses.rs:320-329 | crates/llm-clients/src/openai/responses.rs:341-350 | crates/llm-clients/src/openai/responses.rs:387-396 | crates/llm-clients/src/openai/responses.rs:413-422 | crates/llm-clients/src/openai/responses.rs:435-444 — 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.
Duplicated block (9–10 lines × 4) crates/harness/src/storage/session.rs:1381— crates/harness/src/storage/session.rs:1381-1390 | crates/store-fs/src/session.rs:425-433 | crates/store-pg/src/session.rs:101-109 | crates/store-pg/src/session.rs:1593-1602 — before extracting anything, compare `crates/harness/src/storage/session.rs` and `crates/store-fs/src/session.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 59 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 (8–9 lines × 3) crates/llm-clients/src/openai/responses.rs:269— crates/llm-clients/src/openai/responses.rs:269-276 | crates/llm-clients/src/openai/responses.rs:293-300 | crates/llm-clients/src/openai/responses.rs:410-418 — 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–9 lines × 2) crates/llm-runtime/src/anthropic_messages.rs:1017— crates/llm-runtime/src/anthropic_messages.rs:1017-1025 | crates/llm-runtime/src/openai_responses.rs:646-652 — before extracting anything, compare `crates/llm-runtime/src/anthropic_messages.rs` and `crates/llm-runtime/src/openai_responses.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 113 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 (7–8 lines × 3) crates/environment-daemon/src/filesystem.rs:306— crates/environment-daemon/src/filesystem.rs:306-312 | crates/tools/src/fs/local.rs:118-125 | crates/tools/src/fs/scoped_local.rs:238-245 — before extracting anything, compare `crates/tools/src/fs/local.rs` and `crates/tools/src/fs/scoped_local.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 128 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 (6–8 lines × 3) crates/llm-runtime/src/anthropic_messages.rs:1151— crates/llm-runtime/src/anthropic_messages.rs:1151-1158 | crates/llm-runtime/src/openai_completions.rs:847-852 | crates/llm-runtime/src/openai_responses.rs:757-762 — before extracting anything, compare `crates/llm-runtime/src/anthropic_messages.rs` and `crates/llm-runtime/src/openai_completions.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 76 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 (7–8 lines × 2) crates/cli/src/chat/tui/bottom_pane/list_selection.rs:209— crates/cli/src/chat/tui/bottom_pane/list_selection.rs:209-215 | crates/cli/src/chat/tui/bottom_pane/list_selection.rs:282-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 (156 lines × 2) crates/temporal-workflow/src/activities.rs:70— crates/temporal-workflow/src/activities.rs:70-348 | crates/temporal-workflow/src/workflows/bots/activities.rs:40-195 — 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 (48 lines × 2) crates/store-pg/src/mcp.rs:244— crates/store-pg/src/mcp.rs:244-296 | crates/store-pg/src/mcp.rs:337-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.
Duplicated block (31 lines × 3) crates/store-pg/src/auth.rs:246— crates/store-pg/src/auth.rs:246-279 | crates/store-pg/src/oauth.rs:76-106 | crates/store-pg/src/oauth.rs:214-244 — before extracting anything, compare `crates/store-pg/src/auth.rs` and `crates/store-pg/src/oauth.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 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 (9 lines × 6) crates/store-pg/src/auth.rs:452— crates/store-pg/src/auth.rs:452-466 | crates/store-pg/src/bots.rs:357-373 | crates/store-pg/src/channels.rs:282-291 | crates/store-pg/src/channels.rs:326-336 | crates/store-pg/src/environment.rs:1112-1120 | crates/store-pg/src/oauth.rs:321-337 — before extracting anything, compare `crates/store-pg/src/auth.rs` and `crates/store-pg/src/oauth.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 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 (9 lines × 7) crates/store-pg/src/auth.rs:452— crates/store-pg/src/auth.rs:452-466 | crates/store-pg/src/bots.rs:357-373 | crates/store-pg/src/bots.rs:1079-1088 | crates/store-pg/src/channels.rs:282-291 | crates/store-pg/src/channels.rs:326-336 | crates/store-pg/src/environment.rs:1112-1120 | crates/store-pg/src/oauth.rs:321-337 — before extracting anything, compare `crates/store-pg/src/auth.rs` and `crates/store-pg/src/oauth.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 7) crates/store-pg/src/auth.rs:319— crates/store-pg/src/auth.rs:319-330 | crates/store-pg/src/auth.rs:513-524 | crates/store-pg/src/oauth.rs:141-152 | crates/store-pg/src/oauth.rs:184-195 | crates/store-pg/src/oauth.rs:274-285 | crates/store-pg/src/providers.rs:86-97 | crates/store-pg/src/providers.rs:129-140 — before extracting anything, compare `crates/store-pg/src/auth.rs` and `crates/store-pg/src/oauth.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 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 (11 lines × 6) crates/store-pg/src/auth.rs:329— crates/store-pg/src/auth.rs:329-339 | crates/store-pg/src/auth.rs:400-410 | crates/store-pg/src/auth.rs:435-445 | crates/store-pg/src/auth.rs:465-475 | crates/store-pg/src/auth.rs:497-507 | crates/store-pg/src/auth.rs:523-533 — 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 (9 lines × 4) crates/store-pg/src/environment.rs:308— crates/store-pg/src/environment.rs:308-316 | crates/store-pg/src/environment.rs:415-423 | crates/store-pg/src/environment.rs:535-543 | crates/store-pg/src/environment.rs:611-619 — 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.
Low cohesion: ActivityState (LCOM4 5) crates/temporal-runtime/src/worker/activities/state.rs:117— ActivityState'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.
Duplication concentrated across 3 sibling directories (47 clone groups) platform/web/src/components/universe-switcher.tsx:118— 47 duplicated blocks under platform/web/src/ have copies in at least two of the sibling directories components, lib, pages — 22 of them are reported below, and 25 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 47 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 47 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 47 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 5 sibling directories (7 clone groups) platform/web/src/components/credentials/github-app.tsx:226— 7 duplicated blocks under platform/web/src/components/ have copies in at least two of the sibling directories bot, credentials, mcp, models, session — 3 of them are reported below, and 4 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 7 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 6 sibling directories (6 clone groups) platform/configurator-mcp/src/upstream-client.ts:74— 6 duplicated blocks under platform/ have copies in at least two of the sibling directories backend, cli, configurator-mcp, connectors, shared, web — 5 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication· Duplicated block with local edits (219 matched lines × 2 locations) · ×1
Duplicated block with local edits (219 matched lines × 2 locations) platform/web/src/pages/AdminApiKeysPage.tsx:69— platform/web/src/pages/AdminApiKeysPage.tsx:69 · platform/web/src/pages/ApiKeysPage.tsx:80 — the two spans are one implementation copied and then locally edited — 1359 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (136 matched lines × 2 locations) · ×1
Duplicated block with local edits (136 matched lines × 2 locations) platform/web/src/pages/ApiKeysPage.tsx:73— platform/web/src/pages/ApiKeysPage.tsx:73 · platform/web/src/pages/CredentialsPage.tsx:128 — the two spans are one implementation copied and then locally edited — 697 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (105 matched lines × 2 locations) · ×1
Duplicated block with local edits (105 matched lines × 2 locations) platform/web/src/components/ui/dialog.tsx:10— platform/web/src/components/ui/dialog.tsx:10 · platform/web/src/components/ui/sheet.tsx:8 — the two spans are one implementation copied and then locally edited — 462 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (70 matched lines × 2 locations) · ×1
Duplicated block with local edits (70 matched lines × 2 locations) platform/web/src/components/ui/combobox.tsx:122— platform/web/src/components/ui/combobox.tsx:122 · platform/web/src/components/ui/select.tsx:103 — the two spans are one implementation copied and then locally edited — 257 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (61 matched lines × 2 locations) · ×1
Duplicated block with local edits (61 matched lines × 2 locations) platform/web/src/components/credentials/github-app.tsx:226— platform/web/src/components/credentials/github-app.tsx:226 · platform/web/src/components/models/subscription.tsx:158 — the two spans are one implementation copied and then locally edited — 372 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (58 matched lines × 2 locations) · ×1
Duplicated block with local edits (58 matched lines × 2 locations) platform/connectors/src/presentation/telegram.ts:24— platform/connectors/src/presentation/telegram.ts:24 · platform/connectors/src/presentation/whatsapp.ts:19 — the two spans are one implementation copied and then locally edited — 376 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (52 matched lines × 2 locations) · ×1
Duplicated block with local edits (52 matched lines × 2 locations) platform/web/src/components/models/model-api-key.tsx:242— platform/web/src/components/models/model-api-key.tsx:242 · platform/web/src/components/models/model-api-key.tsx:573 — the two spans are one implementation copied and then locally edited — 299 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (48 lines × 2 locations) platform/web/src/pages/ProfilesPage.tsx:688— platform/web/src/pages/ProfilesPage.tsx:688 · platform/web/src/pages/WorkspacesPage.tsx:651 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication· Duplicated block with local edits (40 matched lines × 2 locations) · ×1
Duplicated block with local edits (40 matched lines × 2 locations) platform/web/src/components/universe-switcher.tsx:118— platform/web/src/components/universe-switcher.tsx:118 · platform/web/src/pages/WorkspacesPage.tsx:605 — the two spans are one implementation copied and then locally edited — 263 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (36 lines × 2 locations) platform/connectors/src/providers/telegram/delivery.ts:37— platform/connectors/src/providers/telegram/delivery.ts:37 · platform/connectors/src/providers/whatsapp/delivery.ts:38 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (35 matched lines × 2 locations) · ×1
Duplicated block with local edits (35 matched lines × 2 locations) platform/web/src/pages/ProfilesPage.tsx:576— platform/web/src/pages/ProfilesPage.tsx:576 · platform/web/src/pages/SessionsPage.tsx:1230 — the two spans are one implementation copied and then locally edited — 216 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (33 lines × 2 locations) platform/web/src/components/ui/dropdown-menu.tsx:19— platform/web/src/components/ui/dropdown-menu.tsx:19 · platform/web/src/components/ui/popover.tsx:14 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication· Duplicated block with local edits (28 matched lines × 2 locations) · ×1
Duplicated block with local edits (28 matched lines × 2 locations) platform/web/src/components/models/model-api-key.tsx:124— platform/web/src/components/models/model-api-key.tsx:124 · platform/web/src/components/models/subscription.tsx:76 — the two spans are one implementation copied and then locally edited — 155 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (26 lines × 2 locations) platform/web/src/pages/SessionsPage.tsx:460— platform/web/src/pages/SessionsPage.tsx:460 · platform/web/src/pages/SessionsPage.tsx:515 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (25 lines × 3 locations) platform/web/src/components/workspace-transfers.tsx:767— platform/web/src/components/workspace-transfers.tsx:767 · platform/web/src/components/workspace-transfers.tsx:832 · platform/web/src/components/workspace-transfers.tsx:984 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (23 lines × 2 locations) platform/web/src/components/credentials/github-app.tsx:180— platform/web/src/components/credentials/github-app.tsx:180 · platform/web/src/components/models/model-api-key.tsx:547 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication· Duplicated block with local edits (23 matched lines × 2 locations) · ×1
Duplicated block with local edits (23 matched lines × 2 locations) platform/web/src/pages/MembersPage.tsx:150— platform/web/src/pages/MembersPage.tsx:150 · platform/web/src/pages/ProfilesPage.tsx:371 — the two spans are one implementation copied and then locally edited — 99 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (22 lines × 3 locations) platform/web/src/components/ui/dropdown-menu.tsx:7— platform/web/src/components/ui/dropdown-menu.tsx:7 · platform/web/src/components/ui/popover.tsx:6 · platform/web/src/components/ui/tooltip.tsx:20 — the 3 copies are spread across 3 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (21 lines × 2 locations) platform/backend/src/routes/gateway.ts:2049— platform/backend/src/routes/gateway.ts:2049 · platform/backend/src/routes/gateway.ts:2079 — 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 (19 lines × 2 locations) platform/backend/src/routes/gateway.ts:650— platform/backend/src/routes/gateway.ts:650 · platform/backend/src/routes/gateway.ts:674 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (19 matched lines × 2 locations) · ×1
Duplicated block with local edits (19 matched lines × 2 locations) platform/web/src/components/confirm-danger-button.tsx:30— platform/web/src/components/confirm-danger-button.tsx:30 · platform/web/src/pages/GeneralSettingsPage.tsx:253 — the two spans are one implementation copied and then locally edited — 70 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (17 lines × 2 locations) platform/web/src/components/session/session-config-editor.tsx:1590— platform/web/src/components/session/session-config-editor.tsx:1590 · platform/web/src/components/session/session-config-editor.tsx:1607 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (17 lines × 3 locations) platform/web/src/components/workspace-transfers.tsx:728— platform/web/src/components/workspace-transfers.tsx:728 · platform/web/src/components/workspace-transfers.tsx:805 · platform/web/src/components/workspace-transfers.tsx:954 — 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 (15 lines × 2 locations) platform/scripts/generate-config-reference.mjs:51— platform/scripts/generate-config-reference.mjs:51 · platform/scripts/generate-config-reference.mjs:83 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Boundary violation [package:test-suite-dependency] REDACTED:6— REDACTED:6 imports platform/backend/test/identity-fixture.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
Complex function SessionDetail (cyclomatic 96, cognitive 83) platform/web/src/pages/SessionsPage.tsx:1303— SessionDetail has cyclomatic complexity 96 and cognitive complexity 83; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 82, cognitive 118) platform/backend/src/auth.ts:119— (anonymous) has cyclomatic complexity 82 and cognitive complexity 118; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function ServerDialog (cyclomatic 72, cognitive 63) platform/web/src/pages/McpServersPage.tsx:359— ServerDialog has cyclomatic complexity 72 and cognitive complexity 63; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function configError (cyclomatic 68, cognitive 93) platform/web/src/components/session/session-config-editor.tsx:412— configError has cyclomatic complexity 68 and cognitive complexity 93; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function Wizard (cyclomatic 57, cognitive 52) platform/web/src/pages/BotCreatePage.tsx:142— Wizard has cyclomatic complexity 57 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function SessionComposer (cyclomatic 57, cognitive 50) platform/web/src/components/session/composer.tsx:51— SessionComposer has cyclomatic complexity 57 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function WorkspaceTransfers (cyclomatic 57, cognitive 44) platform/web/src/components/workspace-transfers.tsx:93— WorkspaceTransfers has cyclomatic complexity 57 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function applyEvents (cyclomatic 55, cognitive 60) platform/web/src/lib/sessions/transcript.ts:257— applyEvents has cyclomatic complexity 55 and cognitive complexity 60; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function normalizeSessionConfig (cyclomatic 53, cognitive 121) platform/web/src/components/session/session-config-editor.tsx:253— normalizeSessionConfig has cyclomatic complexity 53 and cognitive complexity 121; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function createPlan (cyclomatic 52, cognitive 53) REDACTED:190— createPlan has cyclomatic complexity 52 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function LiveSessionSetup (cyclomatic 49, cognitive 38) platform/web/src/components/session/session-settings-sheet.tsx:94— LiveSessionSetup has cyclomatic complexity 49 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function NewSessionDialog (cyclomatic 47, cognitive 37) platform/web/src/pages/SessionsPage.tsx:921— NewSessionDialog has cyclomatic complexity 47 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function applyNonToolCallItem (cyclomatic 45, cognitive 72) platform/web/src/lib/sessions/transcript.ts:735— applyNonToolCallItem has cyclomatic complexity 45 and cognitive complexity 72; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function OtherBotsSection (cyclomatic 41, cognitive 36) platform/web/src/components/bot/setup.tsx:791— OtherBotsSection has cyclomatic complexity 41 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function SessionList (cyclomatic 40, cognitive 38) platform/web/src/pages/SessionsPage.tsx:195— SessionList has cyclomatic complexity 40 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function EnvironmentCard (cyclomatic 39, cognitive 31) platform/web/src/pages/EnvironmentsPage.tsx:293— EnvironmentCard has cyclomatic complexity 39 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function SessionResourceChips (cyclomatic 38, cognitive 37) platform/web/src/components/session/session-resources.tsx:70— SessionResourceChips has cyclomatic complexity 38 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function EventRow (cyclomatic 36, cognitive 30) platform/web/src/components/bot/activity.tsx:319— EventRow has cyclomatic complexity 36 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function applyItems (cyclomatic 35, cognitive 56) platform/web/src/lib/sessions/transcript.ts:642— applyItems has cyclomatic complexity 35 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function ToolPicker (cyclomatic 34, cognitive 31) platform/web/src/components/mcp/tool-picker.tsx:48— ToolPicker has cyclomatic complexity 34 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files· platform/web/src/components/bot/triggers.tsx · ×1
platform/web/src/components/bot/triggers.tsx: 2563 lines of code platform/web/src/components/bot/triggers.tsx:1— platform/web/src/components/bot/triggers.tsx has 2563 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/pages/SessionsPage.tsx · ×1
platform/web/src/pages/SessionsPage.tsx: 2452 lines of code platform/web/src/pages/SessionsPage.tsx:1— platform/web/src/pages/SessionsPage.tsx has 2452 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/backend/src/routes/gateway.ts · ×1
platform/backend/src/routes/gateway.ts: 2316 lines of code platform/backend/src/routes/gateway.ts:1— platform/backend/src/routes/gateway.ts has 2316 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/components/session/session-config-editor.tsx · ×1
platform/web/src/components/session/session-config-editor.tsx: 2171 lines of code platform/web/src/components/session/session-config-editor.tsx:1— platform/web/src/components/session/session-config-editor.tsx has 2171 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/pages/EnvironmentsPage.tsx · ×1
platform/web/src/pages/EnvironmentsPage.tsx: 1415 lines of code platform/web/src/pages/EnvironmentsPage.tsx:1— platform/web/src/pages/EnvironmentsPage.tsx has 1415 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/pages/McpServersPage.tsx · ×1
platform/web/src/pages/McpServersPage.tsx: 1327 lines of code platform/web/src/pages/McpServersPage.tsx:1— platform/web/src/pages/McpServersPage.tsx has 1327 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/components/workspace-transfers.tsx · ×1
platform/web/src/components/workspace-transfers.tsx: 1299 lines of code platform/web/src/components/workspace-transfers.tsx:1— platform/web/src/components/workspace-transfers.tsx has 1299 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/lib/sessions/transcript.ts · ×1
platform/web/src/lib/sessions/transcript.ts: 1150 lines of code platform/web/src/lib/sessions/transcript.ts:1— platform/web/src/lib/sessions/transcript.ts has 1150 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/components/bot/setup.tsx · ×1
platform/web/src/components/bot/setup.tsx: 1079 lines of code platform/web/src/components/bot/setup.tsx:1— platform/web/src/components/bot/setup.tsx has 1079 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/components/models/model-api-key.tsx · ×1
platform/web/src/components/models/model-api-key.tsx: 881 lines of code platform/web/src/components/models/model-api-key.tsx:1— platform/web/src/components/models/model-api-key.tsx has 881 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/pages/WorkspacesPage.tsx · ×1
platform/web/src/pages/WorkspacesPage.tsx: 859 lines of code platform/web/src/pages/WorkspacesPage.tsx:1— platform/web/src/pages/WorkspacesPage.tsx has 859 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/pages/BotCreatePage.tsx · ×1
platform/web/src/pages/BotCreatePage.tsx: 847 lines of code platform/web/src/pages/BotCreatePage.tsx:1— platform/web/src/pages/BotCreatePage.tsx has 847 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/pages/ProfilesPage.tsx · ×1
platform/web/src/pages/ProfilesPage.tsx: 785 lines of code platform/web/src/pages/ProfilesPage.tsx:1— platform/web/src/pages/ProfilesPage.tsx has 785 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/pages/CredentialsPage.tsx · ×1
platform/web/src/pages/CredentialsPage.tsx: 697 lines of code platform/web/src/pages/CredentialsPage.tsx:1— platform/web/src/pages/CredentialsPage.tsx has 697 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/components/ui/sidebar.tsx · ×1
platform/web/src/components/ui/sidebar.tsx: 673 lines of code platform/web/src/components/ui/sidebar.tsx:1— platform/web/src/components/ui/sidebar.tsx has 673 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
platform/web/src/api.ts: 670 lines of code platform/web/src/api.ts:1— platform/web/src/api.ts has 670 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/pages/AdminEnvironmentProvidersPage.tsx · ×1
platform/web/src/pages/AdminEnvironmentProvidersPage.tsx: 609 lines of code platform/web/src/pages/AdminEnvironmentProvidersPage.tsx:1— platform/web/src/pages/AdminEnvironmentProvidersPage.tsx has 609 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/backend/src/routes/universes.ts · ×1
platform/backend/src/routes/universes.ts: 598 lines of code platform/backend/src/routes/universes.ts:1— platform/backend/src/routes/universes.ts has 598 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/components/session/session-settings-sheet.tsx · ×1
platform/web/src/components/session/session-settings-sheet.tsx: 578 lines of code platform/web/src/components/session/session-settings-sheet.tsx:1— platform/web/src/components/session/session-settings-sheet.tsx has 578 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/pages/ChannelsPage.tsx · ×1
platform/web/src/pages/ChannelsPage.tsx: 532 lines of code platform/web/src/pages/ChannelsPage.tsx:1— platform/web/src/pages/ChannelsPage.tsx has 532 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/components/session/tool-trace.tsx · ×1
platform/web/src/components/session/tool-trace.tsx: 505 lines of code platform/web/src/components/session/tool-trace.tsx:1— platform/web/src/components/session/tool-trace.tsx has 505 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/backend/src/routes/setups.ts · ×1
platform/backend/src/routes/setups.ts: 486 lines of code platform/backend/src/routes/setups.ts:1— platform/backend/src/routes/setups.ts has 486 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/pages/AdminUsersPage.tsx · ×1
platform/web/src/pages/AdminUsersPage.tsx: 484 lines of code platform/web/src/pages/AdminUsersPage.tsx:1— platform/web/src/pages/AdminUsersPage.tsx has 484 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/components/bot/detail.tsx · ×1
platform/web/src/components/bot/detail.tsx: 462 lines of code platform/web/src/components/bot/detail.tsx:1— platform/web/src/components/bot/detail.tsx has 462 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/components/bot/activity.tsx · ×1
platform/web/src/components/bot/activity.tsx: 459 lines of code platform/web/src/components/bot/activity.tsx:1— platform/web/src/components/bot/activity.tsx has 459 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/pages/AdminUniversesPage.tsx · ×1
platform/web/src/pages/AdminUniversesPage.tsx: 458 lines of code platform/web/src/pages/AdminUniversesPage.tsx:1— platform/web/src/pages/AdminUniversesPage.tsx has 458 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/components/session/composer.tsx · ×1
platform/web/src/components/session/composer.tsx: 442 lines of code platform/web/src/components/session/composer.tsx:1— platform/web/src/components/session/composer.tsx has 442 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/web/src/components/session/transcript-view.tsx · ×1
platform/web/src/components/session/transcript-view.tsx: 415 lines of code platform/web/src/components/session/transcript-view.tsx:1— platform/web/src/components/session/transcript-view.tsx has 415 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· platform/shared/src/workspace-transfers.ts · ×1
platform/shared/src/workspace-transfers.ts: 413 lines of code platform/shared/src/workspace-transfers.ts:1— platform/shared/src/workspace-transfers.ts has 413 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Dead file (~20 LoC) platform/db/scripts/auth-codegen.ts— no import path from any entry point (44 application, 13 tooling, 160 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~18 LoC) platform/db/scripts/patch-auth-schema.mjs— no import path from any entry point (44 application, 13 tooling, 160 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~6 LoC) platform/connectors/src/providers/whatsapp/index.ts— no import path from any entry point (44 application, 13 tooling, 160 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~5 LoC) platform/connectors/src/providers/telegram/index.ts— no import path from any entry point (44 application, 13 tooling, 160 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Unlisted import '@modelcontextprotocol/sdk' platform/configurator-mcp/src/tool-result.ts:5— Imported only as a TYPE and declared in no reachable package.json. The import is erased at compile time, so nothing is installed and no runtime resolution depends on it — but type-checking a clean clone will fail. Declare the typings it resolves through (or the package itself) in the owning package.json.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×1
Recursive walk over a caller-supplied document has no depth cap platform/web/src/components/session/reply-copy.ts:110— `replyFormatted` is exported, takes a document from its caller (line 78) and hands it to `plain`, which calls itself at line 110 (`plain`) with a piece of `node` — and nowhere in `plain` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `plain` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Swallowed exception (caught, then discarded) platform/web/src/lib/audio-capture.ts:37— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, 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.
README/code drift README.md:141— README advertises Kubernetes, but no Kubernetes manifest or chart exists — searched for: `kubernetes`, `k8s`, `helm`. Each was matched case- and separator-insensitively against file and directory NAMES anywhere in the tree, and against the CONTENTS of manifest and configuration files (package.json and other *.json, *.csproj, *.props, *.sln/*.slnx, *.yml, *.toml, *.config, tool configs such as eslint.config.js, Dockerfile); the README's own prose never counts, so a claim is never refuted by merely being made. Nothing outside that search was read — a footprint living only in a submodule, in a file type not listed here, or under a name none of those terms matches is not seen, and this row is then wrong.
README/code drift crates/auth/README.md:70— crates/auth/README.md names `auth/grants/import`, but no file or folder `auth/grants/import` exists. 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/documentation/access-and-security/api-keys-and-service-access.md:47— docs/documentation/access-and-security/api-keys-and-service-access.md names `session/delete`, but no file or folder `session/delete` exists. 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/documentation/access-and-security/api-keys-and-service-access.md:51— docs/documentation/access-and-security/api-keys-and-service-access.md names `deployment/sessions`, but no file or folder `deployment/sessions` exists. 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/documentation/access-and-security/api-keys-and-service-access.md:190— docs/documentation/access-and-security/api-keys-and-service-access.md names `deployment/channels`, but no file or folder `deployment/channels` exists. 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/documentation/access-and-security/api-keys-and-service-access.md:190— docs/documentation/access-and-security/api-keys-and-service-access.md names `channels/inbound`, but no file or folder `channels/inbound` exists. 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/documentation/access-and-security/api-keys-and-service-access.md:190— docs/documentation/access-and-security/api-keys-and-service-access.md names `auth/lease`, but no file or folder `auth/lease` exists. 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/documentation/access-and-security/single-sign-on.md:34— docs/documentation/access-and-security/single-sign-on.md documents the environment variable `LIGHTSPEED_PLATFORM_OIDC_GROUPS_CLAIM`, but no code, script or configuration file names it. 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/documentation/access-and-security/single-sign-on.md:125— docs/documentation/access-and-security/single-sign-on.md documents the environment variable `LIGHTSPEED_PLATFORM_OIDC_SESSION_MAX_AGE_SECONDS`, but no code, script or configuration file names it. 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/documentation/deployment/configuration.md:191— docs/documentation/deployment/configuration.md names `deployment/channels`, but no file or folder `deployment/channels` exists. 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/documentation/deployment/configuration.md:191— docs/documentation/deployment/configuration.md names `auth/lease`, but no file or folder `auth/lease` exists. 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/documentation/deployment/configuration.md:191— docs/documentation/deployment/configuration.md names `channels/inbound`, but no file or folder `channels/inbound` exists. 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/documentation/deployment/operations.md:190— docs/documentation/deployment/operations.md documents the environment variable `LIGHTSPEED_RELEASE_ID`, but no code, script or configuration file names it. 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/documentation/deployment/self-hosting.md:57— docs/documentation/deployment/self-hosting.md documents the environment variable `LIGHTSPEED_RELEASE_TAG`, but no code, script or configuration file names it. 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/documentation/deployment/self-hosting.md:69— docs/documentation/deployment/self-hosting.md documents the environment variable `LIGHTSPEED_RELEASE_ID`, but no code, script or configuration file names it. 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/documentation/deployment/self-hosting.md:91— docs/documentation/deployment/self-hosting.md documents the environment variable `RELEASE_REF`, but no code, script or configuration file names it. 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/documentation/deployment/self-hosting.md:400— docs/documentation/deployment/self-hosting.md documents the environment variable `LIGHTSPEED_ARCHIVE`, but no code, script or configuration file names it. 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/documentation/deployment/self-hosting.md:402— docs/documentation/deployment/self-hosting.md documents the environment variable `LIGHTSPEED_ARCHIVE_SHA`, but no code, script or configuration file names it. 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/documentation/development/local-development.md:71— docs/documentation/development/local-development.md names `deployment/universes`, but no file or folder `deployment/universes` exists. 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/documentation/environments/bring-your-own-compute.md:40— docs/documentation/environments/bring-your-own-compute.md documents the environment variable `LIGHTSPEED_ENVD_BIN`, but no code, script or configuration file names it. 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/documentation/environments/credentials.md:30— docs/documentation/environments/credentials.md documents the environment variable `ACORN_RELEASE_TOKEN`, but no code, script or configuration file names it. 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/documentation/environments/credentials.md:178— docs/documentation/environments/credentials.md names `environments/credentials/bind`, but no file or folder `environments/credentials/bind` exists. 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/documentation/environments/incus-vms.md:61— docs/documentation/environments/incus-vms.md documents the environment variable `LIGHTSPEED_CHECKOUT`, but no code, script or configuration file names it. 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/documentation/environments/incus-vms.md:62— docs/documentation/environments/incus-vms.md documents the environment variable `LIGHTSPEED_IMAGE_WORKDIR`, but no code, script or configuration file names it. 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/documentation/environments/power-and-cleanup.md:220— docs/documentation/environments/power-and-cleanup.md names `environments/power/put`, but no file or folder `environments/power/put` exists. 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.
Duplicated predicate platform/connectors/src/providers/telegram/delivery.ts:156— `!Number.isSafeInteger(parsed) || parsed <= 0` appears character-identically in 2 files — platform/connectors/src/providers/telegram/delivery.ts, platform/connectors/src/providers/telegram/presence.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate platform/web/src/pages/ChannelsPage.tsx:73— `!universe || !permissions.can("configure_resource")` appears character-identically in 3 files — platform/web/src/pages/ChannelsPage.tsx, platform/web/src/pages/CredentialsPage.tsx, platform/web/src/pages/SetupsPage.tsx. 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 platform/web/src/pages/ApiKeysPage.tsx:56— `!universe || !permissions.can("manage_access")` appears character-identically in 2 files — platform/web/src/pages/ApiKeysPage.tsx, platform/web/src/pages/GeneralSettingsPage.tsx. 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 platform/web/src/pages/AdminApiKeysPage.tsx:74— `Number(a.revokedAtMs != null) - Number(b.revokedAtMs != null) || b.createdAtMs - a.createdAtMs` appears character-identically in 2 files — platform/web/src/pages/AdminApiKeysPage.tsx, platform/web/src/pages/ApiKeysPage.tsx. 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 platform/web/src/lib/sessions/run-sections.ts:193— `call.isError || call.status === "failed" || call.status === "unavailable"` appears character-identically in 2 files — platform/web/src/lib/sessions/run-sections.ts, platform/web/src/lib/sessions/transcript.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate platform/web/src/lib/sessions/run-sections.ts:112— `entry.kind === "message" && entry.role === "user" && !entry.steering` appears character-identically in 2 files — platform/web/src/lib/sessions/run-sections.ts, platform/web/src/pages/SessionsPage.tsx. 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 platform/backend/src/routes/gateway.ts:1155— `error instanceof LightspeedRpcError && error.kind === "not_found"` appears character-identically in 2 files — platform/backend/src/routes/gateway.ts, platform/backend/src/routes/setups.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate platform/web/src/components/credentials/github-app.tsx:382— `status === "needsReauth" || status === "failed"` appears character-identically in 3 files — platform/web/src/components/credentials/github-app.tsx, platform/web/src/components/models/subscription.tsx, platform/web/src/pages/CredentialsPage.tsx. 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 platform/backend/src/routes/bots.ts:23— `typeof body === "object" && body !== null` appears character-identically in 2 files — platform/backend/src/routes/bots.ts, platform/backend/src/routes/channel-accounts.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate clients/typescript/scripts/generate.mjs:97— `typeof entry.description !== "string" || entry.description.trim().length === 0` appears character-identically in 2 files — clients/typescript/scripts/generate.mjs, REDACTED. 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 clients/typescript/scripts/generate.mjs:93— `typeof entry.summary !== "string" || entry.summary.trim().length === 0` appears character-identically in 2 files — clients/typescript/scripts/generate.mjs, REDACTED. 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 clients/typescript/src/workflow.ts:398— `typeof value !== "object" || value === null || Array.isArray(value)` appears character-identically in 2 files — clients/typescript/src/workflow.ts, platform/connectors/src/media/inbound.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate clients/typescript/src/workflow.ts:456— `typeof value !== "string" || value.length === 0` appears character-identically in 2 files — clients/typescript/src/workflow.ts, platform/connectors/src/media/inbound.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate clients/typescript/src/client.ts:312— `typeof value === "object" && value !== null && !Array.isArray(value)` appears character-identically in 2 files — clients/typescript/src/client.ts, platform/backend/src/subscriptions.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate platform/backend/src/subscriptions.ts:166— `typeof value === "string" && value.trim()` appears character-identically in 2 files — platform/backend/src/subscriptions.ts, platform/web/src/lib/sessions/transcript.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate platform/web/src/components/session/session-settings-sheet.tsx:598— `value && typeof value === "object" && !Array.isArray(value)` appears character-identically in 3 files — platform/web/src/components/session/session-settings-sheet.tsx, platform/web/src/lib/sessions/resource-features.ts, platform/web/src/lib/sessions/session-resources.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/harness/src/storage/session.rs:933— `!request.cascade && !descendants.is_empty()` appears character-identically in 2 files — crates/harness/src/storage/session.rs, crates/store-fs/src/session.rs. 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 crates/auth/src/providers.rs:187— `!url.username().is_empty() || url.password().is_some()` appears character-identically in 4 files — crates/auth/src/providers.rs, crates/environment-daemon/src/upgrade.rs, crates/llm-clients/src/transport/http.rs, crates/tools/src/web/guard.rs. 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 crates/harness/src/storage/blobs.rs:170— `chunk.len() > 256 * 1024 || bytes.len() as u64 + chunk.len() as u64 > size` appears character-identically in 2 files — crates/harness/src/storage/blobs.rs, crates/store-pg/src/blob.rs. 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 crates/store-fs/src/blob.rs:148— `chunk.len() > 256 * 1024 || length > size` appears character-identically in 2 files — crates/store-fs/src/blob.rs, crates/store-pg/src/object.rs. 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 crates/temporal-workflow/src/workflows/environment_job.rs:39— `ctx.workflow_id() != start.execution_id || start.universe_id != start.invocation.session_universe_id` appears character-identically in 2 files — crates/temporal-workflow/src/workflows/environment_job.rs, crates/temporal-workflow/src/workflows/subagent_execution.rs. 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 crates/cli/src/chat/tui/cell.rs:464— `current_width > 0 && current_width.saturating_add(ch_width) > width` appears character-identically in 2 files — crates/cli/src/chat/tui/cell.rs, crates/cli/src/chat/tui/markdown.rs. 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 crates/llm-clients/src/openai/audio.rs:322— `err.is_timeout() || err.is_connect() || err.is_request()` appears character-identically in 2 files — crates/llm-clients/src/openai/audio.rs, crates/llm-clients/src/openai/responses.rs. 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 crates/tools/src/fs/local.rs:133— `error.kind() == io::ErrorKind::NotFound && options.force` appears character-identically in 2 files — crates/tools/src/fs/local.rs, crates/tools/src/fs/scoped_local.rs. 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 crates/mcp/src/lib.rs:550— `expected_revision && current.revision != expected` appears character-identically in 5 files — crates/mcp/src/lib.rs, crates/store-pg/src/bots.rs, crates/store-pg/src/channels.rs, crates/store-pg/src/mcp.rs. 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.
Silent fallback default in catch platform/web/src/components/bot/triggers.tsx:166— `localTimezone` swallows every exception into `return "UTC"` — 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 platform/web/src/demo/routes/common.ts:26— `readBody` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch platform/web/src/lib/composer-attachments.ts:77— `restore` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch platform/web/src/lib/composer-model.ts:99— `readRunChoice` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch platform/web/src/lib/sessions/draft.ts:9— `readSessionDraft` swallows every exception into `return ""` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch platform/web/src/lib/sessions/list-preferences.ts:119— `readSessionMetadataFilter` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Documentation: contradicts the code docs/site/README.md— The site's 'Build' command installs adapter tests, Astro diagnostics, build, and link checks but the referenced Rust crates (e.g. crates/auth) have changed since the docs-site README was written. Ensure the site's dev.sh commands point to the latest committed Rust crates.
Documentation: written for insiders docs/roadmap/p169-immutable-artifacts.md— The 'Status: implementation started, 2026-09-09.' line and the roadmap note "This follows the [VFS expansion freeze](p166-vfs-environment-transfer.md#vfs-expansion-freeze)." refer to a VFS workspace/mount integration that is no longer present in the codebase. Update the roadmap reference to point at the current immutable-artifact implementation, or remove the stale roadmap note.
Documentation: written for insiders docs/roadmap/p170-filesystem-working-directories-and-sources.md— The 'Status: implemented, 2026-09-11.' line and the roadmap note "This builds on [environment catalogs](p168-environment-skill-catalogs.md)." refer to environment catalog integration that no longer exists. Verify the roadmap references are current against the codebase or correct them.
Silent fallback default on Err crates/environment-daemon/src/process.rs:1145— `sample_group_members` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. 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 arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/environment-daemon/src/process.rs:1197— `sample_group_members` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. 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 arm or in the doc comment, and the row stops firing.
Subsumed condition operand crates/llm-clients/src/error.rs:278— `haystack.contains("insufficient_quota")` can never decide this `||` — every value satisfying `haystack.contains("insufficient_quota")` also satisfies `haystack.contains("quota")`, 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 crates/llm-runtime/src/compaction.rs:510— `message.contains("32-call budget")` can never decide this `||` — every value satisfying `message.contains("32-call budget")` also satisfies `message.contains("call budget")`, 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.
C4 · Data Retention· Partial data-retention evidence · ×1
Partial data-retention evidence — A retention mechanism is present, but the data-lifecycle is not yet complete — missing: an expiry limit — a declared maximum age / TTL after which the data is no longer kept, a documented retention period / data-expiry.
No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
Split crates/harness — Huge 34k LoC harness covering 5 namespaces is a sprawling grab-bag. Suggested: split into the five core components (components/session/storage/core) it names
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P10 · Library API & versioning· Large public API surface · ×1
Large public API surface — 1942/2328 types (83%) declared in the published library are public. For a library, every public type is a stability contract — keep implementation types off the surface and expose only the intended API.
Logging is not universal — Only 6/17 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `crates/api`, `crates/cli`, `crates/environment-daemon`, `crates/environment-provider-incus`, `crates/eval` and 6 more.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
R7 · Dead Code· Unused export 'MAX_CHANNEL_MEDIA_PER_MESSAGE' · ×1
Unused export 'MAX_CHANNEL_MEDIA_PER_MESSAGE' platform/connectors/src/media/inbound.ts:4— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'idIsRedundant' · ×1
Unused export 'idIsRedundant' platform/web/src/components/bot/identity.ts:16— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'BotStatusBadge' · ×1
Unused export 'BotStatusBadge' platform/web/src/components/bot/status.tsx:74— Nothing imports this binding — it is safe to review for removal.
No security response headers detected — None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `axum::serve(` (crates/environment-provider-incus/src/server.rs:60).
X2 · Cancellation propagation· Not all async functions that make a request accept an AbortSignal · ×1
Not all async functions that make a request accept an AbortSignal — Only 4/9 async functions that make a cancellable request (fetch, axios, ky, ofetch) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types· Strict null checking is not enabled everywhere the repository type-checks · ×1
Strict null checking is not enabled everywhere the repository type-checks — 7/8 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
Null assertions (`!`) reduce the strict null checking score — ~2.0 `!` null assertions per 1k TypeScript source lines — 106 assertion(s) across the 54338 source line(s) of the 262 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: REDACTED (7), platform/web/src/pages/SessionsPage.tsx (7), platform/web/src/pages/WorkspacesPage.tsx (7). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
Outdated: libc — `libc` is locked at 0.2.190 but 0.2.191 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in crates/environment-daemon/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p libc` and commit the updated REDACTED.
Outdated: pulldown-cmark — `pulldown-cmark` is locked at 0.13.4 but 0.13.5 is the current stable release on crates.io, and it already satisfies the `"0.13"` requirement declared in crates/cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p pulldown-cmark` and commit the updated REDACTED.
Outdated: rmcp — `rmcp` is locked at 3.5.0 but 3.6.0 is the current stable release on crates.io, and it already satisfies the `"3.1.4"` requirement declared in crates/auth/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rmcp` and commit the updated REDACTED.
Outdated: rustls — `rustls` is locked at 0.23.45 but 0.23.46 is the current stable release on crates.io, and it already satisfies the `"0.23"` requirement declared in crates/environment-daemon/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rustls` and commit the updated REDACTED.
Outdated: schemars — `schemars` is locked at 1.2.2 but 1.2.3 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p schemars` and commit the updated REDACTED.
Outdated: serde_json — `serde_json` is locked at 1.0.151 but 1.0.154 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/api-projection/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde_json` and commit the updated REDACTED.
Outdated: sha2 — `sha2` is locked at 0.11.0 but 0.11.1 is the current stable release on crates.io, and it already satisfies the `"0.11"` requirement declared in crates/auth/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p sha2` and commit the updated REDACTED.
Outdated: temporalio-client — `temporalio-client` is locked at 1.0.0 but 1.1.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/temporal-runtime/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p temporalio-client` and commit the updated REDACTED.
Outdated: temporalio-common — `temporalio-common` is locked at 1.0.0 but 1.1.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/temporal-runtime/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p temporalio-common` and commit the updated REDACTED.
Outdated: temporalio-macros — `temporalio-macros` is locked at 1.0.0 but 1.1.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/temporal-runtime/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p temporalio-macros` and commit the updated REDACTED.
Outdated: temporalio-sdk — `temporalio-sdk` is locked at 1.0.0 but 1.1.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/temporal-runtime/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p temporalio-sdk` and commit the updated REDACTED.
Outdated: temporalio-workflow — `temporalio-workflow` is locked at 1.0.0 but 1.1.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/temporal-runtime/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p temporalio-workflow` and commit the updated REDACTED.
Outdated: tokio — `tokio` is locked at 1.53.2 but 1.54.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/auth/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio` and commit the updated REDACTED.
Outdated: uuid — `uuid` is locked at 1.27.0 but 1.28.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p uuid` and commit the updated REDACTED.
Outdated: webpki-roots — `webpki-roots` is locked at 1.0.9 but 1.0.10 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in crates/environment-daemon/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p webpki-roots` and commit the updated REDACTED.
Off the main sequence: @lightspeed-ai/platform-shared — @lightspeed-ai/platform-shared: abstractness 0.00, instability 0.00, distance 1.00 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
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 4 file(s) — `clients/typescript/src/index.ts`, `clients/typescript/src/workflow.ts`, `platform/shared/src/index.ts`, `platform/web/src/components/models/model-defaults.tsx` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a16398-02ef-72ec-bb59-69aad826b375 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 40 · Warnings: 1361 · Recommendations: 98 · Info: 16 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 22-10-2026 @ 12:31 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.