Public report of astrid-runtime/astrid, published 27 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 report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 27 October 2026, 04:34 UTC · Survey ID cd_16f38ac078ff4a6984cf6eb6189c495d

astrid-runtime/astrid

Measured 27 October 2026, 04:31 UTC, at code version 7c3f2ca

Regression: 1 dimension fell since the last survey

A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.

CAI score 49out of 100 Weak
CriticalWeakAdequateStrongExemplary
Down 1 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: 374,986 lines of product code in 33 projects, tests not counted · Estimated rebuild effort: about 3.0 person-years · Weakest lens: Event-Driven, 10

Findings by how serious they are

11 critical 1159 serious 118 minor

15 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
27 October 2026, 04: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 ▸

68of 68 dimensions measured by tools.
1247of 1288 findings point to an exact file and line, so you can open each one in the code. The other 41 concern the repository as a whole, such as missing documentation.
68dimensions across 8 lenses, read from 374,986 lines of product code in 33 projects.
Chapters

Executive summary

astrid-runtime/astrid falls short of our standard for production because it has message handlers that wait for another service. It scores 49 out of 100 and is rated Weak, and seven of its 11 critical findings are security problems.

Event-Driven, at 10, is the weakest lens and counts most in the score. The best first step is stopping the event handlers from waiting on other services, worth about 33 points. Raising Event-Driven to 70 would lift the score to about 77.

Two passwords or keys in the code and two in the code's history are open to anyone who can read the repository. One automatic update takes new releases before a bad one can be spotted, and one pipeline step installs packages that can change without warning. Replacing each exposed password or key, setting a waiting period for automatic updates and pinning what the pipeline installs would close these risks. Passing outside input through environment variables would fix the pipeline step that puts outside input straight into a shell command. Letting the handler publish a message instead of waiting for the reply would take care of the two message handlers that wait for another service.

The product code is 374,986 lines, about €430,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 for The 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.
Event-Driven 10 · counts for 45%Production Readiness 77 · counts for 25%Code Health 82 · counts for 14%Performance 89 · counts for 8%Maturity 92 · counts for 4%Security and Compliance 92 · counts for 2%Architecture 92 · counts for 1%Event Sourcing 100 · counts for 1%

If Event-Driven rose from 10 to 70, the lowest score rated Strong, the score would rise from 49 to about 77.

Code composition: what the lines of code are
Product code 81%Tests 19%
New since the last survey: 31 findings

These 31 critical or serious findings weren't in the previous survey, on 13 October 2026.

  • Cyclomatic Complexity · WorkspaceBranchStore::rename_batch_inner (cyclomatic 23) crates/astrid-storage/src/content/store/workspace/operations.rs
  • Cyclomatic Complexity · WorkspaceFilesystem::rename_inner (cyclomatic 17) crates/astrid-storage/src/content/store/workspace/filesystem.rs
  • Cyclomatic Complexity · astrid::commands::setup::run_report (cyclomatic 16) crates/astrid-cli/src/commands/setup.rs
  • Cyclomatic Complexity · astrid_storage::volume::hosted::recover::recover_from_headers (cyclomatic 16) crates/astrid-storage/src/volume/hosted/recover.rs
  • Cognitive Complexity · WorkspaceBranchStore::rename_batch_inner (cognitive 41) crates/astrid-storage/src/content/store/workspace/operations.rs
  • Cognitive Complexity · astrid::commands::setup::run_report (cognitive 33) crates/astrid-cli/src/commands/setup.rs
  • Cognitive Complexity · WorkspaceBranchStore::rename_membership_matches (cognitive 19) crates/astrid-storage/src/content/store/workspace/rename_guards.rs
  • Cognitive Complexity · astrid_capsule::dispatcher::consumer::run_consumer (cognitive 18) crates/astrid-capsule/src/dispatcher/consumer.rs
  • Cognitive Complexity · astrid_capsule::engine::wasm::host::ipc::publish_inner (cognitive 18) crates/astrid-capsule/src/engine/wasm/host/ipc.rs
  • Cognitive Complexity · WorkspaceFilesystem::rename_inner (cognitive 18) crates/astrid-storage/src/content/store/workspace/filesystem.rs
  • God Classes · MethodTooLong: WorkspaceBranchStore.rename_batch_inner crates/astrid-storage/src/content/store/workspace/operations.rs
  • God Classes · MethodTooLong: Admitter.reserve crates/astrid-capsule/src/dispatcher/admission.rs
  • Code Duplication · Near-duplicate member pair (64 shared lines) crates/astrid-capsule/src/engine/wasm/host/process/mod.rs
  • Code Duplication · Edited copy of a member (13 corresponding lines) scripts/musl_release_manifest.py
  • Code Duplication · Duplicated block (19 lines × 2) crates/astrid-core/src/platform_fs/macos_acl.rs
  • Code Duplication · Duplicated block (14 lines × 2) crates/astrid-capsule/src/engine/wasm/host/process/mod.rs
  • Code Duplication · Duplicated block (10 lines × 2) crates/astrid-cli/src/commands/daemon/temporary.rs
  • REDACTED Scanning · REDACTED
  • Churn × Complexity Hotspots · Hotspot: crates/astrid-storage/src/volume/hosted/recover.rs crates/astrid-storage/src/volume/hosted/recover.rs
  • Churn × Complexity Hotspots · Hotspot: crates/astrid-cli/src/commands/setup.rs crates/astrid-cli/src/commands/setup.rs
  • Churn × Complexity Hotspots · Repeated repair: crates/astrid-cli/src/cli.rs crates/astrid-cli/src/cli.rs
  • Churn × Complexity Hotspots · Repeated repair: crates/astrid-kernel/src/kernel_router/install.rs crates/astrid-kernel/src/kernel_router/install.rs
  • Churn × Complexity Hotspots · Repeated repair: crates/astrid-capsule/src/lib.rs crates/astrid-capsule/src/lib.rs
  • Churn × Complexity Hotspots · Repeated repair: crates/astrid-types/src/ipc.rs crates/astrid-types/src/ipc.rs
  • Churn × Complexity Hotspots · Repeated repair: crates/astrid-capsule/src/capsule.rs crates/astrid-capsule/src/capsule.rs
  • Dependency Vulnerabilities · REDACTED
  • Dependency Vulnerabilities · REDACTED
  • Dependency Vulnerabilities · REDACTED
  • Dependency Vulnerabilities · REDACTED
  • Dependency Vulnerabilities · REDACTED
  • Change Coupling · Change coupling: capsule.rs ↔ manifest_gate.rs crates/astrid-capsule/src/capsule.rs

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: 17 findings

These 17 critical or serious findings were in the previous survey, on 13 October 2026, and are gone from this one.

  • Cyclomatic Complexity · WorkspaceBranchStore::rename_batch (cyclomatic 18) crates/astrid-storage/src/content/store/workspace/operations.rs
  • Cognitive Complexity · WorkspaceBranchStore::rename_batch (cognitive 33) crates/astrid-storage/src/content/store/workspace/operations.rs
  • God Classes · FileTooLong: src/platform_fs.rs crates/astrid-core/src/platform_fs.rs
  • God Classes · ClassTooLong: EventBus crates/astrid-events/src/bus.rs
  • God Classes · FileTooLong: src/bus.rs crates/astrid-events/src/bus.rs
  • God Classes · FunctionTooLong: astrid_config::loader::load_with_layout crates/astrid-config/src/loader.rs
  • God Classes · MethodTooLong: WorkspaceBranchStore.rename_batch crates/astrid-storage/src/content/store/workspace/operations.rs
  • Code Duplication · Near-duplicate member pair (50 shared lines) crates/astrid-capsule/src/engine/wasm/host/process/mod.rs
  • Code Duplication · Edited copy of a member (13 corresponding lines) scripts/musl_release_manifest.py
  • Code Duplication · Duplicated block (5 lines × 2) crates/astrid-storage/src/engine/durable/format/mod.rs
  • Churn × Complexity Hotspots · Hotspot: crates/astrid-storage/src/storage_model/mod.rs crates/astrid-storage/src/storage_model/mod.rs
  • Churn × Complexity Hotspots · Hotspot: scripts/channel_metadata.py scripts/channel_metadata.py
  • Churn × Complexity Hotspots · Hotspot: crates/astrid-core/src/capability_registry.rs crates/astrid-core/src/capability_registry.rs
  • Churn × Complexity Hotspots · Hotspot: crates/astrid-cli/src/commands/doctor.rs crates/astrid-cli/src/commands/doctor.rs
  • Churn × Complexity Hotspots · Hotspot: crates/astrid-cli/src/commands/wit.rs crates/astrid-cli/src/commands/wit.rs
  • Churn × Complexity Hotspots · Repeated repair: crates/astrid-cli/src/commands/mcp/ingress.rs crates/astrid-cli/src/commands/mcp/ingress.rs
  • Explicit Debt · TodoComment crates/astrid-capsule/src/engine/static_engine.rs
Rebuild cost: about €430,000 · Estimate
Cost to rebuild€140,000 to €720,000, for 2,377 to 7,542 hours of work, about 3.0 person-years for 1 to 6 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 49. 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.
SizeLarge: 374,986 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: 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
Move the awaited work off the handler (`tokio::spawn`/`Handle::current().spawn`) or make the handler `async` so it can `.await` — a sync handler cannot simply `.await` in place.
Raises the score by about 33 points · Medium effort · Handler temporal coupling
2
Resolve the 2 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED.
Raises the score by about 3 points · Low effort · REDACTED Scanning
3
Improve Dependency Hygiene — currently 8.9/10.
Raises the score by about 2 points · Medium effort · Dependency Hygiene

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Where the investment is most exposed · Value at risk
This code would cost about €430,000 to build again, about 3.0 person-years of work. Its weakest lens is Event-Driven, at 10 (Critical). Event-Driven is about whether the parts of the system can rely on the messages they send each other. Because the weakest lens counts most in the score, work on Event-Driven also moves the score most.
Based on: the rebuild estimate · the Event-Driven grade · how much each lens counts
What to do: Start with the Event-Driven actions in Top priorities.
If you do one thing first · First action
Move the awaited work off the handler (`tokio::spawn`/`Handle::current().spawn`) or make the handler `async` so it can `.await` — a sync handler cannot simply `.await` in place. Of all the actions in this report, it raises the score most for the work it takes: about 33 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch astrid astrid astrid-capsule astrid-capsule astrid->astrid-capsule astrid-capsule-install astrid-capsule-install astrid->astrid-capsule-install astrid-config astrid-config astrid->astrid-config astrid-core astrid-core astrid->astrid-core astrid-crypto astrid-crypto astrid->astrid-crypto astrid-daemon astrid-daemon astrid->astrid-daemon astrid-events astrid-events astrid->astrid-events astrid-storage astrid-storage astrid->astrid-storage astrid-types astrid-types astrid->astrid-types astrid-uplink astrid-uplink astrid->astrid-uplink astrid-workspace astrid-workspace astrid->astrid-workspace astrid-approval astrid-approval astrid-audit astrid-audit astrid-approval->astrid-audit astrid-capabilities astrid-capabilities astrid-approval->astrid-capabilities astrid-approval->astrid-core astrid-approval->astrid-crypto astrid-approval->astrid-storage astrid-audit->astrid-capabilities astrid-audit->astrid-core astrid-audit->astrid-crypto astrid-audit->astrid-storage astrid-capabilities->astrid-core astrid-capabilities->astrid-crypto astrid-capabilities->astrid-storage astrid-capsule->astrid-approval astrid-capsule->astrid-capabilities astrid-capsule->astrid-core astrid-capsule->astrid-crypto astrid-capsule->astrid-events astrid-mcp astrid-mcp astrid-capsule->astrid-mcp astrid-capsule->astrid-storage astrid-capsule->astrid-workspace astrid-capsule-install->astrid-capsule astrid-capsule-install->astrid-config astrid-capsule-install->astrid-core astrid-capsule-install->astrid-crypto astrid-capsule-install->astrid-events astrid-capsule-install->astrid-storage astrid-capsule-install->astrid-types astrid-config->astrid-core astrid-daemon->astrid-capsule astrid-daemon->astrid-capsule-install astrid-daemon->astrid-config astrid-daemon->astrid-core astrid-gateway astrid-gateway astrid-daemon->astrid-gateway astrid-kernel astrid-kernel astrid-daemon->astrid-kernel astrid-daemon->astrid-storage astrid-daemon->astrid-uplink astrid-daemon->astrid-workspace astrid-events->astrid-core astrid-events->astrid-types astrid-gateway->astrid-audit astrid-gateway->astrid-capsule-install astrid-gateway->astrid-core astrid-gateway->astrid-events astrid-gateway->astrid-storage astrid-gateway->astrid-types astrid-gateway->astrid-uplink astrid-hooks astrid-hooks astrid-hooks->astrid-capabilities astrid-hooks->astrid-capsule astrid-hooks->astrid-config astrid-hooks->astrid-core astrid-hooks->astrid-events astrid-hooks->astrid-storage astrid-kernel->astrid-approval astrid-kernel->astrid-audit astrid-kernel->astrid-capabilities astrid-kernel->astrid-capsule astrid-kernel->astrid-capsule-install astrid-kernel->astrid-config astrid-kernel->astrid-core astrid-kernel->astrid-crypto astrid-kernel->astrid-events astrid-kernel->astrid-mcp astrid-kernel->astrid-storage astrid-mcp->astrid-audit astrid-mcp->astrid-capabilities astrid-mcp->astrid-core astrid-mcp->astrid-crypto astrid-mcp->astrid-workspace astrid-prelude astrid-prelude astrid-prelude->astrid-audit astrid-prelude->astrid-capabilities astrid-prelude->astrid-core astrid-prelude->astrid-crypto astrid-prelude->astrid-events astrid-prelude->astrid-hooks astrid-prelude->astrid-mcp astrid-prelude->astrid-workspace astrid-storage->astrid-core astrid-storage->astrid-crypto astrid-uplink->astrid-config astrid-uplink->astrid-core astrid-uplink->astrid-crypto astrid-uplink->astrid-events astrid-uplink->astrid-types astrid-workspace->astrid-core __more__ +13 more projects

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.

874 modules, with 2181 dependencies between them. 13 loops run through 98 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 834 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.
uses →1 astrid.theme2 astrid.tui.state3 astrid_capsule_types.capsule4 astrid_core.identity.principal5 astrid_core.principal6 astrid_core.types7 astrid_crypto.hash8 astrid_crypto.keypair9 astrid_events.event10 astrid_runtime.wasm_task11 astrid_storage.engine.durable.media12 astrid_storage.error13 astrid_types.ipc14 astrid_capabilities.token15 astrid_core.dirs16 astrid_core.kernel_api17 astrid_core.kernel_api.response_types18 astrid_events.bus19 astrid_storage.engine.durable20 astrid_storage.principal_directory21 astrid_storage.principal_state.staging22 astrid_audit.entry23 astrid_capsule_types.manifest24 astrid_core.profile25 astrid_storage.ownership26 astrid_storage.principal_state27 astrid_uplink.socket_client28 astrid_audit.storage29 astrid_capsule.engine.wasm.host_state30 astrid_storage.principal_state.staging.format31 astrid_audit.log32 astrid_storage.storage_model.physical.identity33 astrid_storage.storage_model34 astrid_storage.content_dag35 astrid_storage.content36 astrid_storage.content.store.workspace.model37 astrid_capsule.context38 astrid_capsule.engine.wasm39 astrid_kernel40 astrid_kernel.kernel_router
1 astrid.theme
2 astrid.tui.state
3 astrid_capsule_types.capsule
4 astrid_core.identity.principal
5 astrid_core.principal
6 astrid_core.types
7 astrid_crypto.hash
8 astrid_crypto.keypair
9 astrid_events.event
10 astrid_runtime.wasm_task
11 astrid_storage.engine.durable.media
12 astrid_storage.error
13 astrid_types.ipc
14 astrid_capabilities.token1312
15 astrid_core.dirs1
16 astrid_core.kernel_api1
17 astrid_core.kernel_api.response_types15
18 astrid_events.bus131
19 astrid_storage.engine.durable6101
20 astrid_storage.principal_directory11
21 astrid_storage.principal_state.staging113222
22 astrid_audit.entry12121
23 astrid_capsule_types.manifest1
24 astrid_core.profile11
25 astrid_storage.ownership322
26 astrid_storage.principal_state11142215
27 astrid_uplink.socket_client21111
28 astrid_audit.storage22221
29 astrid_capsule.engine.wasm.host_state231421111
30 astrid_storage.principal_state.staging.format14144
31 astrid_audit.log2232361
32 astrid_storage.storage_model.physical.identity13
33 astrid_storage.storage_model1
34 astrid_storage.content_dag5
35 astrid_storage.content35
36 astrid_storage.content.store.workspace.model3313
37 astrid_capsule.context2312131
38 astrid_capsule.engine.wasm1162111211253
39 astrid_kernel3131312521311333
40 astrid_kernel.kernel_router3111211
Uses a module listed above itPart of a loopThe module itself
1 astrid.theme2 astrid.tui.state3 astrid_capsule_types.capsule4 astrid_core.identity.principal5 astrid_core.principal6 astrid_core.types7 astrid_crypto.hash8 astrid_crypto.keypair9 astrid_events.event10 astrid_runtime.wasm_task11 astrid_storage.engine.durable.media12 astrid_storage.error13 astrid_types.ipc14 astrid_capabilities.token15 astrid_core.dirs16 astrid_core.kernel_api17 astrid_core.kernel_api.response_types18 astrid_events.bus19 astrid_storage.engine.durable20 astrid_storage.principal_directory21 astrid_storage.principal_state.staging22 astrid_audit.entry23 astrid_capsule_types.manifest24 astrid_core.profile25 astrid_storage.ownership26 astrid_storage.principal_state27 astrid_uplink.socket_client28 astrid_audit.storage29 astrid_capsule.engine.wasm.host_state30 astrid_storage.principal_state.staging.format31 astrid_audit.log32 astrid_storage.storage_model.physical.identity33 astrid_storage.storage_model34 astrid_storage.content_dag35 astrid_storage.content36 astrid_storage.content.store.workspace.model37 astrid_capsule.context38 astrid_capsule.engine.wasm39 astrid_kernel40 astrid_kernel.kernel_routerastrid.theme1astrid.tui.state2astrid_capsule_types.capsule3astrid_core.identity.principal4astrid_core.principal5astrid_core.types6astrid_crypto.hash7astrid_crypto.keypair8astrid_events.event9astrid_runtime.wasm_task10astrid_storage.engine.durable.media11astrid_storage.error12astrid_types.ipc13astrid_capabilities.token14astrid_core.dirs15astrid_core.kernel_api16astrid_core.kernel_api.response_types17astrid_events.bus18astrid_storage.engine.durable19astrid_storage.principal_directory20astrid_storage.principal_state.staging21astrid_audit.entry22astrid_capsule_types.manifest23astrid_core.profile24astrid_storage.ownership25astrid_storage.principal_state26astrid_uplink.socket_client27astrid_audit.storage28astrid_capsule.engine.wasm.host_state29astrid_storage.principal_state.staging.format30astrid_audit.log31astrid_storage.storage_model.physical.identity32astrid_storage.storage_model33astrid_storage.content_dag34astrid_storage.content35astrid_storage.content.store.workspace.model36astrid_capsule.context37astrid_capsule.engine.wasm38astrid_kernel39astrid_kernel.kernel_router40131211151316101111132221212111132211142215211112222123142111114144223236113153533132312131116211121125331313125213113333111211+834 more modules (most-connected shown)

At a glance — Code Health · 82% · Strong ·

At a glance — Architecture · 92% · Exemplary ·

At a glance — Maturity · 92% · Exemplary ·

At a glance — Readiness · 77% · Adequate · gated by D13 ·

At a glance — Security · 92% · Exemplary ·

At a glance — Event-Driven · 10% · Critical · gated by ED1 ·

At a glance — Event Sourcing · 100% · Exemplary ·

At a glance — Performance · 89% · Strong ·

Security & Compliance — OWASP Top-10 mapping

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 categoryFindingsSeverity
A03:2025 — Software Supply Chain Failures12Medium
A07:2025 — Authentication Failures5High / Critical
A05:2025 — Injection4High / Critical

Roadmap

First, resolve the handler temporal coupling by moving awaited work off the handler or making the handler async to eliminate blocking waits. Next, address the two leaked secrets found in REDACTED and REDACTED, and update the 22 outdated direct dependencies using cargo update. Finally, improve structured logging by removing interpolated messages and refactor the eight most complex functions to reduce cognitive complexity below the threshold.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Move the awaited work off the handler (`tokio::spawn`/`Handle::current().spawn`) or make the handler `async` so it can `.await` — a sync handler cannot simply `.await` in place.+32.8 ptsMediumHandler temporal coupling
Resolve the 2 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED.+2.5 ptsLowREDACTED Scanning
Improve Dependency Hygiene — currently 8.9/10.+2.0 ptsMediumDependency Hygiene
Interpolated log message defeats structured logging+1.2 ptsMediumStructured logging
Bring the 8 bodies over 60 down to 60 or less in Cognitive Complexity — start with WasmEngine::load (cognitive 122), astrid::tui::render::render_nexus (cognitive 121), astrid::tui::render::render_input (cognitive 92).+0.3 ptsHighCognitive Complexity
Resolve the 72 FileTooLong finding(s) in God Classes — start with mod.rs (20), render.rs (2), state.rs (2).+0.2 ptsHighGod Classes
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion.+0.1 ptsLowProject Cohesion
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with rust-toolchain.toml.+0.1 ptsLowPlatform End-of-Life

File quality

Per-file score 0–10 — a quality signature. Of 371 files carrying findings, judged against the Production bar: 0% slop · 56% mixed · 44% near-clean.

FileScoreBandWorst signal
REDACTED3.0SlopREDACTED Scanning: Leaked secret: REDACTED
crates/astrid-kernel/src/kernel_router/admin/handlers/mod.rs5.5MixedCyclomatic Complexity: astrid_kernel::kernel_router::admin::handlers::agent_modify_from_req (cyclomatic 17)
crates/astrid-capsule/src/registry.rs5.7MixedCognitive Complexity: CapsuleRegistry::unregister_for (cognitive 16)
REDACTED5.8MixedDependency Vulnerabilities: Medium advisory (unmaintained): REDACTED
crates/astrid-core/src/local_transport/windows.rs5.9MixedCyclomatic Complexity: astrid_core::local_transport::windows::validate_pipe_security (cyclomatic 18)
crates/astrid-cli/src/tui/mod.rs6.0MixedExplicit Debt: TodoComment
crates/astrid-kernel/src/lib.rs6.0MixedExplicit Debt: TodoComment
crates/astrid-capsule/src/engine/wasm/host/http/backend.rs6.0MixedExplicit Debt: TodoComment
crates/astrid-capsule/src/engine/wasm/host_state.rs6.3MixedGod Classes: TooManyFields: HostState
crates/astrid-telemetry/src/logging.rs6.3MixedCode Duplication: Members sharing a duplicated core (4 members, 50+ identical tokens)
crates/astrid-vfs/src/workspace_cow/overlayfs.rs6.7MixedExplicit Debt: TodoComment
crates/astrid-capsule/src/engine/wasm/host/http/mod.rs6.9MixedExplicit Debt: TodoComment
crates/astrid-capsule/src/engine/wasm/mod.rs7.0MixedCyclomatic Complexity: WasmEngine::load (cyclomatic 66)
scripts/musl_release_manifest.py7.0MixedCyclomatic Complexity: musl_release_manifest.validate_manifest (cyclomatic 49)
crates/astrid-kernel/src/legacy_migration_barrier/ledger.rs7.0MixedCyclomatic Complexity: astrid_kernel::legacy_migration_barrier::ledger::validate_ledger_shape (cyclomatic 41)
crates/astrid-cli/src/tui/input.rs7.0MixedCyclomatic Complexity: astrid::tui::input::handle_idle_input (cyclomatic 40)
crates/astrid-cli/src/tui/render.rs7.0MixedCyclomatic Complexity: astrid::tui::render::render_input (cyclomatic 39)
scripts/runatal_v1_physical.py7.0MixedCyclomatic Complexity: runatal_v1_physical.validate_map (cyclomatic 36)
crates/astrid-capsule/src/engine/wasm/host/net/mod.rs7.0MixedCyclomatic Complexity: HostState::bind_tcp (cyclomatic 22)
crates/astrid-capsule/src/engine/wasm/host/process/mod.rs7.0MixedCyclomatic Complexity: HostState::spawn_persistent (cyclomatic 21)

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 11

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 — 1159

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 — 118

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 15

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. 68 of 68 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. 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 — 68 dimensions across the health lenses
D1D2D3D4D5D6D7D9D12D13D14D15D17D19D20D26D28D29D30D31D34D35D36D37D43D44AX10AX3AX4AX8AX9C2ED1ES1ES2M1M2M3M4P1P10P2P3P4P6P7PF1PF3S1X1X12X13X14X15X17X19X21X22X23X24X25X26X27X28X29X3X30X4

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
  1. 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, 1247 of 1288 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.)
  2. 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.
  3. 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.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Watchdog duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurement—◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a17ba0-c7c0-79b9-b597-ce43517632cd.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

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: test source is present (.py, .rs) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`, 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. You can widen what we reach: optional: produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`, 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 — then the real number is read on the next scan.
  • 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 source is present (.py, .rs) and this repository declares a Cargo test suite (repository root, 695 test files), but it was not re-run: its build outgrew the 6 GB scratch ceiling (6.083 GB measured) and was stopped; its suite was not run. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • 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 (4 contributor(s) across 797 commit(s) sampled, automation and bot accounts excluded). One of them holds 98% of the history; the other 3 hold 0.7% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
  • D19 Documentation Quality — measured, with a gap in what it reached — 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. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D20 ADR 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 ADR lexicon (adr-lexicon-1) covers de, en, it, nl. A record identified as another language, or whose language could not be identified (fewer than 25 words of prose, or no clear winner), is never read with English rules: its missing-section, status, consequence-cost and same-question rules abstain, and only the structural rules (title, single option, dangling link, enforcement field) run.
  • D21 Naming Consistency — 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. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • D22 Internal API Consistency — 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. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — 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's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • 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.
  • AX6 Interface segregation — 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 is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing 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.
  • 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 ToolchainServer (crates/astrid-cli). the service did not build — `cargo build --locked --bin 'astrid'` exited 1: info: syncing channel updates for 1.95.0-x86_64-unknown-linux-gnu error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-1.95.0.toml.sha256' to '/usr/local/rustup/tmp/p5xk…; runtime evidence skipped (launch chosen because 'axum' dependency in crates/astrid-cli/Cargo.toml, binary 'astrid', started with its 'serve' subcommand).
  • 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 no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Python, Rust, Swift 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 no C#, JavaScript/TypeScript, Java, Dart, Ruby or Scala was found, and this repository's Python, Rust, Swift 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. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9). Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • P5 DR & Backup — 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. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • X16 Unfloored truncation loop — 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, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X18 Disposal-pattern correctness — 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, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala or PHP was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X2 Cancellation propagation — 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, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, 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.
  • X4 Structured logging — 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. 12 further occurrence(s) are not listed individually; the score already reflects all 52.
  • X5 Nullable reference types — 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 and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's Python, Rust, Swift is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

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.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • 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.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality 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.
  • 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.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • M4 Documentation accuracy: 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".
  • 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.

Dimensions

D1 · Cyclomatic Complexity6.4 / 10Adequate✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 6.4 / 10 · rule-coverage 100% · ceiling Prevented

95 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was WasmEngine::load at 66. A further 26 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 astrid_gateway::metrics::status_to_static at 63 — they are counted neither in the figure above nor in this dimension's score. 21 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/astrid-gateway/src/metrics.rs (astrid_gateway::metrics::status_to_static at 63), crates/astrid-events/src/event.rs (AstridEvent::event_type at 58), crates/astrid-kernel/src/kernel_router/admin/mod.rs (astrid_kernel::kernel_router::admin::admin_request_method at 48), crates/astrid-uplink/src/admin_client.rs (astrid_uplink::admin_client::topic_suffix at 48), crates/astrid-cli/src/dispatch.rs (astrid::dispatch::dispatch_subcommand at 43), and 16 more not listed here. 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.

astrid_kernel::kernel_router::handle_request (cyclomatic 46) · ×14crates/astrid-kernel/src/kernel_router/mod.rs:179
astrid::tui::input::handle_idle_input (cyclomatic 40) · ×12crates/astrid-cli/src/tui/input.rs:548
astrid_cli_mockup::ui::input::handle_idle_input (cyclomatic 59) · ×8crates/astrid-cli-mockup/src/ui/input.rs:37
astrid_storage::engine::durable::wal::replay::replay_transaction (cyclomatic 24) · ×7crates/astrid-storage/src/engine/durable/wal/replay.rs:255
astrid_gateway::routes::audit::paginate_page (cyclomatic 25) · ×4crates/astrid-gateway/src/routes/audit.rs:377

+ 42 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 1 body over 60 down to 60 or less in Cyclomatic Complexity — start with WasmEngine::load (cyclomatic 66). — Refactoring it lifts Cyclomatic Complexity from 6.4 to about 6.5/10.
  2. 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.

D2 · Cognitive Complexity5.8 / 10Adequate✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 5.8 / 10 · rule-coverage 100% · ceiling Prevented

264 method(s) exceeded the cognitive complexity threshold of 15; the worst was WasmEngine::load at 122.

astrid::tui::render::render_nexus (cognitive 121) · ×44crates/astrid-cli/src/tui/render.rs:514
astrid_kernel::legacy_migration_barrier::ledger::validate_ledger_shape (cognitive 62) · ×31crates/astrid-kernel/src/legacy_migration_barrier/ledger.rs:610
astrid_storage::engine::durable::wal::replay::replay_transaction (cognitive 38) · ×23crates/astrid-storage/src/engine/durable/wal/replay.rs:255
astrid_cli_mockup::ui::input::handle_idle_input (cognitive 55) · ×13crates/astrid-cli-mockup/src/ui/input.rs:37
astrid_capsule::engine::wasm::wasm_exports_contain (cognitive 39) · ×11crates/astrid-capsule/src/engine/wasm/mod.rs:4328

+ 84 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 8 bodies over 60 down to 60 or less in Cognitive Complexity — start with WasmEngine::load (cognitive 122), astrid::tui::render::render_nexus (cognitive 121), astrid::tui::render::render_input (cognitive 92). — 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 8 together lifts Cognitive Complexity from 5.8 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. 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.

D3 · God Classes8.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.

Maturity: Documented → Verified → Prevented · effective 8.7 / 10 · rule-coverage 100% · ceiling Prevented

137 god class(es) detected.

FileTooLong: src/lib.rs · ×72crates/astrid-kernel/src/lib.rs
FunctionTooLong: astrid_kernel::kernel_router::handle_request · ×24crates/astrid-kernel/src/kernel_router/mod.rs:179
MethodTooLong: WasmEngine.load · ×14crates/astrid-capsule/src/engine/wasm/mod.rs:1690
TooManyMethods: DurableEngine · ×12crates/astrid-storage/src/engine/durable/mod.rs:662
ClassTooLong: Kernel · ×11crates/astrid-kernel/src/lib.rs:213

+ 1 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 72 FileTooLong finding(s) in God Classes — start with mod.rs (20), render.rs (2), state.rs (2). — One of this dimension's main actionable groups (72 warning-level).
  2. Resolve the 24 FunctionTooLong finding(s) in God Classes — start with mod.rs (6), render.rs (4), ledger.rs (2). — One of this dimension's main actionable groups (24 warning-level).
  3. Resolve the 14 MethodTooLong finding(s) in God Classes — start with mod.rs (7), lib.rs, volume.rs. — One of this dimension's main actionable groups (14 warning-level).
  4. 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.

D4 · Code Duplication9.3 / 10Stronggated by 541 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.3 / 10 · rule-coverage 100% · ceiling Verified

522 duplicated block group(s) detected. A further 19 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 3 of the 541 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (9 lines × 2) · ×52crates/astrid-audit/src/storage.rs:461
Duplicated block (7 lines × 2) · ×46crates/astrid-capsule-install/src/authority.rs:393
Duplicated block (6 lines × 2) · ×43crates/astrid-cli-mockup/src/ui/input.rs:201
Duplicated block (10 lines × 2) · ×42crates/astrid-build/src/archiver.rs:298
Duplicated block (5 lines × 2) · ×41crates/astrid-capsule/src/engine/wasm/host/process/persistent/mod.rs:168

+ 98 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 52 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with mod.rs (11), storage.rs (2), io.rs (2). — One of this dimension's main actionable groups (52 warning-level).
  2. Resolve the 46 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with mod.rs (7), reader.rs (3), overlay.rs (2). — One of this dimension's main actionable groups (46 warning-level).
  3. Resolve the 43 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with mod.rs (7), nexus.rs (2), host_fs.rs (2). — One of this dimension's main actionable groups (43 warning-level).
  4. 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.

D5 · Coupling6.7 / 10Adequate✓ 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.

Maturity: Documented → Verified → Prevented · effective 6.7 / 10 · rule-coverage 100% · ceiling Prevented

33 production modules (Cargo+Xcode), 0 dependency cycle(s), 3 unstable depended-on module(s). Read from the build's own module declarations; a workspace's implicit (product-name) dependency is not visible there; 10 module(s) off the main sequence, with abstractness counted on 30 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: astrid-core · ×10
Unstable project astrid-gateway
Unstable project astrid-hooks
Unstable project astrid-kernel

What to do

  1. Resolve the 10 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (10 warning-level).
  2. Resolve the 1 Unstable project astrid-gateway finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Unstable project astrid-hooks finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
  4. 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.

D6 · Cohesion (LCOM4)9.7 / 10Stronggated by 9 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.7 / 10 · rule-coverage 100% · ceiling Verified

9 of 388 classes have LCOM4 above 3.

Low cohesion: HostState (LCOM4 16) · ×9crates/astrid-capsule/src/engine/wasm/host_state.rs:252

What to do

  1. Resolve the 9 Low cohesion finding(s) in Cohesion (LCOM4) — start with config.rs (2), host_state.rs, consent_display.rs. — One of this dimension's main actionable groups (9 warning-level).
  2. 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.

D7 · Architectural Integrity6.0 / 10Adequate✓ Tool-verified

What it measures: Whether the code respects its intended layering / architecture rules.

Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.

Maturity: Documented → Verified → Prevented · effective 6.0 / 10 · rule-coverage 100% · ceiling Prevented

No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).

Classify ADR enforcement: 2182.fixed · ×14changes/2182.fixed.md

What to do

  1. Resolve the 14 Classify ADR enforcement finding(s) in Architectural Integrity — start with 2182.fixed.md, 2186.security.md, 2188.fixed.md. — One of this dimension's main actionable groups (14 recommendation-level).
  2. Enforce Architectural Integrity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d7_recommendation.md · top locations in Appendix A, every location in findings.md.

D9 · Test Distribution9.9 / 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.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Documented

6151 test methods: 5948 unit, 167 integration, 0 BDD, 36 e2e. The Rust suite contributes 5886 `#[test]` function(s) across 695 file(s) declaring at least one; its unit/integration split is Cargo's own — 27 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. The Python suite contributes 265 test function(s) across 29 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D12 · Dependency Hygiene8.9 8.4 / 10Strong✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 8.4 / 10 · rule-coverage 94% · ceiling Verified

22 outdated, 0 yanked direct Cargo dependencies. 98 of 104 direct crates were graded against crates.io (0 not published there, 6 not resolved by a committed REDACTED). 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: arbitrary · ×22

What to do

  1. Improve Dependency Hygiene — currently 8.9/10. — 22 outdated, 0 yanked direct Cargo dependencies. 98 of 104 direct crates were graded against crates.io (0 not published there, 6 not resolved by a committed REDACTED). 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.

Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.

D13 · REDACTED Scanning0.0 / 10Critical✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Prevented

2 secret(s) detected.

REDACTED

What to do

  1. Resolve the 2 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
  2. 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.

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 787 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. This repository publishes itself under MIT OR Apache-2.0, which is its own choice and is not judged here.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.7 / 10Stronggated by 73 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.7 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: crates/astrid-capsule/src/engine/wasm/mod.rs (25×66=1650); crates/astrid-kernel/src/kernel_router/mod.rs (15×46=690); crates/astrid-kernel/src/kernel_router/admin/mod.rs (13×48=624) Repeated repair below the complexity floor: crates/astrid-cli/src/commands/daemon.rs (14 of 15 changes were fixes); crates/astrid-cli/src/commands/init.rs (9 of 11 changes were fixes); crates/astrid-cli/src/commands/mcp/mod.rs (8 of 12 changes were fixes)

Hotspot: crates/astrid-capsule/src/engine/wasm/mod.rs · ×37crates/astrid-capsule/src/engine/wasm/mod.rs:1690
Repeated repair: crates/astrid-cli/src/commands/daemon.rs · ×36crates/astrid-cli/src/commands/daemon.rs:827

What to do

  1. Resolve the 37 Hotspot finding(s) in Churn × Complexity Hotspots — start with mod.rs (10), lib.rs (2), dispatch.rs. — One of this dimension's main actionable groups (37 warning-level).
  2. Resolve the 36 Repeated repair finding(s) in Churn × Complexity Hotspots — start with mod.rs (3), volume.rs (2), daemon.rs. — One of this dimension's main actionable groups (36 warning-level).

Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.

D17 · Explicit Debt10.0 / 10Stronggated by 10 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

10 deducted task-comment markers across 374986 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.

TodoComment · ×10crates/astrid-vfs/src/workspace_cow/overlayfs.rs:32

What to do

  1. Resolve the 10 TodoComment finding(s) in Explicit Debt — start with mod.rs (4), agent.rs (2), overlayfs.rs. — One of this dimension's main actionable groups (10 warning-level).
  2. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 1 documentation facets pass in full. 76 document(s) read across 1 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality10.0 / 10Exemplary○ Nothing flagged

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 of 12 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question). How well each record argues its case is not measured.

✓ On the Gold path — maintain.

Detailed fixes: d20_recommendation.md.

D26 · Project Cohesion7.0 / 10Adequate✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic, LLM-independent.

Maturity: Documented → Verified → Prevented · effective 7.0 / 10 · rule-coverage 100% · ceiling Documented

5 of 33 build units (Cargo, Xcode) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.

D28 · Secrets (history)8.0 / 10Adequategated by 2 critical findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 8.0 / 10 · rule-coverage 100% · ceiling Documented

2 finding(s): 0 critical, 2 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

REDACTED
REDACTED

What to do

  1. Resolve the 2 REDACTED finding(s) in Secrets (history) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  2. 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.

D29 · Static Analysis (SAST)5.6 / 10Adequate✓ Tool-verified

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).

Maturity: Documented → Verified → Prevented · effective 5.6 / 10 · rule-coverage 100% · ceiling Documented

4 finding(s): 0 critical, 3 high, 1 medium, 0 low. semgrep hit a parse error in 15 file(s) — `container/amd64/entrypoint.sh` (line 14), `crates/astrid-core/src/local_transport/windows.rs` (line 387, line 390, line 444, …), `crates/astrid-core/src/platform_fs/macos_acl.rs` (line 41, line 82, line 201, …), `crates/astrid-core/src/platform_fs/windows/io.rs` (line 551, line 706, line 719, …), `crates/astrid-core/src/platform_fs/windows/path.rs` (line 36, line 37, line 555, …), … (+10 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 3 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

What to do

  1. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D30 · Dependency Vulnerabilities8.3 / 10Strong✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 8.3 / 10 · rule-coverage 100% · ceiling Documented

9 finding(s): 0 critical, 0 high, 9 medium, 0 low.

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 6 Medium advisory (unmaintained) finding(s) in Dependency Vulnerabilities — start with REDACTED (6). — One of this dimension's main actionable groups (6 warning-level).
  2. Resolve the 2 Medium advisory (unsound) finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).
  3. Resolve the 1 Medium vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.

D31 · IaC & Container Security10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (Dockerfile/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

trivy and checkov found no infrastructure-as-code or container misconfigurations.

✓ On the Gold path — maintain.

Detailed fixes: d31_recommendation.md.

D34 · Knowledge Freshness10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

Every significant source file has living knowledge — recently and meaningfully worked. Counted over 947 of the 1109 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling9.9 / 10Stronggated by 3 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: mod.rs↔tests.rs 73%; capsule.rs↔manifest_gate.rs 60%; registry.rs↔manifest_gate.rs 50%

Change coupling: mod.rs ↔ tests.rs · ×3crates/astrid-kernel/src/kernel_router/admin/handlers/mod.rs:1

What to do

  1. Resolve the 3 Change coupling finding(s) in Change Coupling — start with mod.rs, capsule.rs, registry.rs. — One of this dimension's main actionable groups (3 warning-level).

Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.

D36 · Supply-chain Provenance & Signing7.5 / 10Strong✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 7.5 / 10 · rule-coverage 100% · ceiling Documented

3/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

A vulnerability-disclosure policy (SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life6.0 / 10Adequate✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 6.0 / 10 · rule-coverage 100% · ceiling Documented

1 end-of-life runtime(s) and 0 end-of-life framework(s), read from 2 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.

End-of-life runtime: Rust 1.95rust-toolchain.toml:1

What to do

  1. Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with rust-toolchain.toml. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d44_recommendation.md · top locations in Appendix A, every location in findings.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AX10 · Code composition9.7 / 10Exemplary✓ Tool-verified

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.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

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.

AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.

Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.

AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

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.

  • `DeferredResolutionStore.load_from_store` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command. — crates/astrid-approval/src/deferred.rs:313
  • `CapabilityStore.read_persistent_token_any_principal` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command. — crates/astrid-capabilities/src/store.rs:325

What to do

  • Keep query handlers read-only — move the writes/event-publishes into a command handler so reads stay safe to retry, cache, and route to a read replica.
C2 · Access Controls10.0 / 10Exemplary○ Nothing flagged

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.

ED1 · Handler temporal coupling1.0 / 10Critical✓ Tool-verified

Other · Event-Driven — Whether event/message handlers avoid synchronous blocking waits — a blocking wait inside a handler stalls throughput and risks deadlock.

Method: Roslyn semantic scan (event-driven gated): event-handler bodies scanned for HTTP/gRPC invocations by resolved symbol type, not substring. Deterministic, semantic-resolved.

  • `WasmHandler.new` is an event/message handler that blocks the executor on a synchronous wait (`block_on`/`blocking_recv`/`thread::sleep`/a blocking `recv()`) — it stalls the handler and serialises throughput, and on an async runtime can starve the reactor. Either move the awaited work off the handler (`tokio::spawn`/`Handle::current().spawn`, if the result isn't needed inline) or make the handler itself `async` so it can `.await`. — crates/astrid-hooks/src/handler/wasm.rs:111
  • `WasmHandler.build_host_state` is an event/message handler that blocks the executor on a synchronous wait (`block_on`/`blocking_recv`/`thread::sleep`/a blocking `recv()`) — it stalls the handler and serialises throughput, and on an async runtime can starve the reactor. Either move the awaited work off the handler (`tokio::spawn`/`Handle::current().spawn`, if the result isn't needed inline) or make the handler itself `async` so it can `.await`. — crates/astrid-hooks/src/handler/wasm.rs:297

What to do

  • Move the awaited work off the handler (`tokio::spawn`/`Handle::current().spawn`) or make the handler `async` so it can `.await` — a sync handler cannot simply `.await` in place.
ES1 · Fold determinism10.0 / 10Exemplary✓ Tool-verified

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.

ES2 · Immutable events10.0 / 10Exemplary✓ Tool-verified

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.

M1 · Documentation (README)8.7 / 10Strong✓ Tool-verified

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 10 of 34 project(s) that lack one — worth up to 0.6 pts.
M2 · Architecture documentation8.5 / 10Strong✓ Tool-verified

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.

What to do

  • Grow the ADR log (currently 14) — reach 20 to raise the maturity tier; document significant decisions as they're made.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

M4 · Documentation accuracy10.0 / 10Exemplary○ Nothing flagged

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.

P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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.

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language 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.

P2 · Observability9.4 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

  • Only 22/27 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `crates/astrid-emit`, `crates/astrid-storage-chunker-evidence`, `crates/astrid-storage-provider-fskit`, `crates/astrid-storage-provider-fuse`, `crates/astrid-storage-provider-winfsp`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
P3 · Security & performance tooling9.0 / 10Exemplary✓ Tool-verified

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

  • Dependabot is configured but does not watch `gitsubmodule` — add that `package-ecosystem` entry to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback7.0 / 10Strong✓ Tool-verified

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.

P6 · Release Hygiene10.0 / 10Exemplary✓ 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.

P7 · Outbound HTTP resilience10.0 / 10Exemplary○ Nothing flagged

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.

PF1 · Benchmark discipline8.0 / 10Strong✓ Tool-verified

Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.

Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

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.

S1 · Web-Security Posture10.0 / 10Exemplary○ Nothing flagged

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/astrid-gateway/src/lib.rs:307)), 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.

X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

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.

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.

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

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.

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.

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.

  • `check_commits` is public, takes a document from its caller (line 38) and hands it to `_flatten_commits`, which calls itself at line 25 (`_flatten_commits`) with a piece of `payload` — and nowhere in `_flatten_commits` 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. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_flatten_commits` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — scripts/check_dco.py:25

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.
X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

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.

X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

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.

X22 · Contradicted release guard10.0 / 10Exemplary○ Nothing flagged

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.

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

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.

X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

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.

X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

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.

X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.

Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.

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. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.

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.

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.

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.

X3 · Exception handling10.0 / 10Exemplary○ Nothing flagged

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.

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.

X4 · Structured logging6.3 / 10Adequate✓ Tool-verified

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.

  • `error!` at line 79 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-workspace/src/worktree.rs:79
  • `info!` at line 85 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-workspace/src/worktree.rs:85
  • `debug!` at line 109 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-workspace/src/worktree.rs:109
  • `info!` at line 137 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-workspace/src/worktree.rs:137
  • `error!` at line 139 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-workspace/src/worktree.rs:139
  • `info!` at line 162 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-workspace/src/worktree.rs:162
  • `error!` at line 168 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-workspace/src/worktree.rs:168
  • `error!` at line 174 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-workspace/src/worktree.rs:174
  • `error!` at line 57 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-vfs/src/boundary.rs:57
  • `error!` at line 104 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-vfs/src/host.rs:104
  • `warn!` at line 3153 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-kernel/src/lib.rs:3153
  • `warn!` at line 19 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-config/src/merge/enforce.rs:19
  • `warn!` at line 41 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-config/src/merge/enforce.rs:41
  • `warn!` at line 60 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-config/src/merge/enforce.rs:60
  • `warn!` at line 79 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. (×2) — crates/astrid-config/src/merge/enforce.rs:79, crates/astrid-config/src/merge/servers.rs:79
  • `warn!` at line 109 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-config/src/merge/enforce.rs:109
  • `warn!` at line 141 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-config/src/merge/enforce.rs:141
  • `warn!` at line 160 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-config/src/merge/enforce.rs:160
  • `warn!` at line 200 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-config/src/merge/enforce.rs:200
  • `warn!` at line 24 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-config/src/merge/path.rs:24
  • `warn!` at line 44 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-config/src/merge/servers.rs:44
  • `warn!` at line 52 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-config/src/merge/servers.rs:52
  • `warn!` at line 71 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-config/src/merge/servers.rs:71
  • `warn!` at line 449 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-cli/src/tui/mod.rs:449
  • `warn!` at line 636 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-capsule/src/dispatcher.rs:636
  • `warn!` at line 647 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-capsule/src/dispatcher.rs:647
  • `warn!` at line 660 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-capsule/src/dispatcher.rs:660
  • `info!` at line 158 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-capsule/src/engine/mcp.rs:158
  • `warn!` at line 4357 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-capsule/src/engine/wasm/mod.rs:4357
  • `warn!` at line 4389 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-capsule/src/engine/wasm/mod.rs:4389
  • `warn!` at line 4415 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-capsule/src/engine/wasm/mod.rs:4415
  • `warn!` at line 275 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-capsule/src/engine/wasm/host/approval.rs:275
  • `trace!` at line 132 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `trace!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-capsule/src/engine/wasm/host/sys.rs:132
  • `debug!` at line 133 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-capsule/src/engine/wasm/host/sys.rs:133
  • `info!` at line 134 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-capsule/src/engine/wasm/host/sys.rs:134
  • `warn!` at line 135 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-capsule/src/engine/wasm/host/sys.rs:135
  • `error!` at line 136 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-capsule/src/engine/wasm/host/sys.rs:136
  • `error!` at line 372 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-capabilities/src/store.rs:372
  • `debug!` at line 561 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/astrid-capabilities/src/store.rs:561

What to do

  • Interpolated log message defeats structured logging

Reference — by lens

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.

LensScoreRatingImpact
Code Health82%StrongSolid.
Architecture92%ExemplarySolid.
Maturity92%ExemplarySolid.
Readiness77%Adequate — gated by D13Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security92%ExemplarySolid.
Event-Driven10%Critical — gated by ED1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Event Sourcing100%ExemplaryStrongest area.
Performance89%StrongSolid.
Unscored — 3 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 11 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X9 Subsumed condition operand — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 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.

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 51 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — Not applicable: 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 Swift imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written.
  • 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
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface 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 — the service did not build — `cargo build --locked --bin 'astrid'` exited 1: info: syncing channel updates for 1.95.0-x86_64-unknown-linux-gnu error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-1.95.0.toml.sha256' to '/usr/local/rustup/tmp/p5xk…; runtime evidence skipped (launch chosen because 'axum' dependency in crates/astrid-cli/Cargo.toml, binary 'astrid', started with its 'serve' subcommand) This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D10 Test Quality — ~87574 lines of test source are present (.py, .rs) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-run
  • 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.
  • D21 Naming Consistency — Naming consistency is measured on C# only; Python, Rust, Swift not measured.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ 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 — D24 reads C# and Visual Basic comments only — this repository's production source is .py, .rs, .swift, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
  • 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) — 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.
  • 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.
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 295 value object(s); 5 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 this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
  • 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
  • P12 CI test-gate honesty — 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'.
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — no coverage report found on disk — 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, or wire coverage collection into CI, to enable this cross-layer check
  • PF2 Allocation hygiene — Not applicable: allocation awareness is rated where code engineers for it — at least 400 production lines that ship benchmarks or already use allocation-aware idioms (8 or more). This repository's Swift code has 874 production line(s), 6 such use(s) and no benchmarks, so there is no allocation work to rate. The card is reward-only: its absence costs nothing.
  • X16 Unfloored truncation loop — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X18 Disposal-pattern correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • 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.

Critical — 11 finding(s)
AX9 · CQS / query purity · Query writes persistent state on the read path · ×2
  • Query writes persistent state on the read path: DeferredResolutionStore.load_from_store crates/astrid-approval/src/deferred.rs:313 — `DeferredResolutionStore.load_from_store` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command.
  • Query writes persistent state on the read path: CapabilityStore.read_persistent_token_any_principal crates/astrid-capabilities/src/store.rs:325 — `CapabilityStore.read_persistent_token_any_principal` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command.
D13 · REDACTED Scanning · Leaked secret · ×2
  • REDACTED
  • REDACTED
D28 · Secrets (history) · REDACTED · ×2
  • REDACTED
  • REDACTED
ED1 · Handler temporal coupling · Blocking wait inside a handler · ×2
  • Blocking wait inside a handler: WasmHandler.new crates/astrid-hooks/src/handler/wasm.rs:111 — `WasmHandler.new` is an event/message handler that blocks the executor on a synchronous wait (`block_on`/`blocking_recv`/`thread::sleep`/a blocking `recv()`) — it stalls the handler and serialises throughput, and on an async runtime can starve the reactor. Either move the awaited work off the handler (`tokio::spawn`/`Handle::current().spawn`, if the result isn't needed inline) or make the handler itself `async` so it can `.await`.
  • Blocking wait inside a handler: WasmHandler.build_host_state crates/astrid-hooks/src/handler/wasm.rs:297 — `WasmHandler.build_host_state` is an event/message handler that blocks the executor on a synchronous wait (`block_on`/`blocking_recv`/`thread::sleep`/a blocking `recv()`) — it stalls the handler and serialises throughput, and on an async runtime can starve the reactor. Either move the awaited work off the handler (`tokio::spawn`/`Handle::current().spawn`, if the result isn't needed inline) or make the handler itself `async` so it can `.await`.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 1159 finding(s)
D3 · God Classes · FileTooLong · ×72
  • FileTooLong: src/lib.rs crates/astrid-kernel/src/lib.rs — FileTooLong — 3152 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 63% of them inside a single declaration: Kernel (2 blocks, 213-3670), declaring 40 free functions. The bar is 500 significant lines; this is 2652 over it, 6.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: wasm/mod.rs crates/astrid-capsule/src/engine/wasm/mod.rs — FileTooLong — 2138 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 38 free functions. The bar is 500 significant lines; this is 1638 over it, 4.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: tui/render.rs crates/astrid-cli/src/tui/render.rs — FileTooLong — 1109 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 609 over it, 2.22× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: scripts/runatal_v1_reader.py scripts/runatal_v1_reader.py — FileTooLong — 863 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 363 over it, 1.73× 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: ui/state.rs crates/astrid-cli-mockup/src/ui/state.rs — FileTooLong — 857 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 357 over it, 1.71× 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: scripts/runatal_v1_physical.py scripts/runatal_v1_physical.py — FileTooLong — 777 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 277 over it, 1.55× 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: durable_cache/mod.rs crates/astrid-storage/src/engine/durable_cache/mod.rs — FileTooLong — 751 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 251 over it, 1.50× 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: legacy_migration_barrier/mod.rs crates/astrid-kernel/src/legacy_migration_barrier/mod.rs — FileTooLong — 736 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 236 over it, 1.47× 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: read/traversal.rs crates/astrid-storage/src/content_dag/read/traversal.rs — FileTooLong — 733 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 233 over it, 1.47× 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: ui/render.rs crates/astrid-cli-mockup/src/ui/render.rs — FileTooLong — 710 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 210 over it, 1.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: legacy_migration_barrier/ledger.rs crates/astrid-kernel/src/legacy_migration_barrier/ledger.rs — FileTooLong — 696 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 196 over it, 1.39× 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/storage_mount.rs crates/astrid-kernel/src/storage_mount.rs — FileTooLong — 692 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 31 free functions. The bar is 500 significant lines; this is 192 over it, 1.38× 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: principal_state/runtime_tree.rs crates/astrid-storage/src/principal_state/runtime_tree.rs — FileTooLong — 690 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 37 free functions. The bar is 500 significant lines; this is 190 over it, 1.38× 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: mcp/gateway.rs crates/astrid-cli/src/commands/mcp/gateway.rs — FileTooLong — 688 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 188 over it, 1.38× 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: principal_state/native_io.rs crates/astrid-storage/src/principal_state/native_io.rs — FileTooLong — 686 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 186 over it, 1.37× 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: format/mod.rs crates/astrid-storage/src/engine/durable/format/mod.rs — FileTooLong — 683 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 183 over it, 1.37× 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: compaction/mod.rs crates/astrid-storage/src/engine/durable/compaction/mod.rs — FileTooLong — 681 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 70% of them inside a single declaration: DurableEngine (2 blocks, 196-828). The bar is 500 significant lines; this is 181 over it, 1.36× 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: catalog/tree.rs crates/astrid-storage/src/content/catalog/tree.rs — FileTooLong — 680 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 180 over it, 1.36× 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: workspace/operations.rs crates/astrid-storage/src/content/store/workspace/operations.rs — FileTooLong — 680 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 98% of them inside a single declaration: WorkspaceBranchStore (2 blocks, 25-927). The bar is 500 significant lines; this is 180 over it, 1.36× 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/storage.rs crates/astrid-audit/src/storage.rs — FileTooLong — 677 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 65% of them inside a single declaration: KvAuditStorage (4 blocks, 320-926). The bar is 500 significant lines; this is 177 over it, 1.35× 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: hosted/recover.rs crates/astrid-storage/src/volume/hosted/recover.rs — FileTooLong — 675 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 31 free functions. The bar is 500 significant lines; this is 175 over it, 1.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: representations/mod.rs crates/astrid-storage/src/engine/durable/representations/mod.rs — FileTooLong — 672 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 88% of them inside a single declaration: RepresentationStore (2 blocks, 97-842). The bar is 500 significant lines; this is 172 over it, 1.34× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: legacy_migration_barrier/host_fs.rs crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs — FileTooLong — 665 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 165 over it, 1.33× 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/main.rs crates/astrid-storage-provider-fuse/src/main.rs — FileTooLong — 657 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 157 over it, 1.31× 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/authority.rs crates/astrid-capsule-install/src/authority.rs — FileTooLong — 656 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 156 over it, 1.31× 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.
  • + 47 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×52
  • Duplicated block (9 lines × 2) crates/astrid-audit/src/storage.rs:461 — crates/astrid-audit/src/storage.rs:461-469 | crates/astrid-audit/src/storage/anchor_marks.rs:74-82 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) crates/astrid-audit/src/storage/heads_page.rs:61 — crates/astrid-audit/src/storage/heads_page.rs:61-69 | crates/astrid-audit/src/storage/sealed_segments.rs:37-45 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) crates/astrid-capsule-install/src/storage.rs:208 — crates/astrid-capsule-install/src/storage.rs:208-216 | crates/astrid-capsule-install/src/storage.rs:677-685 — 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/astrid-capsule-types/src/fuel_ledger.rs:370 — crates/astrid-capsule-types/src/fuel_ledger.rs:370-378 | crates/astrid-capsule-types/src/fuel_ledger.rs:425-433 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/astrid-capsule/src/engine/wasm/host/io.rs:458 — crates/astrid-capsule/src/engine/wasm/host/io.rs:458-466 | crates/astrid-capsule/src/engine/wasm/host/io.rs:486-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 (9 lines × 2) crates/astrid-capsule/src/engine/wasm/host/net/mod.rs:658 — crates/astrid-capsule/src/engine/wasm/host/net/mod.rs:658-666 | crates/astrid-capsule/src/engine/wasm/host/net/mod.rs:672-680 — 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/astrid-cli-mockup/src/ui/render.rs:179 — crates/astrid-cli-mockup/src/ui/render.rs:179-187 | crates/astrid-cli/src/tui/render.rs:208-216 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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/astrid-cli-mockup/src/ui/render.rs:683 — crates/astrid-cli-mockup/src/ui/render.rs:683-691 | crates/astrid-cli/src/tui/render.rs:1472-1480 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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/astrid-cli-mockup/src/ui/views/command.rs:209 — crates/astrid-cli-mockup/src/ui/views/command.rs:209-217 | crates/astrid-cli/src/tui/render.rs:1514-1523 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) crates/astrid-cli/src/commands/capsule/install_headless.rs:92 — crates/astrid-cli/src/commands/capsule/install_headless.rs:92-100 | crates/astrid-cli/src/commands/capsule/install_prompts.rs:89-97 — before extracting anything, compare `crates/astrid-cli/src/commands/capsule/install_headless.rs` and `crates/astrid-cli/src/commands/capsule/install_prompts.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 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/astrid-cli/src/commands/daemon_control.rs:78 — crates/astrid-cli/src/commands/daemon_control.rs:78-86 | crates/astrid-cli/src/commands/daemon_control.rs:116-124 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/astrid-config/src/merge/path.rs:14 — crates/astrid-config/src/merge/path.rs:14-22 | crates/astrid-config/src/merge/path.rs:40-48 — 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/astrid-events/src/bus.rs:570 — crates/astrid-events/src/bus.rs:570-578 | crates/astrid-events/src/bus.rs:659-667 — 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/astrid-kernel/src/invite/mod.rs:428 — crates/astrid-kernel/src/invite/mod.rs:428-436 | crates/astrid-kernel/src/pair_token/durable_reservation.rs:217-225 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) crates/astrid-kernel/src/kernel_router/admin/handlers/mod.rs:438 — crates/astrid-kernel/src/kernel_router/admin/handlers/mod.rs:438-446 | crates/astrid-kernel/src/kernel_router/admin/handlers/mod.rs:485-493 — 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/astrid-kernel/src/kernel_router/admin/mod.rs:649 — crates/astrid-kernel/src/kernel_router/admin/mod.rs:649-658 | crates/astrid-kernel/src/kernel_router/admin/mod.rs:670-678 — 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/astrid-kernel/src/legacy_migration_barrier/mod.rs:410 — crates/astrid-kernel/src/legacy_migration_barrier/mod.rs:410-418 | crates/astrid-kernel/src/legacy_migration_barrier/mod.rs:804-812 — 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/astrid-kernel/src/legacy_migration_barrier/retirement.rs:90 — crates/astrid-kernel/src/legacy_migration_barrier/retirement.rs:90-98 | crates/astrid-kernel/src/legacy_migration_barrier/retirement.rs:138-148 — 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/astrid-kernel/src/principal_distro_migration.rs:457 — crates/astrid-kernel/src/principal_distro_migration.rs:457-465 | crates/astrid-kernel/src/principal_log_migration.rs:460-468 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) crates/astrid-kernel/src/principal_distro_migration.rs:537 — crates/astrid-kernel/src/principal_distro_migration.rs:537-545 | crates/astrid-kernel/src/principal_log_migration.rs:479-487 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) crates/astrid-kernel/src/storage_mount/process_broker/process_identity.rs:23 — crates/astrid-kernel/src/storage_mount/process_broker/process_identity.rs:23-31 | crates/astrid-storage-provider-fskit/src/service.rs:449-457 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) crates/astrid-storage-provider-fskit/src/main.rs:665 — crates/astrid-storage-provider-fskit/src/main.rs:665-673 | crates/astrid-storage-provider-fskit/src/main.rs:688-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 (9 lines × 2) crates/astrid-storage-provider-fuse/src/filesystem.rs:381 — crates/astrid-storage-provider-fuse/src/filesystem.rs:381-389 | crates/astrid-storage-provider-fuse/src/filesystem.rs:412-420 — 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/astrid-storage/src/engine/kv.rs:744 — crates/astrid-storage/src/engine/kv.rs:744-752 | crates/astrid-storage/src/engine/kv.rs:759-768 — 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/astrid-storage/src/volume/hosted/mod.rs:653 — crates/astrid-storage/src/volume/hosted/mod.rs:653-661 | crates/astrid-storage/src/volume/hosted/mod.rs:693-701 — 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.
  • + 27 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×46
  • Duplicated block (7 lines × 2) crates/astrid-capsule-install/src/authority.rs:393 — crates/astrid-capsule-install/src/authority.rs:393-399 | crates/astrid-crypto/src/key_storage.rs:43-49 — 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/astrid-capsule/src/engine/wasm/mod.rs:4350 — crates/astrid-capsule/src/engine/wasm/mod.rs:4350-4356 | crates/astrid-capsule/src/engine/wasm/mod.rs:4382-4388 — 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/astrid-cli-mockup/src/ui/input.rs:188 — crates/astrid-cli-mockup/src/ui/input.rs:188-196 | crates/astrid-cli/src/tui/input.rs:696-702 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/input.rs` and `crates/astrid-cli/src/tui/input.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 58 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/astrid-cli-mockup/src/ui/views/nexus.rs:295 — crates/astrid-cli-mockup/src/ui/views/nexus.rs:295-301 | crates/astrid-cli/src/tui/render.rs:593-599 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/views/nexus.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 50 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/astrid-cli/src/commands/init_grant.rs:194 — crates/astrid-cli/src/commands/init_grant.rs:194-201 | crates/astrid-kernel/src/socket.rs:117-123 — 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/astrid-cli/src/commands/sessions.rs:56 — crates/astrid-cli/src/commands/sessions.rs:56-62 | crates/astrid-cli/src/commands/sessions.rs:72-78 — 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/astrid-gateway/src/routes/quotas.rs:135 — crates/astrid-gateway/src/routes/quotas.rs:135-141 | crates/astrid-gateway/src/routes/quotas.rs:214-220 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/astrid-kernel/src/invite/mod.rs:324 — crates/astrid-kernel/src/invite/mod.rs:324-330 | crates/astrid-kernel/src/pair_token/mod.rs:352-358 — `crates/astrid-kernel/src/invite/mod.rs` and `crates/astrid-kernel/src/pair_token/mod.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 17 separate duplicated blocks between them, totalling at least 162 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (7 lines × 2) crates/astrid-kernel/src/invite/mod.rs:379 — crates/astrid-kernel/src/invite/mod.rs:379-385 | crates/astrid-kernel/src/pair_token/mod.rs:407-413 — `crates/astrid-kernel/src/invite/mod.rs` and `crates/astrid-kernel/src/pair_token/mod.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 17 separate duplicated blocks between them, totalling at least 162 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (7 lines × 2) crates/astrid-kernel/src/socket.rs:323 — crates/astrid-kernel/src/socket.rs:323-329 | crates/astrid-storage/src/secret.rs:525-531 — 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/astrid-storage-provider-fuse/src/control.rs:181 — crates/astrid-storage-provider-fuse/src/control.rs:181-187 | crates/astrid-storage-provider-fuse/src/main.rs:886-892 — 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/astrid-storage/src/content/store/workspace/filesystem.rs:304 — crates/astrid-storage/src/content/store/workspace/filesystem.rs:304-311 | crates/astrid-storage/src/filesystem.rs:723-729 — before extracting anything, compare `crates/astrid-storage/src/content/store/workspace/filesystem.rs` and `crates/astrid-storage/src/filesystem.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 30 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/astrid-storage/src/content_dag/read/traversal.rs:511 — crates/astrid-storage/src/content_dag/read/traversal.rs:511-517 | crates/astrid-storage/src/content_dag/read/traversal.rs:630-638 — 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/astrid-storage/src/engine/durable/format/indexed.rs:44 — crates/astrid-storage/src/engine/durable/format/indexed.rs:44-50 | crates/astrid-storage/src/engine/durable/format/mod.rs:127-133 — 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/astrid-storage/src/engine/muninn.rs:427 — crates/astrid-storage/src/engine/muninn.rs:427-433 | crates/astrid-storage/src/engine/refinery/cross_hash.rs:584-590 — 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/astrid-storage/src/kv/surreal.rs:369 — crates/astrid-storage/src/kv/surreal.rs:369-375 | crates/astrid-storage/src/kv/surreal.rs:399-405 — 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/astrid-storage/src/kv/tree.rs:124 — crates/astrid-storage/src/kv/tree.rs:124-130 | crates/astrid-storage/src/kv/tree.rs:143-149 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/astrid-storage/src/kv/tree/adapter.rs:75 — crates/astrid-storage/src/kv/tree/adapter.rs:75-81 | crates/astrid-storage/src/kv/tree/adapter.rs:92-98 — 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/astrid-storage/src/kv/tree/overlay.rs:105 — crates/astrid-storage/src/kv/tree/overlay.rs:105-111 | crates/astrid-storage/src/kv/tree/overlay.rs:121-127 — 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/astrid-storage/src/principal_state/volume_migration.rs:137 — crates/astrid-storage/src/principal_state/volume_migration.rs:137-143 | crates/astrid-storage/src/principal_state/volume_migration.rs:225-232 — 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/astrid-vfs/src/host.rs:195 — crates/astrid-vfs/src/host.rs:195-201 | crates/astrid-vfs/src/host.rs:210-216 — 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/astrid-vfs/src/overlay.rs:232 — crates/astrid-vfs/src/overlay.rs:232-238 | crates/astrid-vfs/src/overlay.rs:257-263 — 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/astrid-crypto/src/keypair.rs:227 — crates/astrid-crypto/src/keypair.rs:227-233 | crates/astrid-crypto/src/signature.rs:76-82 — 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/astrid-kernel/src/kernel_router/admin/agent_create_helpers/create.rs:153 — crates/astrid-kernel/src/kernel_router/admin/agent_create_helpers/create.rs:153-159 | crates/astrid-kernel/src/kernel_router/admin/handlers/mod.rs:615-621 — 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/astrid-storage/src/engine/durable/format/reader.rs:36 — crates/astrid-storage/src/engine/durable/format/reader.rs:36-42 | crates/astrid-storage/src/engine/durable/roots.rs:384-390 — before extracting anything, compare `crates/astrid-storage/src/engine/durable/format/reader.rs` and `crates/astrid-storage/src/engine/durable/roots.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 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.
  • + 21 more in this group — see findings.md.
D2 · Cognitive Complexity · astrid · ×44
  • astrid::tui::render::render_nexus (cognitive 121) crates/astrid-cli/src/tui/render.rs:514 — astrid::tui::render::render_nexus has cognitive complexity 121 (threshold 15). Drivers by points: if/else 20 (64 pts), loops 10 (44 pts), match/switch 3 (12 pts), boolean chains 1 (nesting depth added 87). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • astrid::tui::render::render_input (cognitive 92) crates/astrid-cli/src/tui/render.rs:897 — astrid::tui::render::render_input has cognitive complexity 92 (threshold 15). Drivers by points: if/else 39 (73 pts), boolean chains 12, match/switch 1 (4 pts), loops 1 (3 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • astrid::tui::handle_daemon_event (cognitive 68) crates/astrid-cli/src/tui/mod.rs:217 — astrid::tui::handle_daemon_event has cognitive complexity 68 (threshold 15). Drivers by points: if/else 27 (46 pts), loops 3 (9 pts), boolean chains 7, match/switch 2 (6 pts) (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.
  • astrid::commands::distro::validate::validate_manifest (cognitive 53) crates/astrid-cli/src/commands/distro/validate.rs:77 — astrid::commands::distro::validate::validate_manifest has cognitive complexity 53 (threshold 15). Drivers by points: if/else 24 (35 pts), loops 6 (10 pts), boolean chains 8 (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.
  • astrid::tui::input::handle_idle_input (cognitive 46) crates/astrid-cli/src/tui/input.rs:548 — astrid::tui::input::handle_idle_input has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (43 pts), boolean chains 2, match/switch 1 (nesting depth added 24). 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.
  • astrid::tui::handle_pending_actions (cognitive 43) crates/astrid-cli/src/tui/mod.rs:497 — astrid::tui::handle_pending_actions has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (34 pts), match/switch 2 (5 pts), loops 2 (4 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • astrid::tui::render::render_onboarding_menu (cognitive 40) crates/astrid-cli/src/tui/render.rs:1261 — astrid::tui::render::render_onboarding_menu has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 3 (7 pts), boolean chains 3, match/switch 1 (3 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.
  • astrid::commands::mcp::lifecycle::wait_for_gateway (cognitive 38) crates/astrid-cli/src/commands/mcp/lifecycle.rs:400 — astrid::commands::mcp::lifecycle::wait_for_gateway has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (33 pts), match/switch 1 (3 pts), boolean chains 1, loops 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.
  • astrid::commands::capsule_verb::answer_capsule_approval (cognitive 34) crates/astrid-cli/src/commands/capsule_verb.rs:419 — astrid::commands::capsule_verb::answer_capsule_approval has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (28 pts), match/switch 1 (3 pts), loops 1 (2 pts), boolean chains 1 (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.
  • astrid::commands::setup::run_report (cognitive 33) crates/astrid-cli/src/commands/setup.rs:57 — astrid::commands::setup::run_report has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 2 (7 pts), boolean chains 4 (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.
  • astrid::tui::input::handle_onboarding_enum_input (cognitive 33) crates/astrid-cli/src/tui/input.rs:453 — astrid::tui::input::handle_onboarding_enum_input has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (25 pts), match/switch 3 (7 pts), boolean chains 1 (nesting depth added 18). 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.
  • astrid::commands::capsule::remove::check_removal_safety (cognitive 31) crates/astrid-cli/src/commands/capsule/remove.rs:224 — astrid::commands::capsule::remove::check_removal_safety has cognitive complexity 31 (threshold 15). Drivers by points: loops 6 (16 pts), if/else 6 (14 pts), boolean chains 1 (nesting depth added 18). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • astrid::commands::capsule::deps::build_dep_graph (cognitive 30) crates/astrid-cli/src/commands/capsule/deps.rs:71 — astrid::commands::capsule::deps::build_dep_graph has cognitive complexity 30 (threshold 15). Drivers by points: loops 6 (15 pts), if/else 3 (14 pts), boolean chains 1 (nesting depth added 20). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • astrid::tui::render::render_activity (cognitive 30) crates/astrid-cli/src/tui/render.rs:702 — astrid::tui::render::render_activity has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 1, match/switch 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.
  • astrid::commands::capsule::deps::show_tree (cognitive 29) crates/astrid-cli/src/commands/capsule/deps.rs:144 — astrid::commands::capsule::deps::show_tree has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 5 (13 pts), boolean chains 1, match/switch 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.
  • astrid::tui::render::parse_inline_markdown (cognitive 26) crates/astrid-cli/src/tui/render.rs:112 — astrid::tui::render::parse_inline_markdown has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (7 pts), match/switch 1 (2 pts), boolean chains 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.
  • astrid::commands::doctor::run (cognitive 25) crates/astrid-cli/src/commands/doctor.rs:60 — astrid::commands::doctor::run has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 5 (10 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.
  • astrid::commands::wit::gc (cognitive 25) crates/astrid-cli/src/commands/wit.rs:36 — astrid::commands::wit::gc has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 3 (4 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.
  • astrid::tui::handle_slash_command (cognitive 25) crates/astrid-cli/src/tui/mod.rs:700 — astrid::tui::handle_slash_command has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (21 pts), match/switch 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.
  • astrid::tui::headless::snapshot (cognitive 25) crates/astrid-cli/src/tui/headless.rs:109 — astrid::tui::headless::snapshot has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 6, loops 2 (3 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.
  • astrid::tui::input::handle_onboarding_text_input (cognitive 24) crates/astrid-cli/src/tui/input.rs:361 — astrid::tui::input::handle_onboarding_text_input has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 1, match/switch 1 (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.
  • astrid::main (cognitive 23) crates/astrid-cli/src/main.rs:50 — astrid::main has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 3, 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.
  • astrid::commands::capsule::updates::check (cognitive 21) crates/astrid-cli/src/commands/capsule/updates/mod.rs:154 — astrid::commands::capsule::updates::check has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), match/switch 3 (8 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • astrid::commands::headless::collect_response (cognitive 21) crates/astrid-cli/src/commands/headless.rs:330 — astrid::commands::headless::collect_response has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 2 (4 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.
  • astrid::commands::init::collect_variables (cognitive 21) crates/astrid-cli/src/commands/init.rs:478 — astrid::commands::init::collect_variables has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • + 19 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×43
  • Duplicated block (6 lines × 2) crates/astrid-cli-mockup/src/ui/input.rs:201 — crates/astrid-cli-mockup/src/ui/input.rs:201-206 | crates/astrid-cli/src/tui/input.rs:707-712 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/input.rs` and `crates/astrid-cli/src/tui/input.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 58 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/astrid-cli-mockup/src/ui/render.rs:792 — crates/astrid-cli-mockup/src/ui/render.rs:792-797 | crates/astrid-cli/src/tui/render.rs:304-309 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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/astrid-cli-mockup/src/ui/views/chain.rs:41 — crates/astrid-cli-mockup/src/ui/views/chain.rs:41-46 | crates/astrid-cli-mockup/src/ui/views/chain.rs:68-73 — 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/astrid-cli-mockup/src/ui/views/nexus.rs:69 — crates/astrid-cli-mockup/src/ui/views/nexus.rs:69-74 | crates/astrid-cli/src/tui/render.rs:655-660 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/views/nexus.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 50 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/astrid-cli/src/commands/ps.rs:39 — crates/astrid-cli/src/commands/ps.rs:39-44 | crates/astrid-cli/src/commands/who.rs:48-53 — before extracting anything, compare `crates/astrid-cli/src/commands/ps.rs` and `crates/astrid-cli/src/commands/who.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 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/astrid-events/src/route/entry.rs:337 — crates/astrid-events/src/route/entry.rs:337-342 | crates/astrid-events/src/route/entry.rs:528-533 — 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/astrid-kernel/src/invite/mod.rs:534 — crates/astrid-kernel/src/invite/mod.rs:534-539 | crates/astrid-kernel/src/pair_token/mod.rs:505-510 — `crates/astrid-kernel/src/invite/mod.rs` and `crates/astrid-kernel/src/pair_token/mod.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 17 separate duplicated blocks between them, totalling at least 162 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 (6 lines × 2) crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:232 — crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:232-237 | crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:666-671 — 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/astrid-storage/src/engine/durable/compaction/outbox.rs:282 — crates/astrid-storage/src/engine/durable/compaction/outbox.rs:282-287 | crates/astrid-storage/src/engine/durable/compaction/outbox.rs:384-389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/astrid-storage/src/engine/durable/validation.rs:45 — crates/astrid-storage/src/engine/durable/validation.rs:45-50 | crates/astrid-storage/src/storage_model/world.rs:492-497 — 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/astrid-storage/src/kv/batch.rs:245 — crates/astrid-storage/src/kv/batch.rs:245-250 | crates/astrid-storage/src/kv/batch.rs:255-260 — 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/astrid-storage/src/principal_state/native_io.rs:558 — crates/astrid-storage/src/principal_state/native_io.rs:558-563 | crates/astrid-storage/src/principal_state/native_io.rs:593-598 — 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/astrid-storage/src/volume/hosted/mod.rs:106 — crates/astrid-storage/src/volume/hosted/mod.rs:106-111 | crates/astrid-storage/src/volume/hosted/stream.rs:95-100 — before extracting anything, compare `crates/astrid-storage/src/volume/hosted/mod.rs` and `crates/astrid-storage/src/volume/hosted/stream.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. 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/astrid-storage/src/volume/hosted/mod.rs:121 — crates/astrid-storage/src/volume/hosted/mod.rs:121-126 | crates/astrid-storage/src/volume/hosted/stream.rs:108-113 — before extracting anything, compare `crates/astrid-storage/src/volume/hosted/mod.rs` and `crates/astrid-storage/src/volume/hosted/stream.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. 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/astrid-storage/src/volume/hosted/mod.rs:144 — crates/astrid-storage/src/volume/hosted/mod.rs:144-149 | crates/astrid-storage/src/volume/hosted/stream.rs:130-135 — before extracting anything, compare `crates/astrid-storage/src/volume/hosted/mod.rs` and `crates/astrid-storage/src/volume/hosted/stream.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. 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/astrid-audit/src/log/retention_guard.rs:92 — crates/astrid-audit/src/log/retention_guard.rs:92-97 | crates/astrid-kernel/src/kernel_router/admin/audit_anchor_handlers.rs:121-126 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) crates/astrid-capsule/src/engine/wasm/storage_vfs.rs:574 — crates/astrid-capsule/src/engine/wasm/storage_vfs.rs:574-579 | crates/astrid-kernel/src/storage_mount/filesystem.rs:452-457 — 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/astrid-kernel/src/invite/mod.rs:696 — crates/astrid-kernel/src/invite/mod.rs:696-701 | crates/astrid-kernel/src/pair_token/mod.rs:663-668 — `crates/astrid-kernel/src/invite/mod.rs` and `crates/astrid-kernel/src/pair_token/mod.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 17 separate duplicated blocks between them, totalling at least 162 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 (6 lines × 2) crates/astrid-storage/src/content/store/workspace/filesystem.rs:365 — crates/astrid-storage/src/content/store/workspace/filesystem.rs:365-370 | crates/astrid-storage/src/filesystem.rs:826-831 — before extracting anything, compare `crates/astrid-storage/src/content/store/workspace/filesystem.rs` and `crates/astrid-storage/src/filesystem.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 30 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/astrid-storage/src/engine/durable/format/mod.rs:765 — crates/astrid-storage/src/engine/durable/format/mod.rs:765-770 | crates/astrid-storage/src/engine/durable/roots.rs:283-288 — 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/astrid-storage/src/engine/durable/native_io.rs:188 — crates/astrid-storage/src/engine/durable/native_io.rs:188-193 | crates/astrid-storage/src/engine/durable/representations/contiguous/namespace.rs:130-135 — before extracting anything, compare `crates/astrid-storage/src/engine/durable/native_io.rs` and `crates/astrid-storage/src/engine/durable/representations/contiguous/namespace.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 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/astrid-storage/src/engine/durable/roots.rs:430 — crates/astrid-storage/src/engine/durable/roots.rs:430-435 | crates/astrid-storage/src/engine/durable/wal/codec.rs:750-755 — 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/astrid-storage/src/engine/refinery/cross_hash.rs:802 — crates/astrid-storage/src/engine/refinery/cross_hash.rs:802-807 | crates/astrid-storage/src/engine/refinery/sketch/wire.rs:141-146 — 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/astrid-audit/src/storage.rs:787 — crates/astrid-audit/src/storage.rs:787-792 | crates/astrid-audit/src/storage/heads_page.rs:113-118 — 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/astrid-capsule/src/engine/wasm/mod.rs:1640 — crates/astrid-capsule/src/engine/wasm/mod.rs:1640-1645 | crates/astrid-hooks/src/handler/wasm.rs:369-375 — 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.
  • + 18 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×42
  • Duplicated block (10 lines × 2) crates/astrid-build/src/archiver.rs:298 — crates/astrid-build/src/archiver.rs:298-307 | crates/astrid-build/src/artifact.rs:468-477 — 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/astrid-capabilities/src/store.rs:793 — crates/astrid-capabilities/src/store.rs:793-802 | crates/astrid-capabilities/src/store.rs:823-832 — 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/astrid-capsule-install/src/authority/leftover.rs:272 — crates/astrid-capsule-install/src/authority/leftover.rs:272-281 | crates/astrid-storage/src/principal_state/unbound_legacy.rs:265-274 — before extracting anything, compare `crates/astrid-capsule-install/src/authority/leftover.rs` and `crates/astrid-storage/src/principal_state/unbound_legacy.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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/astrid-capsule/src/engine/wasm/host/fs/resolve.rs:28 — crates/astrid-capsule/src/engine/wasm/host/fs/resolve.rs:28-37 | crates/astrid-vfs/src/host.rs:20-29 — 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/astrid-cli-mockup/src/ui/input.rs:38 — crates/astrid-cli-mockup/src/ui/input.rs:38-47 | crates/astrid-cli/src/tui/input.rs:551-560 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/input.rs` and `crates/astrid-cli/src/tui/input.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 58 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/astrid-cli-mockup/src/ui/render.rs:219 — crates/astrid-cli-mockup/src/ui/render.rs:219-228 | crates/astrid-cli/src/tui/render.rs:248-257 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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/astrid-cli/src/commands/daemon/temporary.rs:27 — crates/astrid-cli/src/commands/daemon/temporary.rs:27-36 | crates/astrid-workspace/src/sandbox/mod.rs:632-641 — 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/astrid-cli/src/tui/state.rs:212 — crates/astrid-cli/src/tui/state.rs:212-221 | crates/astrid-cli/src/tui/state.rs:310-319 — 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/astrid-core/src/platform_fs/windows/executable.rs:355 — crates/astrid-core/src/platform_fs/windows/executable.rs:355-364 | crates/astrid-core/src/platform_fs/windows/private_file.rs:292-301 — before extracting anything, compare `crates/astrid-core/src/platform_fs/windows/executable.rs` and `crates/astrid-core/src/platform_fs/windows/private_file.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 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/astrid-core/src/platform_fs/windows/io.rs:728 — crates/astrid-core/src/platform_fs/windows/io.rs:728-737 | crates/astrid-core/src/platform_fs/windows/path.rs:591-600 — 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/astrid-kernel/src/invite/mod.rs:460 — crates/astrid-kernel/src/invite/mod.rs:460-469 | crates/astrid-kernel/src/pair_token/durable_reservation.rs:277-286 — 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/astrid-kernel/src/invite/mod.rs:514 — crates/astrid-kernel/src/invite/mod.rs:514-523 | crates/astrid-kernel/src/pair_token/mod.rs:485-494 — `crates/astrid-kernel/src/invite/mod.rs` and `crates/astrid-kernel/src/pair_token/mod.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 17 separate duplicated blocks between them, totalling at least 162 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/astrid-kernel/src/invite/mod.rs:579 — crates/astrid-kernel/src/invite/mod.rs:579-588 | crates/astrid-kernel/src/pair_token/mod.rs:548-557 — `crates/astrid-kernel/src/invite/mod.rs` and `crates/astrid-kernel/src/pair_token/mod.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 17 separate duplicated blocks between them, totalling at least 162 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/astrid-kernel/src/kernel_router/admin/agent_create_helpers/derived.rs:188 — crates/astrid-kernel/src/kernel_router/admin/agent_create_helpers/derived.rs:188-200 | crates/astrid-kernel/src/kernel_router/admin/agent_delete.rs:337-346 — 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/astrid-kernel/src/lib.rs:2460 — crates/astrid-kernel/src/lib.rs:2460-2469 | crates/astrid-kernel/src/lib.rs:2579-2588 — 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/astrid-storage-provider-fskit/src/main.rs:600 — crates/astrid-storage-provider-fskit/src/main.rs:600-609 | crates/astrid-storage-provider-winfsp/src/main.rs:448-457 — before extracting anything, compare `crates/astrid-storage-provider-fskit/src/main.rs` and `crates/astrid-storage-provider-winfsp/src/main.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 133 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/astrid-storage-provider-fskit/src/service.rs:61 — crates/astrid-storage-provider-fskit/src/service.rs:61-70 | crates/astrid-storage-provider-winfsp/src/win.rs:172-181 — before extracting anything, compare `crates/astrid-storage-provider-fskit/src/service.rs` and `crates/astrid-storage-provider-winfsp/src/win.rs` as WHOLE FILES: this scan already matched 4 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 (10 lines × 2) crates/astrid-storage-provider-fskit/src/service.rs:307 — crates/astrid-storage-provider-fskit/src/service.rs:307-316 | crates/astrid-storage-provider-fuse/src/service.rs:154-163 — before extracting anything, compare `crates/astrid-storage-provider-fskit/src/service.rs` and `crates/astrid-storage-provider-fuse/src/service.rs` as WHOLE FILES: this scan already matched 8 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 (10 lines × 2) crates/astrid-storage-provider-fuse/src/filesystem.rs:435 — crates/astrid-storage-provider-fuse/src/filesystem.rs:435-444 | crates/astrid-storage-provider-fuse/src/filesystem.rs:447-456 — 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/astrid-storage-provider-winfsp/src/win/filesystem.rs:233 — crates/astrid-storage-provider-winfsp/src/win/filesystem.rs:233-242 | crates/astrid-storage-provider-winfsp/src/win/filesystem.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/astrid-storage/src/content/store/bulk.rs:742 — crates/astrid-storage/src/content/store/bulk.rs:742-751 | crates/astrid-storage/src/content/store/bulk/admission.rs:129-138 — 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/astrid-storage/src/engine/durable/representations/mod.rs:207 — crates/astrid-storage/src/engine/durable/representations/mod.rs:207-216 | crates/astrid-storage/src/engine/durable/representations/volume.rs:91-100 — before extracting anything, compare `crates/astrid-storage/src/engine/durable/representations/mod.rs` and `crates/astrid-storage/src/engine/durable/representations/volume.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 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/astrid-storage/src/engine/durable/representations/mod.rs:219 — crates/astrid-storage/src/engine/durable/representations/mod.rs:219-228 | crates/astrid-storage/src/engine/durable/representations/volume.rs:104-113 — before extracting anything, compare `crates/astrid-storage/src/engine/durable/representations/mod.rs` and `crates/astrid-storage/src/engine/durable/representations/volume.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 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/astrid-storage/src/engine/durable/validation.rs:49 — crates/astrid-storage/src/engine/durable/validation.rs:49-58 | crates/astrid-storage/src/engine/durable/validation.rs:154-163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/astrid-storage/src/engine/durable_cache/mod.rs:757 — crates/astrid-storage/src/engine/durable_cache/mod.rs:757-766 | crates/astrid-storage/src/engine/durable_cache/mod.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.
  • + 17 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×41
  • Duplicated block (5 lines × 2) crates/astrid-capsule/src/engine/wasm/host/process/persistent/mod.rs:168 — crates/astrid-capsule/src/engine/wasm/host/process/persistent/mod.rs:168-172 | crates/astrid-capsule/src/engine/wasm/host/process/persistent/mod.rs:309-313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/astrid-capsule/src/engine/wasm/storage_vfs.rs:258 — crates/astrid-capsule/src/engine/wasm/storage_vfs.rs:258-262 | crates/astrid-capsule/src/engine/wasm/storage_vfs.rs:409-413 — 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/astrid-cli-mockup/src/ui/render.rs:448 — crates/astrid-cli-mockup/src/ui/render.rs:448-453 | crates/astrid-cli/src/tui/render.rs:703-707 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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 (5 lines × 2) crates/astrid-cli-mockup/src/ui/render.rs:479 — crates/astrid-cli-mockup/src/ui/render.rs:479-483 | crates/astrid-cli/src/tui/render.rs:731-735 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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 (5 lines × 2) crates/astrid-cli-mockup/src/ui/render.rs:770 — crates/astrid-cli-mockup/src/ui/render.rs:770-774 | crates/astrid-cli/src/tui/render.rs:1541-1545 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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 (5 lines × 2) crates/astrid-cli/src/commands/distro/trust.rs:87 — crates/astrid-cli/src/commands/distro/trust.rs:87-91 | crates/astrid-cli/src/commands/mcp/lifecycle.rs:173-177 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) crates/astrid-core/src/local_transport/windows/acl.rs:227 — crates/astrid-core/src/local_transport/windows/acl.rs:227-231 | crates/astrid-core/src/platform_fs/windows/acl/ace.rs:142-146 — before extracting anything, compare `crates/astrid-core/src/local_transport/windows/acl.rs` and `crates/astrid-core/src/platform_fs/windows/acl/ace.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 108 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 (5 lines × 2) crates/astrid-gateway/src/routes/quotas.rs:125 — crates/astrid-gateway/src/routes/quotas.rs:125-129 | crates/astrid-gateway/src/routes/quotas.rs:164-168 — 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/astrid-kernel/src/invite/storage_migration.rs:28 — crates/astrid-kernel/src/invite/storage_migration.rs:28-32 | crates/astrid-kernel/src/pair_token/storage_migration.rs:29-33 — `crates/astrid-kernel/src/invite/storage_migration.rs` and `crates/astrid-kernel/src/pair_token/storage_migration.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 43 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 (5 lines × 2) crates/astrid-kernel/src/invite/storage_migration.rs:73 — crates/astrid-kernel/src/invite/storage_migration.rs:73-77 | crates/astrid-kernel/src/pair_token/storage_migration.rs:89-93 — `crates/astrid-kernel/src/invite/storage_migration.rs` and `crates/astrid-kernel/src/pair_token/storage_migration.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 43 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 (5 lines × 2) crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:338 — crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:338-342 | crates/astrid-kernel/src/legacy_migration_barrier/ledger.rs:886-890 — 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/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:893 — crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:893-897 | crates/astrid-kernel/src/principal_distro_migration.rs:438-442 — 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/astrid-kernel/src/principal_home_migration/mod.rs:71 — crates/astrid-kernel/src/principal_home_migration/mod.rs:71-75 | crates/astrid-kernel/src/principal_home_migration/unbound.rs:32-36 — 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/astrid-storage-provider-fskit/src/service.rs:233 — crates/astrid-storage-provider-fskit/src/service.rs:233-237 | crates/astrid-storage-provider-fuse/src/service.rs:311-315 — before extracting anything, compare `crates/astrid-storage-provider-fskit/src/service.rs` and `crates/astrid-storage-provider-fuse/src/service.rs` as WHOLE FILES: this scan already matched 8 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 (5 lines × 2) crates/astrid-storage-provider-fuse/src/filesystem.rs:687 — crates/astrid-storage-provider-fuse/src/filesystem.rs:687-691 | crates/astrid-storage-provider-fuse/src/filesystem.rs:699-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 (5 lines × 2) crates/astrid-storage/src/content/store/workspace/filesystem.rs:292 — crates/astrid-storage/src/content/store/workspace/filesystem.rs:292-296 | crates/astrid-storage/src/filesystem.rs:711-715 — before extracting anything, compare `crates/astrid-storage/src/content/store/workspace/filesystem.rs` and `crates/astrid-storage/src/filesystem.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 30 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 (5 lines × 2) crates/astrid-storage/src/engine/durable/compaction/evidence.rs:271 — crates/astrid-storage/src/engine/durable/compaction/evidence.rs:271-275 | crates/astrid-storage/src/engine/durable/roots.rs:267-271 — 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/astrid-storage/src/engine/durable/compaction/evidence.rs:275 — crates/astrid-storage/src/engine/durable/compaction/evidence.rs:275-279 | crates/astrid-storage/src/engine/durable/compaction/facts.rs:28-32 — 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/astrid-storage/src/kv/surreal.rs:363 — crates/astrid-storage/src/kv/surreal.rs:363-367 | crates/astrid-storage/src/kv/surreal.rs:393-397 — 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/astrid-storage/src/kv/tree/context.rs:600 — crates/astrid-storage/src/kv/tree/context.rs:600-604 | crates/astrid-storage/src/kv/tree/header.rs:438-442 — 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/astrid-storage/src/principal_state/native_io.rs:552 — crates/astrid-storage/src/principal_state/native_io.rs:552-556 | crates/astrid-storage/src/principal_state/native_io.rs:587-591 — 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/astrid-storage/src/volume/hosted/mod.rs:115 — crates/astrid-storage/src/volume/hosted/mod.rs:115-119 | crates/astrid-storage/src/volume/hosted/stream.rs:102-106 — before extracting anything, compare `crates/astrid-storage/src/volume/hosted/mod.rs` and `crates/astrid-storage/src/volume/hosted/stream.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. 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/astrid-vfs/src/overlay.rs:223 — crates/astrid-vfs/src/overlay.rs:223-227 | crates/astrid-vfs/src/overlay.rs:246-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 (5 lines × 2) crates/astrid-vfs/src/overlay_registry.rs:170 — crates/astrid-vfs/src/overlay_registry.rs:170-174 | crates/astrid-vfs/src/overlay_registry.rs:187-195 — 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/astrid-vfs/src/workspace_cow/apfs.rs:216 — crates/astrid-vfs/src/workspace_cow/apfs.rs:216-220 | crates/astrid-vfs/src/workspace_cow/overlayfs.rs:485-489 — 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.
  • + 16 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×38
  • Duplicated block (8 lines × 2) crates/astrid-audit/src/storage.rs:426 — crates/astrid-audit/src/storage.rs:426-433 | crates/astrid-audit/src/storage/append_batch.rs:302-309 — 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/astrid-capsule/src/elicitation/mod.rs:366 — crates/astrid-capsule/src/elicitation/mod.rs:366-373 | crates/astrid-capsule/src/elicitation/mod.rs:455-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.
  • Duplicated block (8 lines × 2) crates/astrid-cli/src/commands/capsule/install.rs:284 — crates/astrid-cli/src/commands/capsule/install.rs:284-291 | crates/astrid-cli/src/commands/capsule/install.rs:476-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 (8 lines × 2) crates/astrid-cli/src/commands/doctor.rs:227 — crates/astrid-cli/src/commands/doctor.rs:227-234 | crates/astrid-cli/src/commands/doctor.rs:254-261 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/astrid-cli/src/dispatch.rs:139 — crates/astrid-cli/src/dispatch.rs:139-146 | crates/astrid-cli/src/dispatch.rs:148-155 — 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/astrid-core/src/dirs_layout_retirement.rs:336 — crates/astrid-core/src/dirs_layout_retirement.rs:336-343 | crates/astrid-core/src/runtime_scratch.rs:199-206 — before extracting anything, compare `crates/astrid-core/src/dirs_layout_retirement.rs` and `crates/astrid-core/src/runtime_scratch.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 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 × 2) crates/astrid-core/src/platform_fs.rs:546 — crates/astrid-core/src/platform_fs.rs:546-553 | crates/astrid-core/src/platform_fs.rs:566-573 — 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/astrid-core/src/platform_fs/windows/executable.rs:493 — crates/astrid-core/src/platform_fs/windows/executable.rs:493-500 | crates/astrid-core/src/platform_fs/windows/private_file.rs:498-505 — before extracting anything, compare `crates/astrid-core/src/platform_fs/windows/executable.rs` and `crates/astrid-core/src/platform_fs/windows/private_file.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 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 × 2) crates/astrid-kernel/src/kernel_router/admin/agent_create_helpers/create.rs:175 — crates/astrid-kernel/src/kernel_router/admin/agent_create_helpers/create.rs:175-182 | crates/astrid-kernel/src/kernel_router/admin/handlers/capsule_assignment.rs:35-42 — 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/astrid-kernel/src/kernel_router/admin/distro_handlers.rs:20 — crates/astrid-kernel/src/kernel_router/admin/distro_handlers.rs:20-27 | crates/astrid-kernel/src/kernel_router/admin/distro_handlers.rs:67-74 — 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/astrid-kernel/src/kernel_router/admin/handlers/mod.rs:780 — crates/astrid-kernel/src/kernel_router/admin/handlers/mod.rs:780-787 | crates/astrid-kernel/src/kernel_router/admin/handlers/user_principals.rs:87-94 — 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/astrid-kernel/src/kernel_router/install_batch.rs:74 — crates/astrid-kernel/src/kernel_router/install_batch.rs:74-82 | crates/astrid-storage/src/principal_state/native_io.rs:846-853 — 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/astrid-kernel/src/legacy_migration_barrier/legacy_audit.rs:80 — crates/astrid-kernel/src/legacy_migration_barrier/legacy_audit.rs:80-87 | crates/astrid-kernel/src/principal_home_migration/unbound.rs:277-284 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) crates/astrid-kernel/src/legacy_migration_barrier/legacy_permissions.rs:41 — crates/astrid-kernel/src/legacy_migration_barrier/legacy_permissions.rs:41-48 | crates/astrid-kernel/src/legacy_migration_barrier/legacy_permissions.rs:134-141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/astrid-storage-provider-fuse/src/main.rs:165 — crates/astrid-storage-provider-fuse/src/main.rs:165-172 | crates/astrid-storage-provider-winfsp/src/main.rs:101-108 — before extracting anything, compare `crates/astrid-storage-provider-fuse/src/main.rs` and `crates/astrid-storage-provider-winfsp/src/main.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 30 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/astrid-storage/src/content/store/bulk.rs:752 — crates/astrid-storage/src/content/store/bulk.rs:752-759 | crates/astrid-storage/src/content/store/bulk/admission.rs:140-147 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) crates/astrid-storage/src/engine/durable/representations/mod.rs:137 — crates/astrid-storage/src/engine/durable/representations/mod.rs:137-144 | crates/astrid-storage/src/engine/durable/representations/mod.rs:146-153 — 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/astrid-storage/src/kv/surreal.rs:378 — crates/astrid-storage/src/kv/surreal.rs:378-385 | crates/astrid-storage/src/kv/surreal.rs:408-417 — 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/astrid-storage/src/kv/tree.rs:106 — crates/astrid-storage/src/kv/tree.rs:106-113 | crates/astrid-storage/src/kv/tree.rs:172-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 (8 lines × 2) crates/astrid-storage/src/principal_state/staging/journal.rs:164 — crates/astrid-storage/src/principal_state/staging/journal.rs:164-171 | crates/astrid-storage/src/principal_state/staging/journal.rs:335-342 — 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/astrid-vfs/src/host.rs:323 — crates/astrid-vfs/src/host.rs:323-330 | crates/astrid-vfs/src/host.rs:358-365 — 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/astrid-capsule/src/discovery.rs:19 — crates/astrid-capsule/src/discovery.rs:19-26 | crates/astrid-cli/src/commands/distro/validate.rs:40-47 — 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/astrid-cli-mockup/src/ui/theme.rs:29 — crates/astrid-cli-mockup/src/ui/theme.rs:29-36 | crates/astrid-cli/src/tui/theme.rs:25-32 — 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/astrid-storage/src/engine/durable/group/mod.rs:199 — crates/astrid-storage/src/engine/durable/group/mod.rs:199-206 | crates/astrid-storage/src/principal_state/staging/group.rs:185-192 — 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/astrid-capsule/src/engine/wasm/host/net/handshake.rs:114 — crates/astrid-capsule/src/engine/wasm/host/net/handshake.rs:114-124 | crates/astrid-uplink/src/native/handshake.rs:97-104 — before extracting anything, compare `crates/astrid-capsule/src/engine/wasm/host/net/handshake.rs` and `crates/astrid-uplink/src/native/handshake.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 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.
  • + 13 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×37
  • Hotspot: crates/astrid-capsule/src/engine/wasm/mod.rs crates/astrid-capsule/src/engine/wasm/mod.rs:1690 — crates/astrid-capsule/src/engine/wasm/mod.rs changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in WasmEngine::load at line 1690. 15 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-capsule/src/engine/wasm/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/astrid-kernel/src/kernel_router/mod.rs crates/astrid-kernel/src/kernel_router/mod.rs:179 — crates/astrid-kernel/src/kernel_router/mod.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in astrid_kernel::kernel_router::handle_request at line 179. 8 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-kernel/src/kernel_router/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/astrid-kernel/src/kernel_router/admin/mod.rs crates/astrid-kernel/src/kernel_router/admin/mod.rs:559 — crates/astrid-kernel/src/kernel_router/admin/mod.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in astrid_kernel::kernel_router::admin::admin_request_method at line 559. 4 of those changes were fix/bug commits, 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-kernel/src/kernel_router/admin/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/astrid-kernel/src/lib.rs crates/astrid-kernel/src/lib.rs:4090 — crates/astrid-kernel/src/lib.rs changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in astrid_kernel::preflight_legacy_audit_sources at line 4090. 20 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-kernel/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/astrid-cli/src/dispatch.rs crates/astrid-cli/src/dispatch.rs:133 — crates/astrid-cli/src/dispatch.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in astrid::dispatch::dispatch_subcommand at line 133. 9 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-cli/src/dispatch.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/astrid-uplink/src/admin_client.rs crates/astrid-uplink/src/admin_client.rs:43 — crates/astrid-uplink/src/admin_client.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in astrid_uplink::admin_client::topic_suffix at line 43. 3 of those changes were fix/bug commits, and the other 6 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-uplink/src/admin_client.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: scripts/runatal_v1_reader.py scripts/runatal_v1_reader.py:837 — scripts/runatal_v1_reader.py changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in runatal_v1_reader.recover at line 837. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- scripts/runatal_v1_reader.py`: 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/astrid-storage/src/engine/durable/mod.rs crates/astrid-storage/src/engine/durable/mod.rs:447 — crates/astrid-storage/src/engine/durable/mod.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in DurableError::fmt at line 447. 2 of those changes were fix/bug commits, and the other 14 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-storage/src/engine/durable/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/astrid-kernel/src/kernel_router/admin/handlers/mod.rs crates/astrid-kernel/src/kernel_router/admin/handlers/mod.rs:469 — crates/astrid-kernel/src/kernel_router/admin/handlers/mod.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in astrid_kernel::kernel_router::admin::handlers::agent_modify_from_req at line 469. 6 of those changes were fix/bug commits, and the other 11 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-kernel/src/kernel_router/admin/handlers/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/astrid-storage/src/content/store.rs crates/astrid-storage/src/content/store.rs:601 — crates/astrid-storage/src/content/store.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in PrincipalContentStore::rename_batch_replacing at line 601. 3 of those changes were fix/bug commits, and the other 7 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-storage/src/content/store.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/astrid-capsule-install/src/local.rs crates/astrid-capsule-install/src/local.rs:547 — crates/astrid-capsule-install/src/local.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in astrid_capsule_install::local::install_from_local_path_internal at line 547. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-capsule-install/src/local.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/astrid-capsule/src/dispatcher.rs crates/astrid-capsule/src/dispatcher.rs:717 — crates/astrid-capsule/src/dispatcher.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in astrid_capsule::dispatcher::collect_matching_interceptors at line 717. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-capsule/src/dispatcher.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/astrid-storage/src/engine/durable/engine.rs crates/astrid-storage/src/engine/durable/engine.rs:613 — crates/astrid-storage/src/engine/durable/engine.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in DurableEngine::prepare at line 613. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-storage/src/engine/durable/engine.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/astrid-capsule/src/engine/wasm/host/ipc.rs crates/astrid-capsule/src/engine/wasm/host/ipc.rs:228 — crates/astrid-capsule/src/engine/wasm/host/ipc.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in astrid_capsule::engine::wasm::host::ipc::publish_inner at line 228. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-capsule/src/engine/wasm/host/ipc.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/astrid-core/src/dirs.rs crates/astrid-core/src/dirs.rs:364 — crates/astrid-core/src/dirs.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in AstridHome::ensure at line 364. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-core/src/dirs.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/astrid-cli/src/tui/mod.rs crates/astrid-cli/src/tui/mod.rs:217 — crates/astrid-cli/src/tui/mod.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in astrid::tui::handle_daemon_event at line 217. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-cli/src/tui/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/astrid-daemon/src/lib.rs crates/astrid-daemon/src/lib.rs:250 — crates/astrid-daemon/src/lib.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in astrid_daemon::run_with_args at line 250. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-daemon/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/astrid-capsule/src/engine/wasm/host/net/mod.rs crates/astrid-capsule/src/engine/wasm/host/net/mod.rs:481 — crates/astrid-capsule/src/engine/wasm/host/net/mod.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in HostState::bind_tcp at line 481. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-capsule/src/engine/wasm/host/net/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: scripts/runatal_v1_physical.py scripts/runatal_v1_physical.py:670 — scripts/runatal_v1_physical.py changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in runatal_v1_physical.validate_map at line 670. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- scripts/runatal_v1_physical.py`: 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/astrid-capsule/src/engine/wasm/host/process/mod.rs crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:664 — crates/astrid-capsule/src/engine/wasm/host/process/mod.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in HostState::spawn_persistent at line 664. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-capsule/src/engine/wasm/host/process/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/astrid-uplink/src/native/mod.rs crates/astrid-uplink/src/native/mod.rs:451 — crates/astrid-uplink/src/native/mod.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in astrid_uplink::native::serve_connection at line 451. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-uplink/src/native/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/astrid-uplink/src/kernel_client.rs crates/astrid-uplink/src/kernel_client.rs:169 — crates/astrid-uplink/src/kernel_client.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in astrid_uplink::kernel_client::topic_suffix 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-uplink/src/kernel_client.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/astrid-cli/src/commands/agent/mod.rs crates/astrid-cli/src/commands/agent/mod.rs:272 — crates/astrid-cli/src/commands/agent/mod.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in astrid::commands::agent::run at line 272. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-cli/src/commands/agent/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/astrid-storage/src/ownership.rs crates/astrid-storage/src/ownership.rs:161 — crates/astrid-storage/src/ownership.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in OwnershipSnapshot::validate at line 161. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-storage/src/ownership.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/astrid-capsule/src/engine/wasm/host/approval.rs crates/astrid-capsule/src/engine/wasm/host/approval.rs:358 — crates/astrid-capsule/src/engine/wasm/host/approval.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in HostState::request_approval at line 358. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-capsule/src/engine/wasm/host/approval.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.
  • + 12 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×36
  • Repeated repair: crates/astrid-cli/src/commands/daemon.rs crates/astrid-cli/src/commands/daemon.rs:827 — crates/astrid-cli/src/commands/daemon.rs changed 15 times in last 90 days and 14 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is astrid::commands::daemon::cleanup_daemon_runtime_for_home at line 827), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(runtime): avoid repeated cleanup decoding and release start fences (#2209)”; “fix(cli): detach daemon boot stderr from piped callers (#2116)”; “fix(storage): tolerate Finder metadata during stop (#2109)”; “fix(cli): select daemon workspace independently of client context (#2099)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-cli/src/commands/daemon.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.
  • Repeated repair: crates/astrid-cli/src/commands/init.rs crates/astrid-cli/src/commands/init.rs:478 — crates/astrid-cli/src/commands/init.rs changed 11 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is astrid::commands::init::collect_variables at line 478), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(init): preserve configured values when applying distro defaults (#1985)”; “fix(cli): refresh selected authenticated Distro members (#1971)”; “fix(release): preserve migration and provider setup (#1951)”; “fix(runtime): handle optional credentials and clean daemon retirement (#1911)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-cli/src/commands/init.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.
  • Repeated repair: crates/astrid-cli/src/commands/mcp/mod.rs crates/astrid-cli/src/commands/mcp/mod.rs:184 — crates/astrid-cli/src/commands/mcp/mod.rs changed 12 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is astrid::commands::mcp::serve at line 184), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mcp): report correlated invocation failures promptly (#2122)”; “fix(cli): select daemon workspace independently of client context (#2099)”; “fix(cli): keep diagnostics outside the runtime projection (#2062)”; “fix(mcp): retire gateways after the final host disconnects (#1896)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-cli/src/commands/mcp/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.
  • Repeated repair: crates/astrid-storage/src/engine/durable/compaction/volume.rs crates/astrid-storage/src/engine/durable/compaction/volume.rs:23 — crates/astrid-storage/src/engine/durable/compaction/volume.rs changed 9 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is DurableEngine::compact_volume_locked at line 23), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(storage): make index and fallback volume recovery linear (#2184)”; “fix(storage): checkpoint volume roots during compaction (#2022)”; “fix(storage): reclaim obsolete representation metadata on compaction (#2020)”; “fix(storage): publish volume index before reopen (#1636)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-storage/src/engine/durable/compaction/volume.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.
  • Repeated repair: crates/astrid-cli/src/cli.rs crates/astrid-cli/src/cli.rs:613 — crates/astrid-cli/src/cli.rs changed 11 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is astrid::cli::parse_distro_capsule_name at line 613), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(cli): select daemon workspace independently of client context (#2099)”; “fix(cli): refresh selected authenticated Distro members (#1971)”; “fix(capsules): purge principal KV on removal (#1955)”; “fix(mcp): retire gateways after the final host disconnects (#1896)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-cli/src/cli.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.
  • Repeated repair: crates/astrid-config/src/types.rs crates/astrid-config/src/types.rs:774 — crates/astrid-config/src/types.rs changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is SparkSection::is_empty at line 774), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mcp): retire gateways after the final host disconnects (#1896)”; “fix(macos): make FSKit discovery and callback mounting work (#1874)”; “fix(config): remove host-side model configuration (#1829)”; “fix(runtime): layout-2 live upgrade liveness and AOS MCP argv (#1607)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-config/src/types.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.
  • Repeated repair: crates/astrid-kernel/src/kernel_router/install.rs crates/astrid-kernel/src/kernel_router/install.rs:380 — crates/astrid-kernel/src/kernel_router/install.rs changed 10 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is astrid_kernel::kernel_router::install::validate_install_provenance at line 380), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(kernel): preserve principal capsule configuration on grant (#2035)”; “fix(init): preserve configured values when applying distro defaults (#1985)”; “fix(cli): refresh selected authenticated Distro members (#1971)”; “fix(runtime): apply install env once before activation (#1976)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-kernel/src/kernel_router/install.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.
  • Repeated repair: crates/astrid-storage/src/volume/hosted/mod.rs crates/astrid-storage/src/volume/hosted/mod.rs:470 — crates/astrid-storage/src/volume/hosted/mod.rs changed 7 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is Operation::decode at line 470), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(storage): bound dirty-commit extent-map amplification (#2017)”; “fix(storage): bound hosted extent mutation scans (#1889)”; “fix(storage): skip full flushes of unchanged hosted volumes (#1887)”; “fix(storage): make hosted volume open millisecond-class (#1640)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-storage/src/volume/hosted/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.
  • Repeated repair: crates/astrid-events/src/bus.rs crates/astrid-events/src/bus.rs:292 — crates/astrid-events/src/bus.rs changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is EventBus::publish_reserved at line 292), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(events): admit scope before retaining delivery snapshots (#2203)”; “fix(ipc): report nested capsule delivery failures (#2129)”; “fix(streaming): preserve bounded delivery during provider bursts (#2045)”; “fix(approval): bind responses to authenticated request owners (#1939)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-events/src/bus.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.
  • Repeated repair: crates/astrid-cli/src/commands/mcp/gateway.rs crates/astrid-cli/src/commands/mcp/gateway.rs:880 — crates/astrid-cli/src/commands/mcp/gateway.rs changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is astrid::commands::mcp::gateway::read_gateway_request_inner at line 880), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(cli): select daemon workspace independently of client context (#2099)”; “fix(mcp): retire gateways after the final host disconnects (#1896)”; “fix(mcp): preserve connected sessions across quiet periods (#1894)”; “fix(cli): fence runtime shutdown generations (#1809)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-cli/src/commands/mcp/gateway.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.
  • Repeated repair: crates/astrid-audit/src/storage.rs crates/astrid-audit/src/storage.rs:877 — crates/astrid-audit/src/storage.rs changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is KvAuditStorage::get_session_entries at line 877), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(runtime): layout-2 live upgrade liveness and AOS MCP argv (#1607)”; “fix(audit): freeze layout-1 source during MOVE (#1599)”; “fix(audit): blind payload MOVE into native TreeKvStore (#1597)”; “fix(audit): move layout-1 history with batched native ingest (#1588)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-audit/src/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.
  • Repeated repair: crates/astrid-cli/src/commands/init_grant.rs crates/astrid-cli/src/commands/init_grant.rs:301 — crates/astrid-cli/src/commands/init_grant.rs changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is astrid::commands::init_grant::validated_grant_set_for_reuse at line 301), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(cli): release provisioning flock when its guard ends (#2193)”; “fix(init): honor explicit grants after completed batch resume (#1906)”; “fix(runtime): stop with exactly astrid.volume”; “fix(cli): bind signed Distro.toml apply to caller grants (#1827)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-cli/src/commands/init_grant.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.
  • Repeated repair: crates/astrid-cli/src/bootstrap.rs crates/astrid-cli/src/bootstrap.rs:144 — crates/astrid-cli/src/bootstrap.rs changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is astrid::bootstrap::run_or_connect at line 144), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(cli): keep diagnostics outside the runtime projection (#2062)”; “fix(config): remove host-side model configuration (#1829)”; “fix(runtime): layout-2 live upgrade liveness and AOS MCP argv (#1607)”; “fix(kernel): admit leftover layout-1 homes without identity (#1579)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-cli/src/bootstrap.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.
  • Repeated repair: crates/astrid-cli/src/commands/daemon_control.rs crates/astrid-cli/src/commands/daemon_control.rs:378 — crates/astrid-cli/src/commands/daemon_control.rs changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is astrid::commands::daemon_control::terminate_known at line 378), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(cli): refuse readiness waits without a live daemon (#2058)”; “fix(cli): wait for acknowledged daemon finalization (#2052)”; “fix(release): preserve migration and provider setup (#1951)”; “fix(runtime): handle optional credentials and clean daemon retirement (#1911)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-cli/src/commands/daemon_control.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.
  • Repeated repair: crates/astrid-capsule/src/lib.rs crates/astrid-capsule/src/lib.rs:78 — crates/astrid-capsule/src/lib.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is astrid_capsule::test_support::validate_local_handshake at line 78), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(audit): make host-audit recording ordered and loss-accounted (#2003)”; “fix(capsule): bound WASM growth and in-flight fuel (#1553)”; “fix(runtime): isolate executable capsules by authority (#1487)”; “fix(kernel): enumerate run-loop capsule tools via the describe fan-out (#1198) (#1382)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-capsule/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.
  • Repeated repair: crates/astrid-core/src/platform_fs.rs crates/astrid-core/src/platform_fs.rs:842 — crates/astrid-core/src/platform_fs.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is astrid_core::platform_fs::replace_executable_set_by_rename at line 842), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(core): use captured descriptors for macOS private-path ACL checks”; “fix(storage): recover stopped-install runtime key residue (#2079)”; “fix(runtime): stop with exactly astrid.volume”; “fix(runtime): layout-2 live upgrade liveness and AOS MCP argv (#1607)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-core/src/platform_fs.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.
  • Repeated repair: crates/astrid-storage/src/engine/durable/representations/volume.rs crates/astrid-storage/src/engine/durable/representations/volume.rs:60 — crates/astrid-storage/src/engine/durable/representations/volume.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is RepresentationStore::activate_volume at line 60), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(storage): reclaim obsolete representation metadata on compaction (#2020)”; “revert: remove #1611 LooseBlob convert from main (#1614)”; “fix(storage): convert LooseBlob homes into packed arena frames (#1611)”; “fix(storage): stop journaling a full objects.index snapshot per file (#1601)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-storage/src/engine/durable/representations/volume.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.
  • Repeated repair: crates/astrid-capsule-install/src/authority.rs crates/astrid-capsule-install/src/authority.rs:226 — crates/astrid-capsule-install/src/authority.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is astrid_capsule_install::authority::retire_legacy_authority_receipt at line 226), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(windows): preserve private runtime identity lifecycle (#1866)”; “fix(storage): pack durable runtime tree including wasm (#1617)”; “fix(capsule): retire relocated leftover authority receipts (#1585)”; “fix(install): pin approved capsule executables (#1555)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-capsule-install/src/authority.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.
  • Repeated repair: crates/astrid-cli/src/commands/capsule/install_daemon.rs crates/astrid-cli/src/commands/capsule/install_daemon.rs:441 — crates/astrid-cli/src/commands/capsule/install_daemon.rs changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is astrid::commands::capsule::install_daemon::validate_values at line 441), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(cli): refresh selected authenticated Distro members (#1971)”; “fix(runtime): apply install env once before activation (#1976)”; “fix(release): preserve migration and provider setup (#1951)”; “fix(capsule): skip completed principal-scoped installs before InstallCapsule (#1844)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-cli/src/commands/capsule/install_daemon.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.
  • Repeated repair: crates/astrid-cli/src/commands/daemon/projection.rs crates/astrid-cli/src/commands/daemon/projection.rs:65 — crates/astrid-cli/src/commands/daemon/projection.rs changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is astrid::commands::daemon::projection::retire_disconnected_projection at line 65), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(runtime): avoid repeated cleanup decoding and release start fences (#2209)”; “fix(capsule): restore runtime identity before install inspection (#2071)”; “fix(runtime): unify shutdown finalization and preserve capsule content (#1908)”; “fix(mcp): retire gateways after the final host disconnects (#1896)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-cli/src/commands/daemon/projection.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.
  • Repeated repair: crates/astrid-config/src/loader.rs crates/astrid-config/src/loader.rs:65 — crates/astrid-config/src/loader.rs changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is astrid_config::loader::load_with_layout at line 65), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(config): load canonical user configuration consistently”; “fix(config): remove host-side model configuration (#1829)”; “fix(kernel): admit leftover layout-1 homes without identity (#1579)”; “fix(runtime): isolate executable capsules by authority (#1487)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-config/src/loader.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.
  • Repeated repair: crates/astrid-types/src/ipc.rs crates/astrid-types/src/ipc.rs:495 — crates/astrid-types/src/ipc.rs changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is IpcPayload::from_json_value at line 495), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ipc): report nested capsule delivery failures (#2129)”; “fix(mcp): report correlated invocation failures promptly (#2122)”; “fix(uplink): recover cancelled turns and subsequent input (#2046)”; “fix(approval): bind responses to authenticated request owners (#1939)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-types/src/ipc.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.
  • Repeated repair: crates/astrid-capsule/src/capsule.rs crates/astrid-capsule/src/capsule.rs:309 — crates/astrid-capsule/src/capsule.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is CompositeCapsule::load at line 309), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(capsule): retire compiled cache keys after final runtime release (#2199)”; “fix(streaming): preserve bounded delivery during provider bursts (#2045)”; “fix(runtime): isolate executable capsules by authority (#1487)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-capsule/src/capsule.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.
  • Repeated repair: crates/astrid-kernel/src/kernel_router/rate_limit.rs crates/astrid-kernel/src/kernel_router/rate_limit.rs:161 — crates/astrid-kernel/src/kernel_router/rate_limit.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is astrid_kernel::kernel_router::rate_limit::rate_limit_max at line 161), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(release): preserve migration and provider setup (#1951)”; “fix(capsule): skip completed principal-scoped installs before InstallCapsule (#1844)”; “fix(runtime): layout-2 live upgrade liveness and AOS MCP argv (#1607)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-kernel/src/kernel_router/rate_limit.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.
  • Repeated repair: crates/astrid-storage/src/principal_state/contiguous_ingest.rs crates/astrid-storage/src/principal_state/contiguous_ingest.rs:82 — crates/astrid-storage/src/principal_state/contiguous_ingest.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is RuntimePrincipalStore::replace_contiguous_files_removing_exact at line 82), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(runtime): stop with exactly astrid.volume”; “fix(storage): pack principal home imports in arena (#1609)”; “fix(storage): stop journaling a full objects.index snapshot per file (#1601)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 06:15:38 +04:00' --until='2026-10-27 06:15:38 +04:00' --full-history --no-merges -- crates/astrid-storage/src/principal_state/contiguous_ingest.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.
  • + 11 more in this group — see findings.md.
D2 · Cognitive Complexity · astrid_kernel · ×31
  • astrid_kernel::legacy_migration_barrier::ledger::validate_ledger_shape (cognitive 62) crates/astrid-kernel/src/legacy_migration_barrier/ledger.rs:610 — astrid_kernel::legacy_migration_barrier::ledger::validate_ledger_shape has cognitive complexity 62 (threshold 15). Drivers by points: if/else 19 (41 pts), boolean chains 20, 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.
  • astrid_kernel::legacy_migration_barrier::ensure_no_unretired_component_sources (cognitive 52) crates/astrid-kernel/src/legacy_migration_barrier/mod.rs:830 — astrid_kernel::legacy_migration_barrier::ensure_no_unretired_component_sources has cognitive complexity 52 (threshold 15). Drivers by points: if/else 21 (46 pts), loops 4 (6 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • astrid_kernel::kernel_router::handle_request (cognitive 50) crates/astrid-kernel/src/kernel_router/mod.rs:179 — astrid_kernel::kernel_router::handle_request has cognitive complexity 50 (threshold 15). Drivers by points: match/switch 15 (31 pts), if/else 8 (12 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 23). 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.
  • astrid_kernel::legacy_migration_barrier::ledger::collect_destination_proofs (cognitive 50) crates/astrid-kernel/src/legacy_migration_barrier/ledger.rs:20 — astrid_kernel::legacy_migration_barrier::ledger::collect_destination_proofs has cognitive complexity 50 (threshold 15). Drivers by points: if/else 21 (41 pts), loops 4 (5 pts), boolean chains 2, match/switch 1 (2 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.
  • astrid_kernel::legacy_migration_barrier::ledger::validate_existing_proofs (cognitive 27) crates/astrid-kernel/src/legacy_migration_barrier/ledger.rs:384 — astrid_kernel::legacy_migration_barrier::ledger::validate_existing_proofs has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 5, loops 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.
  • astrid_kernel::principal_home_migration::retire_one_receipted_source (cognitive 27) crates/astrid-kernel/src/principal_home_migration/mod.rs:249 — astrid_kernel::principal_home_migration::retire_one_receipted_source has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • astrid_kernel::storage_mount::resolve_owner (cognitive 25) crates/astrid-kernel/src/storage_mount.rs:388 — astrid_kernel::storage_mount::resolve_owner has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 4, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • astrid_kernel::kernel_router::admin::inheritance::copy_kv_namespaces (cognitive 24) crates/astrid-kernel/src/kernel_router/admin/inheritance.rs:260 — astrid_kernel::kernel_router::admin::inheritance::copy_kv_namespaces has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 4 (11 pts), loops 4 (7 pts), if/else 3 (6 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.
  • astrid_kernel::legacy_migration_barrier::env_import::import_env_and_secrets (cognitive 22) crates/astrid-kernel/src/legacy_migration_barrier/env_import.rs:40 — astrid_kernel::legacy_migration_barrier::env_import::import_env_and_secrets has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (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.
  • astrid_kernel::storage_mount::execute_operation (cognitive 22) crates/astrid-kernel/src/storage_mount.rs:796 — astrid_kernel::storage_mount::execute_operation has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 2, match/switch 2 (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.
  • astrid_kernel::kernel_router::admin::handlers::env_handlers::env_list (cognitive 21) crates/astrid-kernel/src/kernel_router/admin/handlers/env_handlers.rs:341 — astrid_kernel::kernel_router::admin::handlers::env_handlers::env_list has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 4 (12 pts), if/else 4 (5 pts), loops 2 (3 pts), 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.
  • astrid_kernel::legacy_migration_barrier::retirement::retire_tree_with_access (cognitive 21) crates/astrid-kernel/src/legacy_migration_barrier/retirement.rs:39 — astrid_kernel::legacy_migration_barrier::retirement::retire_tree_with_access has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 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.
  • astrid_kernel::legacy_migration_barrier::import_gateway_revocations (cognitive 20) crates/astrid-kernel/src/legacy_migration_barrier/mod.rs:609 — astrid_kernel::legacy_migration_barrier::import_gateway_revocations has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • astrid_kernel::principal_distro_migration::migrate_one (cognitive 20) crates/astrid-kernel/src/principal_distro_migration.rs:195 — astrid_kernel::principal_distro_migration::migrate_one has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • astrid_kernel::validate_imports_exports (cognitive 19) crates/astrid-kernel/src/lib.rs:5135 — astrid_kernel::validate_imports_exports has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 5 (7 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.
  • astrid_kernel::kernel_router::admin::handlers::mutate_caps (cognitive 19) crates/astrid-kernel/src/kernel_router/admin/handlers/mod.rs:823 — astrid_kernel::kernel_router::admin::handlers::mutate_caps has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 4 (6 pts), boolean chains 2, loops 2 (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.
  • astrid_kernel::legacy_migration_barrier::host_fs::collect_workspace_targets (cognitive 19) crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:211 — astrid_kernel::legacy_migration_barrier::host_fs::collect_workspace_targets has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts), boolean chains 1, 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.
  • astrid_kernel::preflight_legacy_audit_sources (cognitive 17) crates/astrid-kernel/src/lib.rs:4090 — astrid_kernel::preflight_legacy_audit_sources has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 3 (5 pts), boolean chains 3, 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.
  • astrid_kernel::kernel_router::admin::distro_handlers::self_grant (cognitive 17) crates/astrid-kernel/src/kernel_router/admin/distro_handlers.rs:104 — astrid_kernel::kernel_router::admin::distro_handlers::self_grant has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 6 (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.
  • astrid_kernel::principal_home_migration::walk_directory (cognitive 17) crates/astrid-kernel/src/principal_home_migration/mod.rs:486 — astrid_kernel::principal_home_migration::walk_directory has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 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.
  • astrid_kernel::principal_home_migration::paths::receipt_uid_for_alias (cognitive 17) crates/astrid-kernel/src/principal_home_migration/paths.rs:36 — astrid_kernel::principal_home_migration::paths::receipt_uid_for_alias has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, loops 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • astrid_kernel::storage_mount::serve_listener (cognitive 17) crates/astrid-kernel/src/storage_mount.rs:539 — astrid_kernel::storage_mount::serve_listener has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (11 pts), match/switch 2 (5 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.
  • astrid_kernel::spawn_idle_monitor (cognitive 16) crates/astrid-kernel/src/lib.rs:4491 — astrid_kernel::spawn_idle_monitor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • astrid_kernel::bus_monitor::spawn_bus_activity_monitor (cognitive 16) crates/astrid-kernel/src/bus_monitor.rs:154 — astrid_kernel::bus_monitor::spawn_bus_activity_monitor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (4 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.
  • astrid_kernel::kernel_router::spawn_kernel_router (cognitive 16) crates/astrid-kernel/src/kernel_router/mod.rs:80 — astrid_kernel::kernel_router::spawn_kernel_router has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 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.
  • + 6 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×28
  • Duplicated block (12 lines × 2) crates/astrid-capsule-install/src/contracts.rs:105 — crates/astrid-capsule-install/src/contracts.rs:105-116 | crates/astrid-capsule-install/src/contracts.rs:173-184 — 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/astrid-capsule/src/engine/wasm/host/approval.rs:326 — crates/astrid-capsule/src/engine/wasm/host/approval.rs:326-337 | crates/astrid-capsule/src/engine/wasm/host/consent_egress.rs:291-302 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12 lines × 2) crates/astrid-capsule/src/engine/wasm/host/fs/resolve.rs:137 — crates/astrid-capsule/src/engine/wasm/host/fs/resolve.rs:137-148 | crates/astrid-capsule/src/engine/wasm/host/fs/resolve.rs:221-232 — 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/astrid-capsule/src/engine/wasm/host/net/mod.rs:299 — crates/astrid-capsule/src/engine/wasm/host/net/mod.rs:299-310 | crates/astrid-capsule/src/engine/wasm/host/process/audit.rs:66-77 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) crates/astrid-capsule/src/engine/wasm/mod.rs:1983 — crates/astrid-capsule/src/engine/wasm/mod.rs:1983-1994 | crates/astrid-capsule/src/engine/wasm/mod.rs:2030-2041 — 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/astrid-cli-mockup/src/ui/render.rs:1057 — crates/astrid-cli-mockup/src/ui/render.rs:1057-1068 | crates/astrid-cli/src/tui/render.rs:1642-1653 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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 (12 lines × 2) crates/astrid-cli-mockup/src/ui/views/chain.rs:101 — crates/astrid-cli-mockup/src/ui/views/chain.rs:101-112 | crates/astrid-cli-mockup/src/ui/views/nexus.rs:136-147 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12 lines × 2) crates/astrid-cli-mockup/src/ui/views/nexus.rs:55 — crates/astrid-cli-mockup/src/ui/views/nexus.rs:55-66 | crates/astrid-cli/src/tui/render.rs:641-652 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/views/nexus.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 50 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 (12 lines × 2) crates/astrid-cli/src/commands/ps.rs:47 — crates/astrid-cli/src/commands/ps.rs:47-58 | crates/astrid-cli/src/commands/who.rs:56-67 — before extracting anything, compare `crates/astrid-cli/src/commands/ps.rs` and `crates/astrid-cli/src/commands/who.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 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/astrid-core/src/dirs_layout_retirement.rs:42 — crates/astrid-core/src/dirs_layout_retirement.rs:42-53 | crates/astrid-core/src/dirs_layout_retirement.rs:273-284 — 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/astrid-core/src/groups/io_impl.rs:110 — crates/astrid-core/src/groups/io_impl.rs:110-121 | crates/astrid-core/src/profile/io_impl.rs:163-174 — `crates/astrid-core/src/groups/io_impl.rs` and `crates/astrid-core/src/profile/io_impl.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 4 separate duplicated blocks between them, totalling at least 58 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 (12 lines × 2) crates/astrid-core/src/platform_fs/windows/path.rs:191 — crates/astrid-core/src/platform_fs/windows/path.rs:191-202 | crates/astrid-core/src/platform_fs/windows/path.rs:852-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 (12 lines × 2) crates/astrid-kernel/src/kernel_router/admin/group.rs:125 — crates/astrid-kernel/src/kernel_router/admin/group.rs:125-136 | crates/astrid-kernel/src/kernel_router/admin/handlers/mod.rs:717-728 — 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/astrid-kernel/src/kernel_router/admin/pair_device_handlers.rs:122 — crates/astrid-kernel/src/kernel_router/admin/pair_device_handlers.rs:122-133 | crates/astrid-kernel/src/kernel_router/admin/pair_device_handlers.rs:350-361 — 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/astrid-storage/src/content_dag/boundary.rs:132 — crates/astrid-storage/src/content_dag/boundary.rs:132-143 | crates/astrid-storage/src/content_dag/boundary.rs:144-155 — 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/astrid-storage/src/engine/durable/native_io.rs:158 — crates/astrid-storage/src/engine/durable/native_io.rs:158-169 | crates/astrid-storage/src/engine/durable/representations/contiguous/namespace.rs:103-114 — before extracting anything, compare `crates/astrid-storage/src/engine/durable/native_io.rs` and `crates/astrid-storage/src/engine/durable/representations/contiguous/namespace.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 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 (12 lines × 2) crates/astrid-storage/src/engine/durable/representations/mod.rs:166 — crates/astrid-storage/src/engine/durable/representations/mod.rs:166-177 | crates/astrid-storage/src/engine/durable/representations/volume.rs:47-58 — before extracting anything, compare `crates/astrid-storage/src/engine/durable/representations/mod.rs` and `crates/astrid-storage/src/engine/durable/representations/volume.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 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/astrid-storage/src/env.rs:325 — crates/astrid-storage/src/env.rs:325-336 | crates/astrid-storage/src/env.rs:387-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 (12 lines × 2) crates/astrid-storage/src/kv/tree/context.rs:611 — crates/astrid-storage/src/kv/tree/context.rs:611-622 | crates/astrid-storage/src/kv/tree/header.rs:449-460 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12 lines × 2) crates/astrid-storage/src/kv/tree/overlay.rs:140 — crates/astrid-storage/src/kv/tree/overlay.rs:140-151 | crates/astrid-storage/src/kv/tree/overlay.rs:158-169 — 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/astrid-storage/src/principal_state/runtime_tree.rs:558 — crates/astrid-storage/src/principal_state/runtime_tree.rs:558-569 | crates/astrid-storage/src/principal_state/runtime_tree.rs:811-822 — 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/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:540 — crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:540-551 | crates/astrid-kernel/src/principal_log_migration.rs:510-521 — 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/astrid-storage/src/engine/durable/format/reader.rs:19 — crates/astrid-storage/src/engine/durable/format/reader.rs:19-30 | crates/astrid-storage/src/engine/durable/roots.rs:367-378 — before extracting anything, compare `crates/astrid-storage/src/engine/durable/format/reader.rs` and `crates/astrid-storage/src/engine/durable/roots.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 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 (12 lines × 2) crates/astrid-capsule-install/src/archive.rs:195 — crates/astrid-capsule-install/src/archive.rs:195-206 | crates/astrid-capsule-install/src/local.rs:404-415 — before extracting anything, compare `crates/astrid-capsule-install/src/archive.rs` and `crates/astrid-capsule-install/src/local.rs` as WHOLE FILES: this scan already matched 4 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. 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/astrid-capsule/src/engine/wasm/host/io.rs:247 — crates/astrid-capsule/src/engine/wasm/host/io.rs:247-258 | crates/astrid-capsule/src/engine/wasm/host/ipc.rs:162-173 — 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.
  • + 3 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×24
  • FunctionTooLong: astrid_kernel::kernel_router::handle_request crates/astrid-kernel/src/kernel_router/mod.rs:179 — FunctionTooLong — astrid_kernel::kernel_router::handle_request runs 336 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 236 over it, 3.36× 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: astrid_capsule_install::local::install_from_local_path_internal crates/astrid-capsule-install/src/local.rs:547 — FunctionTooLong — astrid_capsule_install::local::install_from_local_path_internal runs 279 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 179 over it, 2.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: astrid_kernel::legacy_migration_barrier::ledger::collect_destination_proofs crates/astrid-kernel/src/legacy_migration_barrier/ledger.rs:20 — FunctionTooLong — astrid_kernel::legacy_migration_barrier::ledger::collect_destination_proofs runs 224 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 124 over it, 2.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: astrid::tui::render::render_input crates/astrid-cli/src/tui/render.rs:897 — FunctionTooLong — astrid::tui::render::render_input runs 211 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 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: astrid_cli_mockup::ui::views::nexus::render_nexus_entry crates/astrid-cli-mockup/src/ui/views/nexus.rs:244 — FunctionTooLong — astrid_cli_mockup::ui::views::nexus::render_nexus_entry runs 195 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 95 over it, 1.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: astrid::tui::handle_daemon_event crates/astrid-cli/src/tui/mod.rs:217 — FunctionTooLong — astrid::tui::handle_daemon_event runs 186 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 86 over it, 1.86× 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: astrid_config::merge::restrict::enforce_restrictions crates/astrid-config/src/merge/restrict.rs:15 — FunctionTooLong — astrid_config::merge::restrict::enforce_restrictions runs 184 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 84 over it, 1.84× 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: astrid_storage::content::store::workspace::codec::decode_workspace_record crates/astrid-storage/src/content/store/workspace/codec.rs:133 — FunctionTooLong — astrid_storage::content::store::workspace::codec::decode_workspace_record runs 171 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 71 over it, 1.71× 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: astrid::tui::handle_pending_actions crates/astrid-cli/src/tui/mod.rs:497 — FunctionTooLong — astrid::tui::handle_pending_actions runs 151 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 51 over it, 1.51× 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: astrid_daemon::run_with_args crates/astrid-daemon/src/lib.rs:250 — FunctionTooLong — astrid_daemon::run_with_args runs 141 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 41 over it, 1.41× 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: astrid::tui::render::render_activity crates/astrid-cli/src/tui/render.rs:702 — FunctionTooLong — astrid::tui::render::render_activity 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.
  • FunctionTooLong: astrid_capsule::engine::wasm::build_lifecycle_host_state crates/astrid-capsule/src/engine/wasm/mod.rs:3774 — FunctionTooLong — astrid_capsule::engine::wasm::build_lifecycle_host_state runs 128 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 28 over it, 1.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: astrid::tui::render::render_nexus crates/astrid-cli/src/tui/render.rs:514 — FunctionTooLong — astrid::tui::render::render_nexus runs 121 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 21 over it, 1.21× 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: astrid_kernel::legacy_migration_barrier::ledger::validate_ledger_shape crates/astrid-kernel/src/legacy_migration_barrier/ledger.rs:610 — FunctionTooLong — astrid_kernel::legacy_migration_barrier::ledger::validate_ledger_shape runs 121 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 21 over it, 1.21× 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: astrid_cli_mockup::ui::render::render_welcome crates/astrid-cli-mockup/src/ui/render.rs:802 — FunctionTooLong — astrid_cli_mockup::ui::render::render_welcome 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.
  • FunctionTooLong: astrid_cli_mockup::ui::views::command::render_table crates/astrid-cli-mockup/src/ui/views/command.rs:94 — FunctionTooLong — astrid_cli_mockup::ui::views::command::render_table runs 119 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 19 over it, 1.19× 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: astrid_storage::engine::durable::wal::replay::replay_transaction crates/astrid-storage/src/engine/durable/wal/replay.rs:255 — FunctionTooLong — astrid_storage::engine::durable::wal::replay::replay_transaction runs 118 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 18 over it, 1.18× 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: astrid_capsule_install::storage::migration::migrate_native_capsules_with_report crates/astrid-capsule-install/src/storage/migration.rs:92 — FunctionTooLong — astrid_capsule_install::storage::migration::migrate_native_capsules_with_report runs 117 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 17 over it, 1.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.
  • FunctionTooLong: astrid_cli_mockup::ui::input::handle_idle_input crates/astrid-cli-mockup/src/ui/input.rs:37 — FunctionTooLong — astrid_cli_mockup::ui::input::handle_idle_input runs 117 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 17 over it, 1.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.
  • FunctionTooLong: astrid_cli_mockup::ui::views::topology::render_topology crates/astrid-cli-mockup/src/ui/views/topology.rs:15 — FunctionTooLong — astrid_cli_mockup::ui::views::topology::render_topology runs 115 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 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: astrid_kernel::legacy_migration_barrier::preflight_sources crates/astrid-kernel/src/legacy_migration_barrier/mod.rs:696 — FunctionTooLong — astrid_kernel::legacy_migration_barrier::preflight_sources runs 113 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 13 over it, 1.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: astrid_kernel::legacy_migration_barrier::ensure_no_unretired_component_sources crates/astrid-kernel/src/legacy_migration_barrier/mod.rs:830 — FunctionTooLong — astrid_kernel::legacy_migration_barrier::ensure_no_unretired_component_sources 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.
  • FunctionTooLong: astrid::dispatch::dispatch_subcommand crates/astrid-cli/src/dispatch.rs:133 — FunctionTooLong — astrid::dispatch::dispatch_subcommand 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.
  • FunctionTooLong: astrid::tui::input::handle_idle_input crates/astrid-cli/src/tui/input.rs:548 — FunctionTooLong — astrid::tui::input::handle_idle_input 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.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×24
  • Duplicated block (11 lines × 2) crates/astrid-cli-mockup/src/ui/render.rs:55 — crates/astrid-cli-mockup/src/ui/render.rs:55-65 | crates/astrid-cli/src/tui/render.rs:86-96 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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/astrid-cli-mockup/src/ui/render.rs:577 — crates/astrid-cli-mockup/src/ui/render.rs:577-587 | crates/astrid-cli/src/tui/render.rs:366-376 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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/astrid-core/src/dirs.rs:377 — crates/astrid-core/src/dirs.rs:377-387 | crates/astrid-core/src/dirs.rs:474-484 — 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/astrid-kernel/src/kernel_router/resume_receipt.rs:24 — crates/astrid-kernel/src/kernel_router/resume_receipt.rs:24-34 | crates/astrid-kernel/src/kernel_router/resume_receipt.rs:76-86 — 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/astrid-storage-provider-fuse/src/filesystem.rs:391 — crates/astrid-storage-provider-fuse/src/filesystem.rs:391-401 | crates/astrid-storage-provider-fuse/src/filesystem.rs:422-432 — 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/astrid-storage/src/content/store.rs:637 — crates/astrid-storage/src/content/store.rs:637-647 | crates/astrid-storage/src/content/store.rs:656-666 — 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/astrid-storage/src/content/store/projection.rs:422 — crates/astrid-storage/src/content/store/projection.rs:422-432 | crates/astrid-storage/src/kv/tree/legacy_avl.rs:465-475 — 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/astrid-storage/src/content/store/workspace/filesystem.rs:92 — crates/astrid-storage/src/content/store/workspace/filesystem.rs:92-102 | crates/astrid-storage/src/filesystem.rs:469-479 — before extracting anything, compare `crates/astrid-storage/src/content/store/workspace/filesystem.rs` and `crates/astrid-storage/src/filesystem.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 30 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/astrid-storage/src/engine/durable/format/mod.rs:153 — crates/astrid-storage/src/engine/durable/format/mod.rs:153-163 | crates/astrid-storage/src/engine/durable/format/mod.rs:462-472 — 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/astrid-storage/src/engine/durable/index/mod.rs:155 — crates/astrid-storage/src/engine/durable/index/mod.rs:155-165 | crates/astrid-storage/src/engine/durable/index/mod.rs:184-194 — 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/astrid-storage/src/engine/durable/wal/scan.rs:315 — crates/astrid-storage/src/engine/durable/wal/scan.rs:315-325 | crates/astrid-storage/src/engine/durable/wal/writer.rs:246-256 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) crates/astrid-storage/src/env/legacy_import.rs:253 — crates/astrid-storage/src/env/legacy_import.rs:253-263 | crates/astrid-storage/src/env/legacy_import.rs:270-280 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/astrid-storage/src/principal_state/native_io.rs:499 — crates/astrid-storage/src/principal_state/native_io.rs:499-509 | crates/astrid-storage/src/principal_state/native_io.rs:664-674 — 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/astrid-storage/src/resources/pool.rs:140 — crates/astrid-storage/src/resources/pool.rs:140-150 | crates/astrid-storage/src/resources/pool.rs:312-322 — 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/astrid-storage/src/volume/hosted/mod.rs:371 — crates/astrid-storage/src/volume/hosted/mod.rs:371-381 | crates/astrid-storage/src/volume/hosted/mod.rs:397-407 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/astrid-storage/src/volume/hosted/open.rs:78 — crates/astrid-storage/src/volume/hosted/open.rs:78-88 | crates/astrid-storage/src/volume/hosted/reclaim.rs:83-93 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) crates/astrid-cli-mockup/src/ui/input.rs:401 — crates/astrid-cli-mockup/src/ui/input.rs:401-413 | crates/astrid-cli/src/tui/input.rs:871-881 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/input.rs` and `crates/astrid-cli/src/tui/input.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 58 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/astrid-crypto/src/keypair.rs:167 — crates/astrid-crypto/src/keypair.rs:167-177 | crates/astrid-crypto/src/signature.rs:30-40 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) crates/astrid-kernel/src/kernel_router/admin/inheritance.rs:216 — crates/astrid-kernel/src/kernel_router/admin/inheritance.rs:216-226 | crates/astrid-kernel/src/kernel_router/admin/inheritance.rs:227-239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:433 — crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:433-443 | crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:698-709 — 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/astrid-cli-mockup/src/ui/render.rs:70 — crates/astrid-cli-mockup/src/ui/render.rs:70-80 | crates/astrid-cli/src/tui/render.rs:99-109 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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/astrid-storage/src/kv/tree/delta.rs:335 — crates/astrid-storage/src/kv/tree/delta.rs:335-345 | crates/astrid-storage/src/kv/tree/node.rs:481-491 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) crates/astrid-storage/src/principal_state/staging/legacy.rs:85 — crates/astrid-storage/src/principal_state/staging/legacy.rs:85-95 | crates/astrid-storage/src/principal_state/staging/migration.rs:156-166 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) crates/astrid-cli-mockup/src/demo/player.rs:280 — crates/astrid-cli-mockup/src/demo/player.rs:280-290 | crates/astrid-cli-mockup/src/demo/player.rs:340-350 — 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.
D2 · Cognitive Complexity · astrid_storage · ×23
  • astrid_storage::engine::durable::wal::replay::replay_transaction (cognitive 38) crates/astrid-storage/src/engine/durable/wal/replay.rs:255 — astrid_storage::engine::durable::wal::replay::replay_transaction has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 7 (8 pts), boolean chains 2 (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.
  • astrid_storage::principal_state::staging::legacy::inspect_migration_intents (cognitive 30) crates/astrid-storage/src/principal_state/staging/legacy.rs:33 — astrid_storage::principal_state::staging::legacy::inspect_migration_intents has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 2 (7 pts), boolean chains 4, loops 2 (4 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.
  • astrid_storage::engine::durable::wal::replay::wal_repair_object_ids (cognitive 29) crates/astrid-storage/src/engine/durable/wal/replay.rs:48 — astrid_storage::engine::durable::wal::replay::wal_repair_object_ids has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (19 pts), loops 3 (7 pts), match/switch 1 (2 pts), boolean chains 1 (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.
  • astrid_storage::volume::hosted::recover::recover_from_headers (cognitive 26) crates/astrid-storage/src/volume/hosted/recover.rs:198 — astrid_storage::volume::hosted::recover::recover_from_headers has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 2 (4 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.
  • astrid_storage::volume::hosted::recover::apply_record (cognitive 26) crates/astrid-storage/src/volume/hosted/recover.rs:318 — astrid_storage::volume::hosted::recover::apply_record has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 7, 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.
  • astrid_storage::content::store::workspace::codec::decode_workspace_record (cognitive 23) crates/astrid-storage/src/content/store/workspace/codec.rs:133 — astrid_storage::content::store::workspace::codec::decode_workspace_record has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 6, match/switch 3 (5 pts), loops 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.
  • astrid_storage::principal_state::format_amendment::prepare_destination (cognitive 23) crates/astrid-storage/src/principal_state/format_amendment.rs:314 — astrid_storage::principal_state::format_amendment::prepare_destination has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • astrid_storage::principal_state::runtime_tree::reconcile_running_projection (cognitive 22) crates/astrid-storage/src/principal_state/runtime_tree.rs:786 — astrid_storage::principal_state::runtime_tree::reconcile_running_projection has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 5, match/switch 2 (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.
  • astrid_storage::content::projection_names::planner::plan_node (cognitive 21) crates/astrid-storage/src/content/projection_names/planner.rs:133 — astrid_storage::content::projection_names::planner::plan_node has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (5 pts), match/switch 1 (2 pts), boolean chains 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.
  • astrid_storage::engine::durable::representations::activation::append_new_reachable_map_nodes (cognitive 21) crates/astrid-storage/src/engine/durable/representations/activation.rs:133 — astrid_storage::engine::durable::representations::activation::append_new_reachable_map_nodes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (5 pts), boolean chains 4, 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.
  • astrid_storage::engine::durable::wal::scan::has_valid_physical_after (cognitive 21) crates/astrid-storage/src/engine/durable/wal/scan.rs:633 — astrid_storage::engine::durable::wal::scan::has_valid_physical_after has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, 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.
  • astrid_storage::env::copy_secret_store (cognitive 21) crates/astrid-storage/src/env.rs:419 — astrid_storage::env::copy_secret_store has cognitive complexity 21 (threshold 15). Drivers by points: if/else 2 (8 pts), loops 4 (7 pts), match/switch 3 (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.
  • astrid_storage::principal_state::runtime_tree::restore_projection (cognitive 21) crates/astrid-storage/src/principal_state/runtime_tree.rs:244 — astrid_storage::principal_state::runtime_tree::restore_projection has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 1 (3 pts), boolean chains 2, 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.
  • astrid_storage::engine::durable::format::scan_frames_with_protected_prefix (cognitive 20) crates/astrid-storage/src/engine/durable/format/mod.rs:318 — astrid_storage::engine::durable::format::scan_frames_with_protected_prefix has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (19 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.
  • astrid_storage::storage_model::physical::representation::validate_recipe (cognitive 20) crates/astrid-storage/src/storage_model/physical/representation.rs:509 — astrid_storage::storage_model::physical::representation::validate_recipe has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2, match/switch 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.
  • astrid_storage::engine::durable::staging::staged_closure_evidence (cognitive 18) crates/astrid-storage/src/engine/durable/staging.rs:51 — astrid_storage::engine::durable::staging::staged_closure_evidence has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (6 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.
  • astrid_storage::kv::tree::delta::decode_delta (cognitive 18) crates/astrid-storage/src/kv/tree/delta.rs:198 — astrid_storage::kv::tree::delta::decode_delta has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 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.
  • astrid_storage::kv::tree::header::decode_kv_component (cognitive 18) crates/astrid-storage/src/kv/tree/header.rs:299 — astrid_storage::kv::tree::header::decode_kv_component has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • astrid_storage::volume::hosted::recover::replay_checkpoint_tail (cognitive 18) crates/astrid-storage/src/volume/hosted/recover.rs:579 — astrid_storage::volume::hosted::recover::replay_checkpoint_tail has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • astrid_storage::kv::tree::node::decode_leaf (cognitive 17) crates/astrid-storage/src/kv/tree/node.rs:308 — astrid_storage::kv::tree::node::decode_leaf has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, 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.
  • astrid_storage::engine::durable::restore::collect_restore (cognitive 16) crates/astrid-storage/src/engine/durable/restore.rs:134 — astrid_storage::engine::durable::restore::collect_restore has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • astrid_storage::env::copy_secret_scope (cognitive 16) crates/astrid-storage/src/env.rs:355 — astrid_storage::env::copy_secret_scope has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 4 (6 pts), 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.
  • astrid_storage::principal_state::owner_migration::derive_bindings (cognitive 16) crates/astrid-storage/src/principal_state/owner_migration.rs:402 — astrid_storage::principal_state::owner_migration::derive_bindings has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), match/switch 2 (4 pts), boolean chains 3, 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.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×19
  • Duplicated block (14 lines × 2) crates/astrid-capsule-install/src/authority/leftover.rs:70 — crates/astrid-capsule-install/src/authority/leftover.rs:70-83 | crates/astrid-capsule-install/src/authority/leftover.rs:155-168 — 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/astrid-capsule-types/src/manifest/topics.rs:64 — crates/astrid-capsule-types/src/manifest/topics.rs:64-77 | crates/astrid-capsule-types/src/manifest/topics.rs:167-180 — 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/astrid-capsule/src/engine/wasm/host/process/audit.rs:69 — crates/astrid-capsule/src/engine/wasm/host/process/audit.rs:69-82 | crates/astrid-capsule/src/engine/wasm/host/process/audit.rs:132-145 — 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/astrid-capsule/src/engine/wasm/host/process/mod.rs:289 — crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:289-302 | crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:527-540 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) crates/astrid-cli-mockup/src/ui/render.rs:777 — crates/astrid-cli-mockup/src/ui/render.rs:777-790 | crates/astrid-cli/src/tui/render.rs:289-302 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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 (14 lines × 2) crates/astrid-cli-mockup/src/ui/views/log.rs:44 — crates/astrid-cli-mockup/src/ui/views/log.rs:44-57 | crates/astrid-cli-mockup/src/ui/views/nexus.rs:280-293 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/views/log.rs` and `crates/astrid-cli-mockup/src/ui/views/nexus.rs` as WHOLE FILES: this scan already matched 3 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 (14 lines × 2) crates/astrid-cli/src/tui/state.rs:143 — crates/astrid-cli/src/tui/state.rs:143-156 | crates/astrid-cli/src/tui/state.rs:257-270 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) crates/astrid-core/src/identity/ownership.rs:436 — crates/astrid-core/src/identity/ownership.rs:436-449 | crates/astrid-core/src/identity/principal.rs:259-272 — before extracting anything, compare `crates/astrid-core/src/identity/ownership.rs` and `crates/astrid-core/src/identity/principal.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 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/astrid-core/src/platform_fs/windows/executable.rs:433 — crates/astrid-core/src/platform_fs/windows/executable.rs:433-446 | crates/astrid-core/src/platform_fs/windows/private_file.rs:427-440 — before extracting anything, compare `crates/astrid-core/src/platform_fs/windows/executable.rs` and `crates/astrid-core/src/platform_fs/windows/private_file.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 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/astrid-hooks/src/handler/command.rs:213 — crates/astrid-hooks/src/handler/command.rs:213-226 | crates/astrid-hooks/src/handler/http.rs:94-107 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (14 lines × 2) crates/astrid-storage-provider-fskit/src/main.rs:64 — crates/astrid-storage-provider-fskit/src/main.rs:64-77 | crates/astrid-storage-provider-winfsp/src/main.rs:70-83 — before extracting anything, compare `crates/astrid-storage-provider-fskit/src/main.rs` and `crates/astrid-storage-provider-winfsp/src/main.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 133 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 (14 lines × 2) crates/astrid-storage-provider-fuse/src/main.rs:356 — crates/astrid-storage-provider-fuse/src/main.rs:356-369 | crates/astrid-storage-provider-fuse/src/main.rs:387-400 — 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/astrid-storage/src/content/catalog/tree.rs:224 — crates/astrid-storage/src/content/catalog/tree.rs:224-237 | crates/astrid-storage/src/content/catalog/tree.rs:263-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 (14 lines × 2) crates/astrid-storage/src/engine/kv.rs:630 — crates/astrid-storage/src/engine/kv.rs:630-643 | crates/astrid-storage/src/kv/tree/legacy_avl.rs:319-332 — 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 (14 lines × 2) crates/astrid-storage/src/kv/surreal.rs:246 — crates/astrid-storage/src/kv/surreal.rs:246-259 | crates/astrid-storage/src/kv/surreal.rs:277-290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) crates/astrid-storage/src/principal_state/native_io.rs:360 — crates/astrid-storage/src/principal_state/native_io.rs:360-373 | crates/astrid-storage/src/principal_state/native_io.rs:396-409 — 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/astrid-storage/src/storage_model/proof.rs:109 — crates/astrid-storage/src/storage_model/proof.rs:109-122 | crates/astrid-storage/src/storage_model/proof.rs:260-273 — 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/astrid-capsule-install/src/archive.rs:307 — crates/astrid-capsule-install/src/archive.rs:307-320 | crates/astrid-capsule-install/src/local.rs:473-486 — before extracting anything, compare `crates/astrid-capsule-install/src/archive.rs` and `crates/astrid-capsule-install/src/local.rs` as WHOLE FILES: this scan already matched 4 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. 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/astrid-hooks/src/handler/command.rs:237 — crates/astrid-hooks/src/handler/command.rs:237-250 | crates/astrid-hooks/src/handler/http.rs:116-129 — 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.
D1 · Cyclomatic Complexity · astrid_kernel · ×14
  • astrid_kernel::kernel_router::handle_request (cyclomatic 46) crates/astrid-kernel/src/kernel_router/mod.rs:179 — astrid_kernel::kernel_router::handle_request has cyclomatic complexity 46 (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.
  • astrid_kernel::legacy_migration_barrier::ledger::validate_ledger_shape (cyclomatic 41) crates/astrid-kernel/src/legacy_migration_barrier/ledger.rs:610 — astrid_kernel::legacy_migration_barrier::ledger::validate_ledger_shape has cyclomatic complexity 41 (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.
  • astrid_kernel::legacy_migration_barrier::ledger::collect_destination_proofs (cyclomatic 30) crates/astrid-kernel/src/legacy_migration_barrier/ledger.rs:20 — astrid_kernel::legacy_migration_barrier::ledger::collect_destination_proofs has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • astrid_kernel::legacy_migration_barrier::ensure_no_unretired_component_sources (cyclomatic 21) crates/astrid-kernel/src/legacy_migration_barrier/mod.rs:830 — astrid_kernel::legacy_migration_barrier::ensure_no_unretired_component_sources 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.
  • astrid_kernel::kernel_router::admin::distro_handlers::self_grant (cyclomatic 18) crates/astrid-kernel/src/kernel_router/admin/distro_handlers.rs:104 — astrid_kernel::kernel_router::admin::distro_handlers::self_grant 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.
  • astrid_kernel::storage_mount::resolve_owner (cyclomatic 18) crates/astrid-kernel/src/storage_mount.rs:388 — astrid_kernel::storage_mount::resolve_owner 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.
  • astrid_kernel::storage_mount::execute_operation (cyclomatic 18) crates/astrid-kernel/src/storage_mount.rs:796 — astrid_kernel::storage_mount::execute_operation 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.
  • astrid_kernel::preflight_legacy_audit_sources (cyclomatic 17) crates/astrid-kernel/src/lib.rs:4090 — astrid_kernel::preflight_legacy_audit_sources 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.
  • astrid_kernel::kernel_router::admin::handlers::agent_modify_from_req (cyclomatic 17) crates/astrid-kernel/src/kernel_router/admin/handlers/mod.rs:469 — astrid_kernel::kernel_router::admin::handlers::agent_modify_from_req 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.
  • astrid_kernel::legacy_migration_barrier::host_fs::preflight_legacy_audit_sources (cyclomatic 17) crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:314 — astrid_kernel::legacy_migration_barrier::host_fs::preflight_legacy_audit_sources 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.
  • astrid_kernel::legacy_migration_barrier::ledger::validate_existing_proofs (cyclomatic 17) crates/astrid-kernel/src/legacy_migration_barrier/ledger.rs:384 — astrid_kernel::legacy_migration_barrier::ledger::validate_existing_proofs 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.
  • astrid_kernel::kernel_router::admin::handlers::mutate_caps (cyclomatic 16) crates/astrid-kernel/src/kernel_router/admin/handlers/mod.rs:823 — astrid_kernel::kernel_router::admin::handlers::mutate_caps 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.
  • astrid_kernel::kernel_router::admin::inheritance::copy_kv_namespaces (cyclomatic 16) crates/astrid-kernel/src/kernel_router/admin/inheritance.rs:260 — astrid_kernel::kernel_router::admin::inheritance::copy_kv_namespaces 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.
  • astrid_kernel::storage_mount::filesystem::execute_blocking (cyclomatic 16) crates/astrid-kernel/src/storage_mount/filesystem.rs:321 — astrid_kernel::storage_mount::filesystem::execute_blocking 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.
D3 · God Classes · MethodTooLong · ×14
  • MethodTooLong: WasmEngine.load crates/astrid-capsule/src/engine/wasm/mod.rs:1690 — MethodTooLong — load runs 762 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 662 over it, 7.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.
  • MethodTooLong: Kernel.with_resources_and_workspace_layout_with_profile_cache_and_directory crates/astrid-kernel/src/lib.rs:1059 — MethodTooLong — with_resources_and_workspace_layout_with_profile_cache_and_directory runs 325 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 225 over it, 3.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.
  • MethodTooLong: KernelProcessStorageMountBroker.mount crates/astrid-kernel/src/storage_mount/process_broker/mod.rs:72 — MethodTooLong — mount runs 256 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 156 over it, 2.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: WasmEngine.invoke_interceptor crates/astrid-capsule/src/engine/wasm/mod.rs:3165 — MethodTooLong — invoke_interceptor runs 242 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 142 over it, 2.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: HostState.spawn_persistent crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:664 — MethodTooLong — spawn_persistent runs 197 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 97 over it, 1.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.
  • MethodTooLong: HostState.spawn_background crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:391 — MethodTooLong — spawn_background runs 175 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 75 over it, 1.75× 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: DurableEngine.compact_volume_locked crates/astrid-storage/src/engine/durable/compaction/volume.rs:23 — MethodTooLong — compact_volume_locked runs 161 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 61 over it, 1.61× 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: HostState.request_approval crates/astrid-capsule/src/engine/wasm/host/approval.rs:358 — MethodTooLong — request_approval runs 156 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 56 over it, 1.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: HostState.spawn crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:184 — MethodTooLong — spawn runs 149 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 49 over it, 1.49× 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: HostState.bind_tcp crates/astrid-capsule/src/engine/wasm/host/net/mod.rs:481 — MethodTooLong — bind_tcp runs 140 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 40 over it, 1.40× 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: WorkspaceBranchStore.rename_batch_inner crates/astrid-storage/src/content/store/workspace/operations.rs:642 — MethodTooLong — rename_batch_inner runs 127 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 27 over it, 1.27× 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: AllowancePattern.matches crates/astrid-approval/src/allowance/pattern.rs:119 — MethodTooLong — matches 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: HostState.for_hook crates/astrid-capsule/src/engine/wasm/host_state_hook.rs:31 — MethodTooLong — for_hook 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: Admitter.reserve crates/astrid-capsule/src/dispatcher/admission.rs:139 — MethodTooLong — reserve runs 103 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 3 over it, 1.03× 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.
D2 · Cognitive Complexity · astrid_cli_mockup · ×13
  • astrid_cli_mockup::ui::input::handle_idle_input (cognitive 55) crates/astrid-cli-mockup/src/ui/input.rs:37 — astrid_cli_mockup::ui::input::handle_idle_input has cognitive complexity 55 (threshold 15). Drivers by points: if/else 18 (37 pts), boolean chains 10, match/switch 4 (8 pts) (nesting depth added 23). 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.
  • astrid_cli_mockup::ui::views::nexus::render_nexus_entry (cognitive 55) crates/astrid-cli-mockup/src/ui/views/nexus.rs:244 — astrid_cli_mockup::ui::views::nexus::render_nexus_entry has cognitive complexity 55 (threshold 15). Drivers by points: if/else 11 (25 pts), match/switch 8 (18 pts), loops 3 (12 pts) (nesting depth added 33). 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.
  • astrid_cli_mockup::ui::views::log::render_log (cognitive 45) crates/astrid-cli-mockup/src/ui/views/log.rs:15 — astrid_cli_mockup::ui::views::log::render_log has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 4 (13 pts), match/switch 2 (7 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • astrid_cli_mockup::ui::views::stellar::render_stellar (cognitive 35) crates/astrid-cli-mockup/src/ui/views/stellar.rs:13 — astrid_cli_mockup::ui::views::stellar::render_stellar has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (2 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.
  • astrid_cli_mockup::ui::views::topology::render_topology (cognitive 28) crates/astrid-cli-mockup/src/ui/views/topology.rs:15 — astrid_cli_mockup::ui::views::topology::render_topology has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (11 pts), match/switch 2 (4 pts), 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.
  • astrid_cli_mockup::ui::render::parse_inline_markdown (cognitive 26) crates/astrid-cli-mockup/src/ui/render.rs:83 — astrid_cli_mockup::ui::render::parse_inline_markdown has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (7 pts), match/switch 1 (2 pts), boolean chains 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.
  • astrid_cli_mockup::ui::render::render_sidebar (cognitive 25) crates/astrid-cli-mockup/src/ui/render.rs:370 — astrid_cli_mockup::ui::render::render_sidebar has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 2, 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.
  • astrid_cli_mockup::ui::views::shield::render_queue (cognitive 22) crates/astrid-cli-mockup/src/ui/views/shield.rs:77 — astrid_cli_mockup::ui::views::shield::render_queue has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 4 (7 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • astrid_cli_mockup::ui::views::command::render_table (cognitive 21) crates/astrid-cli-mockup/src/ui/views/command.rs:94 — astrid_cli_mockup::ui::views::command::render_table has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 3 (4 pts), 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.
  • astrid_cli_mockup::ui::render::render_activity (cognitive 20) crates/astrid-cli-mockup/src/ui/render.rs:447 — astrid_cli_mockup::ui::render::render_activity has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • astrid_cli_mockup::ui::render::render_inline_tool (cognitive 19) crates/astrid-cli-mockup/src/ui/render.rs:140 — astrid_cli_mockup::ui::render::render_inline_tool has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (4 pts), match/switch 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.
  • astrid_cli_mockup::ui::render::render_status (cognitive 16) crates/astrid-cli-mockup/src/ui/render.rs:682 — astrid_cli_mockup::ui::render::render_status has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 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.
  • astrid_cli_mockup::ui::views::chain::render_chain_entries (cognitive 16) crates/astrid-cli-mockup/src/ui/views/chain.rs:133 — astrid_cli_mockup::ui::views::chain::render_chain_entries has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, match/switch 1 (2 pts), loops 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.
D1 · Cyclomatic Complexity · astrid · ×12
  • astrid::tui::input::handle_idle_input (cyclomatic 40) crates/astrid-cli/src/tui/input.rs:548 — astrid::tui::input::handle_idle_input 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.
  • astrid::commands::distro::validate::validate_manifest (cyclomatic 39) crates/astrid-cli/src/commands/distro/validate.rs:77 — astrid::commands::distro::validate::validate_manifest has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • astrid::tui::handle_daemon_event (cyclomatic 39) crates/astrid-cli/src/tui/mod.rs:217 — astrid::tui::handle_daemon_event has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • astrid::tui::render::render_input (cyclomatic 39) crates/astrid-cli/src/tui/render.rs:897 — astrid::tui::render::render_input has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • astrid::tui::render::render_nexus (cyclomatic 31) crates/astrid-cli/src/tui/render.rs:514 — astrid::tui::render::render_nexus has cyclomatic complexity 31 (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.
  • astrid::tui::handle_pending_actions (cyclomatic 22) crates/astrid-cli/src/tui/mod.rs:497 — astrid::tui::handle_pending_actions 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.
  • astrid::tui::render::render_onboarding_menu (cyclomatic 20) crates/astrid-cli/src/tui/render.rs:1261 — astrid::tui::render::render_onboarding_menu 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.
  • astrid::tui::render::render_activity (cyclomatic 18) crates/astrid-cli/src/tui/render.rs:702 — astrid::tui::render::render_activity 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.
  • astrid::tui::input::handle_onboarding_enum_input (cyclomatic 17) crates/astrid-cli/src/tui/input.rs:453 — astrid::tui::input::handle_onboarding_enum_input 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.
  • astrid::commands::mcp::lifecycle::wait_for_gateway (cyclomatic 16) crates/astrid-cli/src/commands/mcp/lifecycle.rs:400 — astrid::commands::mcp::lifecycle::wait_for_gateway 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.
  • astrid::commands::setup::run_report (cyclomatic 16) crates/astrid-cli/src/commands/setup.rs:57 — astrid::commands::setup::run_report 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.
  • astrid::tui::input::handle_onboarding_text_input (cyclomatic 16) crates/astrid-cli/src/tui/input.rs:361 — astrid::tui::input::handle_onboarding_text_input 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.
D3 · God Classes · TooManyMethods · ×12
  • TooManyMethods: DurableEngine crates/astrid-storage/src/engine/durable/mod.rs:662 — TooManyMethods — 114 methods, declared across 15 files: durable/engine.rs (27), compaction/mod.rs (17), group/mod.rs (11), durable/opening.rs (10), +11 more file(s). The bar is 30 methods; this is 84 over it, 3.80× 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. This type is on a published API surface — a cargo-semver-checks gate in CI (.github/workflows/ci.yml) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
  • TooManyMethods: AuditLog crates/astrid-audit/src/log.rs:151 — TooManyMethods — 86 methods, declared across 10 files: src/log.rs (32), log/v2.rs (14), log/retention_guard.rs (10), log/heads_export.rs (7), +6 more file(s). The bar is 30 methods; this is 56 over it, 2.87× 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. This type is on a published API surface — a cargo-semver-checks gate in CI (.github/workflows/ci.yml) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
  • TooManyMethods: KvAuditStorage crates/astrid-audit/src/storage.rs:320 — TooManyMethods — 80 methods, declared across 18 files: storage/append.rs (16), src/storage.rs (12), storage/prune_chain.rs (9), storage/append_batch.rs (8), +14 more file(s). The bar is 30 methods; this is 50 over it, 2.67× 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: Kernel crates/astrid-kernel/src/lib.rs:213 — TooManyMethods — 76 methods, declared across 4 files: src/lib.rs (65), src/capsule_materialization.rs (6), src/capsule_removal.rs (3), src/native_input.rs (2). The bar is 30 methods; this is 46 over it, 2.53× 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. This type is on a published API surface — a cargo-semver-checks gate in CI (.github/workflows/ci.yml) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
  • TooManyMethods: PrincipalContentStore crates/astrid-storage/src/content/store.rs:66 — TooManyMethods — 65 methods, declared across 7 files: content/store.rs (27), store/bulk.rs (14), store/internals.rs (14), store/constructors.rs (4), +3 more file(s). The bar is 30 methods; this is 35 over it, 2.17× 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. This type is on a published API surface — a cargo-semver-checks gate in CI (.github/workflows/ci.yml) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
  • TooManyMethods: CapsuleRegistry crates/astrid-capsule/src/registry.rs:113 — TooManyMethods — 62 methods, declared across 4 files: src/registry.rs (47), registry/replacement.rs (7), registry/uplinks.rs (7), registry/compatibility.rs (1). The bar is 30 methods; this is 32 over it, 2.07× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. This type is on a published API surface — a cargo-semver-checks gate in CI (.github/workflows/ci.yml) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
  • TooManyMethods: HostState crates/astrid-capsule/src/engine/wasm/host_state.rs:252 — TooManyMethods — 57 methods, declared across 14 files: wasm/host_state_effective.rs (16), wasm/host_state.rs (8), wasm/host_state_invocation.rs (7), http/backend.rs (6), +10 more file(s). The bar is 30 methods; this is 27 over it, 1.90× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. This type is on a published API surface — a cargo-semver-checks gate in CI (.github/workflows/ci.yml) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
  • TooManyMethods: AstridHome crates/astrid-core/src/dirs.rs:250 — TooManyMethods — 54 methods, declared across 2 files: src/dirs.rs (39), src/dirs_layout.rs (15). The bar is 30 methods; this is 24 over it, 1.80× 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. This type is on a published API surface — a cargo-semver-checks gate in CI (.github/workflows/ci.yml) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
  • TooManyMethods: OwnershipStore crates/astrid-storage/src/ownership.rs:264 — TooManyMethods — 40 methods, declared across 8 files: src/ownership.rs (14), ownership/deletion.rs (11), ownership/provision.rs (3), ownership/upgrade.rs (3), +4 more file(s). The bar is 30 methods; this is 10 over it, 1.33× 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. This type is on a published API surface — a cargo-semver-checks gate in CI (.github/workflows/ci.yml) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
  • TooManyMethods: WorkspaceBranchStore crates/astrid-storage/src/content/store/workspace/model.rs:237 — TooManyMethods — 39 methods, declared across 4 files: workspace/operations.rs (25), workspace/lifecycle.rs (10), workspace/model.rs (2), workspace/rename_guards.rs (2). The bar is 30 methods; this is 9 over it, 1.30× 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. This type is on a published API surface — a cargo-semver-checks gate in CI (.github/workflows/ci.yml) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
  • TooManyMethods: ServerManager crates/astrid-mcp/src/server.rs:79 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. This type is on a published API surface — a cargo-semver-checks gate in CI (.github/workflows/ci.yml) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
  • TooManyMethods: RuntimePrincipalStore crates/astrid-storage/src/principal_state.rs:454 — TooManyMethods — 31 methods, declared across 3 files: src/principal_state.rs (25), principal_state/bootstrap.rs (4), principal_state/contiguous_ingest.rs (2). The bar is 30 methods; this is 1 over it, 1.03× 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. This type is on a published API surface — a cargo-semver-checks gate in CI (.github/workflows/ci.yml) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
D2 · Cognitive Complexity · astrid_capsule · ×11
  • astrid_capsule::engine::wasm::wasm_exports_contain (cognitive 39) crates/astrid-capsule/src/engine/wasm/mod.rs:4328 — astrid_capsule::engine::wasm::wasm_exports_contain has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 3 (7 pts), match/switch 3 (7 pts), boolean chains 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.
  • astrid_capsule::dispatcher::collect_matching_interceptors (cognitive 36) crates/astrid-capsule/src/dispatcher.rs:717 — astrid_capsule::dispatcher::collect_matching_interceptors has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 11, 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.
  • astrid_capsule::toposort::toposort_manifests (cognitive 25) crates/astrid-capsule/src/toposort.rs:67 — astrid_capsule::toposort::toposort_manifests has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 5 (9 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • astrid_capsule::discovery::load_manifest (cognitive 19) crates/astrid-capsule/src/discovery.rs:257 — astrid_capsule::discovery::load_manifest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 5, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • astrid_capsule::engine::wasm::host::fs::resolve::resolve_path (cognitive 19) crates/astrid-capsule/src/engine/wasm/host/fs/resolve.rs:135 — astrid_capsule::engine::wasm::host::fs::resolve::resolve_path has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (18 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.
  • astrid_capsule::engine::wasm::host::process::inject::prepare_injections (cognitive 19) crates/astrid-capsule/src/engine/wasm/host/process/inject.rs:223 — astrid_capsule::engine::wasm::host::process::inject::prepare_injections has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (4 pts), loops 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.
  • astrid_capsule::dispatcher::consumer::run_consumer (cognitive 18) crates/astrid-capsule/src/dispatcher/consumer.rs:8 — astrid_capsule::dispatcher::consumer::run_consumer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (11 pts), match/switch 2 (5 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.
  • astrid_capsule::engine::wasm::host::ipc::publish_inner (cognitive 18) crates/astrid-capsule/src/engine/wasm/host/ipc.rs:228 — astrid_capsule::engine::wasm::host::ipc::publish_inner has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2, match/switch 2 (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.
  • astrid_capsule::discovery::discover_manifests_in_workspace (cognitive 17) crates/astrid-capsule/src/discovery.rs:120 — astrid_capsule::discovery::discover_manifests_in_workspace has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • astrid_capsule::watcher::collect_source_paths (cognitive 17) crates/astrid-capsule/src/watcher.rs:397 — astrid_capsule::watcher::collect_source_paths has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 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.
  • astrid_capsule::engine::wasm::host::fs::resolve::resolve_physical_absolute (cognitive 16) crates/astrid-capsule/src/engine/wasm/host/fs/resolve.rs:49 — astrid_capsule::engine::wasm::host::fs::resolve::resolve_physical_absolute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 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.
D3 · God Classes · ClassTooLong · ×11
  • ClassTooLong: Kernel crates/astrid-kernel/src/lib.rs:213 — ClassTooLong — 1976 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 76 methods, 2 blocks, lines 213-3670. The bar is 400 significant lines; this is 1576 over it, 4.94× 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: WasmEngine crates/astrid-capsule/src/engine/wasm/mod.rs:195 — ClassTooLong — 1201 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 6 methods, 3 blocks, lines 195-3666. The bar is 400 significant lines; this is 801 over it, 3.00× 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: RepresentationStore crates/astrid-storage/src/engine/durable/representations/mod.rs:97 — ClassTooLong — 593 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 30 methods, 2 blocks, lines 97-842. The bar is 400 significant lines; this is 193 over it, 1.48× 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: PrincipalContentStore crates/astrid-storage/src/content/store.rs:66 — ClassTooLong — 565 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 65 methods, 2 blocks, lines 66-956. The bar is 400 significant lines; this is 165 over it, 1.41× 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: CapsuleRegistry crates/astrid-capsule/src/registry.rs:113 — ClassTooLong — 512 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, 4 blocks, lines 113-958. The bar is 400 significant lines; this is 112 over it, 1.28× 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: ServerManager crates/astrid-mcp/src/server.rs:79 — ClassTooLong — 473 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, 3 blocks, lines 79-1023. The bar is 400 significant lines; this is 73 over it, 1.18× 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: KvAuditStorage crates/astrid-audit/src/storage.rs:320 — ClassTooLong — 443 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 80 methods, 4 blocks, lines 320-926. The bar is 400 significant lines; this is 43 over it, 1.11× 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: TreeContext crates/astrid-storage/src/kv/tree/context.rs:25 — ClassTooLong — 424 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 25 methods, 2 blocks, lines 25-589. The bar is 400 significant lines; this is 24 over it, 1.06× 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: CapabilityStore crates/astrid-capabilities/src/store.rs:58 — ClassTooLong — 417 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 23 methods, 4 blocks, lines 58-876. The bar is 400 significant lines; this is 17 over it, 1.04× 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: WalWriter crates/astrid-storage/src/engine/durable/wal/writer.rs:76 — ClassTooLong — 417 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, 2 blocks, lines 76-640. The bar is 400 significant lines; this is 17 over it, 1.04× 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: AstridFuseFilesystem crates/astrid-storage-provider-fuse/src/filesystem.rs:71 — ClassTooLong — 407 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 12 methods, 3 blocks, lines 71-624. The bar is 400 significant lines; this is 7 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.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×11
  • Duplicated block (15 lines × 2) crates/astrid-cli/src/commands/capsule/install_headless.rs:106 — crates/astrid-cli/src/commands/capsule/install_headless.rs:106-120 | crates/astrid-cli/src/commands/capsule/install_prompts.rs:100-114 — before extracting anything, compare `crates/astrid-cli/src/commands/capsule/install_headless.rs` and `crates/astrid-cli/src/commands/capsule/install_prompts.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 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/astrid-cli/src/commands/capsule/install_headless.rs:282 — crates/astrid-cli/src/commands/capsule/install_headless.rs:282-296 | crates/astrid-cli/src/commands/capsule/install_prompts.rs:466-480 — before extracting anything, compare `crates/astrid-cli/src/commands/capsule/install_headless.rs` and `crates/astrid-cli/src/commands/capsule/install_prompts.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 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/astrid-core/src/dirs_layout_records.rs:302 — crates/astrid-core/src/dirs_layout_records.rs:302-316 | crates/astrid-core/src/dirs_layout_records.rs:397-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.
  • Duplicated block (15 lines × 2) crates/astrid-core/src/local_transport/windows/acl.rs:106 — crates/astrid-core/src/local_transport/windows/acl.rs:106-120 | crates/astrid-core/src/platform_fs/windows/acl/ace.rs:77-91 — before extracting anything, compare `crates/astrid-core/src/local_transport/windows/acl.rs` and `crates/astrid-core/src/platform_fs/windows/acl/ace.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 108 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 (15 lines × 2) crates/astrid-core/src/platform_fs/windows/executable.rs:276 — crates/astrid-core/src/platform_fs/windows/executable.rs:276-290 | crates/astrid-core/src/platform_fs/windows/private_file.rs:210-224 — before extracting anything, compare `crates/astrid-core/src/platform_fs/windows/executable.rs` and `crates/astrid-core/src/platform_fs/windows/private_file.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 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/astrid-events/src/bus.rs:536 — crates/astrid-events/src/bus.rs:536-550 | crates/astrid-events/src/bus.rs:670-684 — 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/astrid-kernel/src/capsule_materialization.rs:81 — crates/astrid-kernel/src/capsule_materialization.rs:81-95 | crates/astrid-kernel/src/lib.rs:616-630 — 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/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:737 — crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:737-751 | crates/astrid-kernel/src/legacy_migration_barrier/legacy_permissions.rs:97-111 — 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/astrid-storage/src/engine/durable/format/indexed.rs:55 — crates/astrid-storage/src/engine/durable/format/indexed.rs:55-69 | crates/astrid-storage/src/engine/durable/format/indexed.rs:262-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 (15 lines × 2) crates/astrid-storage/src/engine/durable/format/indexed.rs:218 — crates/astrid-storage/src/engine/durable/format/indexed.rs:218-232 | crates/astrid-storage/src/engine/durable/format/mod.rs:78-92 — 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/astrid-capsule/src/engine/wasm/host/process/mod.rs:567 — crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:567-581 | crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:614-630 — 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.
D17 · Explicit Debt · TodoComment · ×10
  • TodoComment crates/astrid-vfs/src/workspace_cow/overlayfs.rs:32 — //! TODO: `unshare(CLONE_NEWUSER | CLONE_NEWNS)` + uid/gid-map setup before the — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/astrid-kernel/src/lib.rs:848 — // TODO: clear ephemeral keys (e: prefix) on boot when the key — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/astrid-hooks/src/handler/agent.rs:4 — //! TODO: implement real agent handler when the LLM integration is more mature. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/astrid-hooks/src/handler/agent.rs:16 — /// TODO: implement real agent handler. For now, it returns a stub response. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/astrid-gateway/src/routes/capsules.rs:498 — /// interceptor events; topic enumeration through IPC is a TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/astrid-cli/src/tui/mod.rs:439 — // TODO: extract text from MultiPart content once TUI — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/astrid-capsule/src/engine/wasm/host/http/backend.rs:878 — // TODO(http): map TLS handshake / certificate failures to the contract's — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/astrid-capsule/src/engine/wasm/host/http/mod.rs:306 — // TODO(http@1.1.0): streaming request body — follow-up. The streaming — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/astrid-capsule/src/engine/wasm/host/http/mod.rs:349 — // TODO(http@1.1.0): surface HTTP trailers — follow-up. reqwest does not — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/astrid-capsule/src/engine/wasm/host/http/mod.rs:363 — // TODO(http@1.1.0): streaming request body — follow-up. `http_upload_start` — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D5 · Coupling · Off the main sequence · ×10
  • Off the main sequence: astrid-core — astrid-core: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 24 project(s), so it's rigid to change.
  • Off the main sequence: astrid-crypto — astrid-crypto: 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: astrid-runtime — astrid-runtime: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
  • Off the main sequence: astrid-types — astrid-types: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
  • Off the main sequence: astrid-config — astrid-config: abstractness 0.00, instability 0.13, distance 0.88 — zone of pain — concrete and depended on by 7 project(s), so it's rigid to change.
  • Off the main sequence: astrid-workspace — astrid-workspace: abstractness 0.00, instability 0.17, distance 0.83 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
  • Off the main sequence: astrid-capsule-types — astrid-capsule-types: abstractness 0.00, instability 0.20, distance 0.80 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
  • Off the main sequence: astrid-storage — astrid-storage: abstractness 0.07, instability 0.14, distance 0.79 — zone of pain — concrete and depended on by 12 project(s), so it's rigid to change.
  • Off the main sequence: astrid-telemetry — astrid-telemetry: abstractness 0.00, instability 0.25, distance 0.75 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
  • Off the main sequence: astrid-capabilities — astrid-capabilities: abstractness 0.00, instability 0.27, distance 0.73 — zone of pain — concrete and depended on by 8 project(s), so it's rigid to change.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×9
  • Duplicated block (9 lines × 3) crates/astrid-capsule-install/src/authority/leftover.rs:292 — crates/astrid-capsule-install/src/authority/leftover.rs:292-300 | crates/astrid-kernel/src/principal_home_migration/unbound.rs:290-298 | crates/astrid-storage/src/principal_state/unbound_legacy.rs:288-296 — before extracting anything, compare `crates/astrid-capsule-install/src/authority/leftover.rs` and `crates/astrid-storage/src/principal_state/unbound_legacy.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 3) crates/astrid-cli-mockup/src/ui/views/chain.rs:104 — crates/astrid-cli-mockup/src/ui/views/chain.rs:104-112 | crates/astrid-cli-mockup/src/ui/views/command.rs:79-87 | crates/astrid-cli-mockup/src/ui/views/nexus.rs:139-147 — 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 (9 lines × 3) crates/astrid-cli-mockup/src/ui/views/log.rs:31 — crates/astrid-cli-mockup/src/ui/views/log.rs:31-39 | crates/astrid-cli-mockup/src/ui/views/nexus.rs:268-276 | crates/astrid-cli/src/tui/render.rs:540-548 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/views/log.rs` and `crates/astrid-cli-mockup/src/ui/views/nexus.rs` as WHOLE FILES: this scan already matched 3 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 × 3) crates/astrid-cli/src/commands/keypair/mod.rs:562 — crates/astrid-cli/src/commands/keypair/mod.rs:562-570 | crates/astrid-core/src/groups/io_impl.rs:94-102 | crates/astrid-core/src/profile/io_impl.rs:146-154 — `crates/astrid-core/src/groups/io_impl.rs` and `crates/astrid-core/src/profile/io_impl.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 4 separate duplicated blocks between them, totalling at least 58 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 (9 lines × 3) crates/astrid-cli/src/tui/mod.rs:650 — crates/astrid-cli/src/tui/mod.rs:650-658 | crates/astrid-cli/src/tui/mod.rs:742-750 | crates/astrid-cli/src/tui/mod.rs:773-781 — 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/astrid-storage/src/storage_model/physical/placement.rs:286 — crates/astrid-storage/src/storage_model/physical/placement.rs:286-294 | crates/astrid-storage/src/storage_model/physical/profile.rs:490-498 | crates/astrid-storage/src/storage_model/physical/representation.rs:408-416 — 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 (9 lines × 3) crates/astrid-storage-provider-fskit/src/main.rs:301 — crates/astrid-storage-provider-fskit/src/main.rs:301-309 | crates/astrid-storage-provider-fuse/src/main.rs:902-910 | crates/astrid-storage-provider-winfsp/src/main.rs:311-319 — before extracting anything, compare `crates/astrid-storage-provider-fskit/src/main.rs` and `crates/astrid-storage-provider-winfsp/src/main.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 133 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 × 3) crates/astrid-core/src/dirs_layout.rs:426 — crates/astrid-core/src/dirs_layout.rs:426-434 | crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:360-368 | crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:423-431 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (9 lines × 3) crates/astrid-kernel/src/lib.rs:4096 — crates/astrid-kernel/src/lib.rs:4096-4104 | crates/astrid-kernel/src/lib.rs:4137-4145 | crates/astrid-kernel/src/lib.rs:4239-4247 — 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.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×9
  • Duplicated block (8 lines × 3) crates/astrid-capsule-install/src/authority/leftover.rs:271 — crates/astrid-capsule-install/src/authority/leftover.rs:271-278 | crates/astrid-kernel/src/principal_home_migration/unbound.rs:271-278 | crates/astrid-storage/src/principal_state/unbound_legacy.rs:264-271 — before extracting anything, compare `crates/astrid-capsule-install/src/authority/leftover.rs` and `crates/astrid-storage/src/principal_state/unbound_legacy.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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/astrid-cli-mockup/src/ui/views/pulse.rs:60 — crates/astrid-cli-mockup/src/ui/views/pulse.rs:60-67 | crates/astrid-cli-mockup/src/ui/views/pulse.rs:120-127 | crates/astrid-cli-mockup/src/ui/views/pulse.rs:183-190 — 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/astrid-cli/src/commands/capsule/local_egress.rs:203 — crates/astrid-cli/src/commands/capsule/local_egress.rs:203-210 | crates/astrid-core/src/groups/io_impl.rs:95-102 | crates/astrid-core/src/profile/io_impl.rs:147-154 — `crates/astrid-core/src/groups/io_impl.rs` and `crates/astrid-core/src/profile/io_impl.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 4 separate duplicated blocks between them, totalling at least 58 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 × 3) crates/astrid-kernel/src/storage_mount/process_broker/process_identity.rs:12 — crates/astrid-kernel/src/storage_mount/process_broker/process_identity.rs:12-19 | crates/astrid-storage-provider-fskit/src/service.rs:438-445 | crates/astrid-storage-provider-fuse/src/service.rs:379-386 — before extracting anything, compare `crates/astrid-storage-provider-fskit/src/service.rs` and `crates/astrid-storage-provider-fuse/src/service.rs` as WHOLE FILES: this scan already matched 8 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 lines × 3) crates/astrid-storage-provider-fskit/src/service.rs:88 — crates/astrid-storage-provider-fskit/src/service.rs:88-95 | crates/astrid-storage-provider-fuse/src/service.rs:72-79 | crates/astrid-storage-provider-winfsp/src/win.rs:217-224 — before extracting anything, compare `crates/astrid-storage-provider-fskit/src/service.rs` and `crates/astrid-storage-provider-fuse/src/service.rs` as WHOLE FILES: this scan already matched 8 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 lines × 3) crates/astrid-storage/src/content/store.rs:540 — crates/astrid-storage/src/content/store.rs:540-547 | crates/astrid-storage/src/content/store.rs:633-640 | crates/astrid-storage/src/content/store.rs:652-659 — 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/astrid-core/src/dirs_layout_retirement.rs:43 — crates/astrid-core/src/dirs_layout_retirement.rs:43-50 | crates/astrid-core/src/dirs_layout_retirement.rs:274-281 | crates/astrid-core/src/runtime_scratch.rs:56-67 — before extracting anything, compare `crates/astrid-core/src/dirs_layout_retirement.rs` and `crates/astrid-core/src/runtime_scratch.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 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/astrid-cli/src/repl.rs:233 — crates/astrid-cli/src/repl.rs:233-241 | crates/astrid-core/src/dirs_layout.rs:346-353 | crates/astrid-kernel/src/principal_home_migration/unbound.rs:157-165 — 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) scripts/channel_metadata.py:319 — scripts/channel_metadata.py:319-326 | scripts/musl_release_manifest.py:289-296 | scripts/windows_release_manifest.py:267-274 — before extracting anything, compare `scripts/musl_release_manifest.py` and `scripts/windows_release_manifest.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D6 · Cohesion (LCOM4) · Low cohesion · ×9
  • Low cohesion: HostState (LCOM4 16) crates/astrid-capsule/src/engine/wasm/host_state.rs:252 — HostState's methods fall into 16 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 16 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ServerConfig (LCOM4 10) crates/astrid-mcp/src/config.rs:59 — ServerConfig's methods fall into 10 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 10 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ConsentDisplay (LCOM4 7) crates/astrid-cli/src/commands/mcp/consent_display.rs:69 — ConsentDisplay's methods fall into 7 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 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: LogConfig (LCOM4 6) crates/astrid-telemetry/src/logging.rs:97 — LogConfig's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: HooksConfig (LCOM4 5) crates/astrid-hooks/src/config.rs:9 — HooksConfig's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: CapabilitiesDef (LCOM4 4) crates/astrid-capsule-types/src/manifest/capabilities.rs:10 — CapabilitiesDef's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: GatewayState (LCOM4 4) crates/astrid-cli/src/commands/mcp/gateway.rs:72 — GatewayState's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: LocalStream (LCOM4 4) crates/astrid-core/src/local_transport/windows.rs:66 — LocalStream's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: LocalStream (LCOM4 4) crates/astrid-core/src/local_transport.rs:45 — LocalStream's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
D1 · Cyclomatic Complexity · astrid_cli_mockup · ×8
  • astrid_cli_mockup::ui::input::handle_idle_input (cyclomatic 59) crates/astrid-cli-mockup/src/ui/input.rs:37 — astrid_cli_mockup::ui::input::handle_idle_input has cyclomatic complexity 59 (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.
  • astrid_cli_mockup::ui::views::nexus::render_nexus_entry (cyclomatic 39) crates/astrid-cli-mockup/src/ui/views/nexus.rs:244 — astrid_cli_mockup::ui::views::nexus::render_nexus_entry has cyclomatic complexity 39 (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.
  • astrid_cli_mockup::ui::render::render_frame (cyclomatic 18) crates/astrid-cli-mockup/src/ui/render.rs:264 — astrid_cli_mockup::ui::render::render_frame 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.
  • astrid_cli_mockup::ui::views::command::render_table (cyclomatic 18) crates/astrid-cli-mockup/src/ui/views/command.rs:94 — astrid_cli_mockup::ui::views::command::render_table 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.
  • astrid_cli_mockup::ui::views::log::render_log (cyclomatic 18) crates/astrid-cli-mockup/src/ui/views/log.rs:15 — astrid_cli_mockup::ui::views::log::render_log 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.
  • astrid_cli_mockup::ui::views::stellar::render_stellar (cyclomatic 18) crates/astrid-cli-mockup/src/ui/views/stellar.rs:13 — astrid_cli_mockup::ui::views::stellar::render_stellar 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.
  • astrid_cli_mockup::ui::views::topology::render_topology (cyclomatic 18) crates/astrid-cli-mockup/src/ui/views/topology.rs:15 — astrid_cli_mockup::ui::views::topology::render_topology 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.
  • astrid_cli_mockup::ui::views::shield::render_queue (cyclomatic 16) crates/astrid-cli-mockup/src/ui/views/shield.rs:77 — astrid_cli_mockup::ui::views::shield::render_queue 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.
D1 · Cyclomatic Complexity · astrid_storage · ×7
  • astrid_storage::engine::durable::wal::replay::replay_transaction (cyclomatic 24) crates/astrid-storage/src/engine/durable/wal/replay.rs:255 — astrid_storage::engine::durable::wal::replay::replay_transaction has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • astrid_storage::volume::hosted::recover::apply_record (cyclomatic 23) crates/astrid-storage/src/volume/hosted/recover.rs:318 — astrid_storage::volume::hosted::recover::apply_record 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.
  • astrid_storage::content::store::workspace::codec::decode_workspace_record (cyclomatic 22) crates/astrid-storage/src/content/store/workspace/codec.rs:133 — astrid_storage::content::store::workspace::codec::decode_workspace_record has cyclomatic complexity 22 (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.
  • astrid_storage::principal_state::staging::legacy::inspect_migration_intents (cyclomatic 18) crates/astrid-storage/src/principal_state/staging/legacy.rs:33 — astrid_storage::principal_state::staging::legacy::inspect_migration_intents 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.
  • astrid_storage::storage_model::physical::representation::validate_recipe (cyclomatic 17) crates/astrid-storage/src/storage_model/physical/representation.rs:509 — astrid_storage::storage_model::physical::representation::validate_recipe 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.
  • astrid_storage::principal_state::runtime_tree::reconcile_running_projection (cyclomatic 16) crates/astrid-storage/src/principal_state/runtime_tree.rs:786 — astrid_storage::principal_state::runtime_tree::reconcile_running_projection 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.
  • astrid_storage::volume::hosted::recover::recover_from_headers (cyclomatic 16) crates/astrid-storage/src/volume/hosted/recover.rs:198 — astrid_storage::volume::hosted::recover::recover_from_headers 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.
D2 · Cognitive Complexity · astrid_gateway · ×7
  • astrid_gateway::routes::audit::paginate_page (cognitive 38) crates/astrid-gateway/src/routes/audit.rs:377 — astrid_gateway::routes::audit::paginate_page has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 8, match/switch 1 (2 pts), 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.
  • astrid_gateway::routes::agent::post_prompt (cognitive 33) crates/astrid-gateway/src/routes/agent.rs:205 — astrid_gateway::routes::agent::post_prompt has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (30 pts), match/switch 1 (2 pts), loops 1 (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.
  • astrid_gateway::revocations::spawn_watcher (cognitive 21) crates/astrid-gateway/src/revocations.rs:450 — astrid_gateway::revocations::spawn_watcher has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 1 (3 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.
  • astrid_gateway::routes::stream::get_stream (cognitive 18) crates/astrid-gateway/src/routes/stream.rs:115 — astrid_gateway::routes::stream::get_stream 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.
  • astrid_gateway::revocations::migrate_legacy_file (cognitive 16) crates/astrid-gateway/src/revocations.rs:356 — astrid_gateway::revocations::migrate_legacy_file has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 2, match/switch 2, 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, 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.
  • astrid_gateway::revocations::spawn_key_revocation_watcher (cognitive 16) crates/astrid-gateway/src/revocations.rs:568 — astrid_gateway::revocations::spawn_key_revocation_watcher has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), 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.
  • astrid_gateway::routes::agent::get_requests (cognitive 16) crates/astrid-gateway/src/routes/agent.rs:394 — astrid_gateway::routes::agent::get_requests has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 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.
D2 · Cognitive Complexity · HostState · ×7
  • HostState::bind_tcp (cognitive 35) crates/astrid-capsule/src/engine/wasm/host/net/mod.rs:481 — HostState::bind_tcp has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (23 pts), match/switch 6 (11 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.
  • HostState::request_approval (cognitive 30) crates/astrid-capsule/src/engine/wasm/host/approval.rs:358 — HostState::request_approval has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 3 (8 pts), boolean chains 3 (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.
  • HostState::elicit (cognitive 22) crates/astrid-capsule/src/engine/wasm/host/elicit.rs:180 — HostState::elicit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 3 (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.
  • HostState::spawn_persistent (cognitive 22) crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:664 — HostState::spawn_persistent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (17 pts), match/switch 3, boolean chains 2 (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.
  • HostState::accept (cognitive 18) crates/astrid-capsule/src/engine/wasm/host/net/unix_listener.rs:24 — HostState::accept has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 3 (6 pts), loops 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.
  • HostState::spawn (cognitive 17) crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:184 — HostState::spawn has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 5, 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, 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.
  • HostState::finalize_buffered (cognitive 16) crates/astrid-capsule/src/engine/wasm/host/http/backend.rs:494 — HostState::finalize_buffered has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 2, loops 2, match/switch 1 (2 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.
D2 · Cognitive Complexity · DurableEngine · ×7
  • DurableEngine::process_commit_batch (cognitive 27) crates/astrid-storage/src/engine/durable/group/mod.rs:365 — DurableEngine::process_commit_batch has cognitive complexity 27 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 4 (8 pts), match/switch 4 (7 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DurableEngine::prepare (cognitive 25) crates/astrid-storage/src/engine/durable/engine.rs:613 — DurableEngine::prepare has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 3, match/switch 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.
  • DurableEngine::append_wal_transactions (cognitive 25) crates/astrid-storage/src/engine/durable/group/wal.rs:161 — DurableEngine::append_wal_transactions has cognitive complexity 25 (threshold 15). Drivers by points: if/else 3 (9 pts), match/switch 2 (9 pts), loops 3 (7 pts) (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.
  • DurableEngine::shared_objects_for (cognitive 21) crates/astrid-storage/src/engine/durable/engine.rs:170 — DurableEngine::shared_objects_for has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (8 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.
  • DurableEngine::recover_locked (cognitive 18) crates/astrid-storage/src/engine/durable/recovery.rs:419 — DurableEngine::recover_locked has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 1 (2 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.
  • DurableEngine::fold_pending_wal (cognitive 17) crates/astrid-storage/src/engine/durable/lifecycle.rs:143 — DurableEngine::fold_pending_wal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DurableEngine::shared_object_for (cognitive 16) crates/astrid-storage/src/engine/durable/engine.rs:75 — DurableEngine::shared_object_for has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 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.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×7
  • Duplicated block (19 lines × 2) crates/astrid-cli-mockup/src/ui/render.rs:727 — crates/astrid-cli-mockup/src/ui/render.rs:727-745 | crates/astrid-cli/src/tui/render.rs:1514-1532 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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/astrid-core/src/dirs_layout_retirement.rs:52 — crates/astrid-core/src/dirs_layout_retirement.rs:52-70 | crates/astrid-core/src/dirs_layout_retirement.rs:105-123 — 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/astrid-core/src/platform_fs/macos_acl.rs:127 — crates/astrid-core/src/platform_fs/macos_acl.rs:127-145 | crates/astrid-core/src/platform_fs/macos_acl.rs:149-167 — 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/astrid-core/src/runtime_scratch.rs:71 — crates/astrid-core/src/runtime_scratch.rs:71-89 | crates/astrid-core/src/runtime_scratch.rs:112-130 — 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/astrid-kernel/src/invite/mod.rs:250 — crates/astrid-kernel/src/invite/mod.rs:250-268 | crates/astrid-kernel/src/pair_token/mod.rs:265-283 — `crates/astrid-kernel/src/invite/mod.rs` and `crates/astrid-kernel/src/pair_token/mod.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 17 separate duplicated blocks between them, totalling at least 162 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 (19 lines × 2) crates/astrid-storage-provider-fskit/src/main.rs:102 — crates/astrid-storage-provider-fskit/src/main.rs:102-120 | crates/astrid-storage-provider-winfsp/src/main.rs:111-129 — before extracting anything, compare `crates/astrid-storage-provider-fskit/src/main.rs` and `crates/astrid-storage-provider-winfsp/src/main.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 133 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/astrid-workspace/src/sandbox/mod.rs:507 — crates/astrid-workspace/src/sandbox/mod.rs:507-525 | crates/astrid-workspace/src/sandbox/mod.rs:581-599 — 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.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×7
  • Duplicated block (13 lines × 2) crates/astrid-kernel/src/invite/mod.rs:601 — crates/astrid-kernel/src/invite/mod.rs:601-613 | crates/astrid-kernel/src/pair_token/mod.rs:570-582 — `crates/astrid-kernel/src/invite/mod.rs` and `crates/astrid-kernel/src/pair_token/mod.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 17 separate duplicated blocks between them, totalling at least 162 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 (13 lines × 2) crates/astrid-storage-chunker-evidence/src/algorithm.rs:69 — crates/astrid-storage-chunker-evidence/src/algorithm.rs:69-81 | crates/astrid-storage-chunker-evidence/src/algorithm.rs:104-116 — 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/astrid-storage-provider-fskit/src/main.rs:312 — crates/astrid-storage-provider-fskit/src/main.rs:312-324 | crates/astrid-storage-provider-winfsp/src/main.rs:322-334 — before extracting anything, compare `crates/astrid-storage-provider-fskit/src/main.rs` and `crates/astrid-storage-provider-winfsp/src/main.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 133 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 (13 lines × 2) crates/astrid-storage/src/resources/pool.rs:173 — crates/astrid-storage/src/resources/pool.rs:173-185 | crates/astrid-storage/src/resources/pool.rs:342-354 — 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/astrid-capsule/src/engine/wasm/mod.rs:1398 — crates/astrid-capsule/src/engine/wasm/mod.rs:1398-1413 | crates/astrid-capsule/src/engine/wasm/mod.rs:1419-1431 — 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/astrid-storage/src/engine/durable/wal/writer.rs:337 — crates/astrid-storage/src/engine/durable/wal/writer.rs:337-349 | crates/astrid-storage/src/engine/durable/wal/writer.rs:432-444 — 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/astrid-kernel/src/legacy_migration_barrier/legacy_permissions.rs:86 — crates/astrid-kernel/src/legacy_migration_barrier/legacy_permissions.rs:86-98 | crates/astrid-kernel/src/legacy_migration_barrier/retirement.rs:64-76 — 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.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×6
  • Duplicated block (8–9 lines × 2) crates/astrid-capsule/src/engine/wasm/host/net/handshake.rs:141 — crates/astrid-capsule/src/engine/wasm/host/net/handshake.rs:141-149 | crates/astrid-uplink/src/native/handshake.rs:117-124 — before extracting anything, compare `crates/astrid-capsule/src/engine/wasm/host/net/handshake.rs` and `crates/astrid-uplink/src/native/handshake.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 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/astrid-storage/src/content/store.rs:670 — crates/astrid-storage/src/content/store.rs:670-678 | crates/astrid-storage/src/content/store/bulk/publish.rs:40-47 — 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–9 lines × 2) crates/astrid-storage/src/content_dag/stream.rs:151 — crates/astrid-storage/src/content_dag/stream.rs:151-158 | crates/astrid-storage/src/content_dag/stream.rs:166-174 — 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/astrid-storage/src/engine/durable/validation.rs:45 — crates/astrid-storage/src/engine/durable/validation.rs:45-53 | crates/astrid-storage/src/engine/refinery/sketch/mod.rs:488-495 — 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–9 lines × 2) scripts/musl_release_manifest.py:316 — scripts/musl_release_manifest.py:316-324 | scripts/windows_release_manifest.py:294-301 — before extracting anything, compare `scripts/musl_release_manifest.py` and `scripts/windows_release_manifest.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `scripts/musl_release_manifest.py:325` calls `blake3_file` and `scripts/windows_release_manifest.py:302` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8–9 lines × 2) scripts/validate_macos_release.py:26 — scripts/validate_macos_release.py:26-33 | scripts/validate_release_archive.py:47-55 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×6
  • Duplicated block (6 lines × 3) crates/astrid-capsule/src/engine/wasm/host/fs/mod.rs:387 — crates/astrid-capsule/src/engine/wasm/host/fs/mod.rs:387-392 | crates/astrid-capsule/src/engine/wasm/host/fs/mod.rs:510-515 | crates/astrid-capsule/src/engine/wasm/host/fs/mod.rs:535-540 — 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/astrid-storage-provider-fskit/src/main.rs:95 — crates/astrid-storage-provider-fskit/src/main.rs:95-100 | crates/astrid-storage-provider-fuse/src/main.rs:165-170 | crates/astrid-storage-provider-winfsp/src/main.rs:101-106 — before extracting anything, compare `crates/astrid-storage-provider-fskit/src/main.rs` and `crates/astrid-storage-provider-winfsp/src/main.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 133 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/astrid-storage/src/engine/durable/representations/mod.rs:785 — crates/astrid-storage/src/engine/durable/representations/mod.rs:785-790 | crates/astrid-storage/src/engine/durable/representations/recovery.rs:339-344 | crates/astrid-storage/src/engine/durable/representations/recovery.rs:353-358 — 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 (6 lines × 3) crates/astrid-storage/src/engine/durable/wal/types.rs:68 — crates/astrid-storage/src/engine/durable/wal/types.rs:68-73 | crates/astrid-storage/src/engine/durable/wal/types.rs:167-172 | crates/astrid-storage/src/storage_model/mod.rs:679-684 — 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 (6 lines × 3) crates/astrid-core/src/identity/ownership.rs:153 — crates/astrid-core/src/identity/ownership.rs:153-158 | crates/astrid-core/src/identity/ownership.rs:257-262 | crates/astrid-core/src/identity/principal.rs:152-157 — before extracting anything, compare `crates/astrid-core/src/identity/ownership.rs` and `crates/astrid-core/src/identity/principal.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 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 × 3) crates/astrid-storage-provider-fskit/src/service.rs:226 — crates/astrid-storage-provider-fskit/src/service.rs:226-231 | crates/astrid-storage-provider-fuse/src/service.rs:304-309 | crates/astrid-storage-provider-winfsp/src/win.rs:345-350 — before extracting anything, compare `crates/astrid-storage-provider-fskit/src/service.rs` and `crates/astrid-storage-provider-fuse/src/service.rs` as WHOLE FILES: this scan already matched 8 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.
D2 · Cognitive Complexity · astrid_capsule_install · ×5
  • astrid_capsule_install::local::install_from_local_path_internal (cognitive 45) crates/astrid-capsule-install/src/local.rs:547 — astrid_capsule_install::local::install_from_local_path_internal has cognitive complexity 45 (threshold 15). Drivers by points: if/else 34 (39 pts), boolean chains 6 (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.
  • astrid_capsule_install::storage::verify_package_identity (cognitive 38) crates/astrid-capsule-install/src/storage.rs:251 — astrid_capsule_install::storage::verify_package_identity has cognitive complexity 38 (threshold 15). Drivers by points: if/else 20 (30 pts), boolean chains 6, loops 1, 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.
  • astrid_capsule_install::storage::migration::migrate_native_capsules_with_report (cognitive 24) crates/astrid-capsule-install/src/storage/migration.rs:92 — astrid_capsule_install::storage::migration::migrate_native_capsules_with_report has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 3, match/switch 2 (3 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.
  • astrid_capsule_install::storage::collect_entries (cognitive 20) crates/astrid-capsule-install/src/storage.rs:781 — astrid_capsule_install::storage::collect_entries has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (18 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.
  • astrid_capsule_install::storage::materialize_capsule_package (cognitive 18) crates/astrid-capsule-install/src/storage.rs:546 — astrid_capsule_install::storage::materialize_capsule_package has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, loops 1, match/switch 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.
D2 · Cognitive Complexity · astrid_core · ×5
  • astrid_core::platform_fs::replace_executable_set_by_rename (cognitive 32) crates/astrid-core/src/platform_fs.rs:842 — astrid_core::platform_fs::replace_executable_set_by_rename has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 6 (12 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.
  • astrid_core::local_transport::windows::validate_pipe_security (cognitive 22) crates/astrid-core/src/local_transport/windows.rs:882 — astrid_core::local_transport::windows::validate_pipe_security has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 5, loops 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.
  • astrid_core::dirs_layout_records::inventory_directory (cognitive 20) crates/astrid-core/src/dirs_layout_records.rs:359 — astrid_core::dirs_layout_records::inventory_directory has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 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.
  • astrid_core::dirs_layout_retirement::delete_tree (cognitive 18) crates/astrid-core/src/dirs_layout_retirement.rs:90 — astrid_core::dirs_layout_retirement::delete_tree has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, loops 1, match/switch 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.
  • astrid_core::platform_fs::unix_directory_walk (cognitive 16) crates/astrid-core/src/platform_fs.rs:670 — astrid_core::platform_fs::unix_directory_walk has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), match/switch 2 (5 pts), loops 1 (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.
D2 · Cognitive Complexity · astrid_build · ×5
  • astrid_build::rust::getrandom_rustflags_override (cognitive 31) crates/astrid-build/src/rust.rs:445 — astrid_build::rust::getrandom_rustflags_override has cognitive complexity 31 (threshold 15). Drivers by points: if/else 19 (31 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.
  • astrid_build::archiver::discover_opaque_assets (cognitive 21) crates/astrid-build/src/archiver.rs:20 — astrid_build::archiver::discover_opaque_assets has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (6 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.
  • astrid_build::mcp::extract_mcp_servers (cognitive 19) crates/astrid-build/src/mcp.rs:176 — astrid_build::mcp::extract_mcp_servers has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (5 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.
  • astrid_build::artifact::collect_directory_records (cognitive 18) crates/astrid-build/src/artifact.rs:479 — astrid_build::artifact::collect_directory_records has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (17 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.
  • astrid_build::archiver::pack_capsule_archive (cognitive 16) crates/astrid-build/src/archiver.rs:68 — astrid_build::archiver::pack_capsule_archive has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 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.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×5
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/astrid-cli-mockup/src/ui/render.rs:140 — crates/astrid-cli-mockup/src/ui/render.rs:140-215 | crates/astrid-cli-mockup/src/ui/views/nexus.rs:22-118 | crates/astrid-cli/src/tui/render.rs:169-244 | crates/astrid-cli/src/tui/render.rs:514-697 — 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/astrid-cli-mockup/src/ui/views/pulse.rs:56 — crates/astrid-cli-mockup/src/ui/views/pulse.rs:56-114 | crates/astrid-cli-mockup/src/ui/views/pulse.rs:116-177 | crates/astrid-cli-mockup/src/ui/views/pulse.rs:179-223 | crates/astrid-cli-mockup/src/ui/views/pulse.rs:225-277 — 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/astrid-gateway/src/routes/principals.rs:140 — crates/astrid-gateway/src/routes/principals.rs:140-158 | crates/astrid-gateway/src/routes/principals.rs:218-235 | crates/astrid-gateway/src/routes/principals.rs:483-500 | crates/astrid-gateway/src/routes/principals.rs:526-552 — 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/astrid-storage/src/engine/durable/native_io.rs:131 — crates/astrid-storage/src/engine/durable/native_io.rs:131-147 | crates/astrid-storage/src/engine/durable/representations/contiguous/namespace.rs:173-189 | crates/astrid-storage/src/principal_state/native_io.rs:482-528 | crates/astrid-storage/src/principal_state/native_io.rs:637-691 — 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/astrid-telemetry/src/logging.rs:356 — crates/astrid-telemetry/src/logging.rs:356-379 | crates/astrid-telemetry/src/logging.rs:384-408 | crates/astrid-telemetry/src/logging.rs:413-437 | crates/astrid-telemetry/src/logging.rs:442-465 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×5
  • Duplicated block (17 lines × 2) crates/astrid-cli/src/commands/capsule/install_headless.rs:130 — crates/astrid-cli/src/commands/capsule/install_headless.rs:130-146 | crates/astrid-cli/src/commands/capsule/install_prompts.rs:124-140 — before extracting anything, compare `crates/astrid-cli/src/commands/capsule/install_headless.rs` and `crates/astrid-cli/src/commands/capsule/install_prompts.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 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/astrid-core/src/local_transport/windows/acl.rs:165 — crates/astrid-core/src/local_transport/windows/acl.rs:165-181 | crates/astrid-core/src/platform_fs/windows/acl/ace.rs:106-122 — before extracting anything, compare `crates/astrid-core/src/local_transport/windows/acl.rs` and `crates/astrid-core/src/platform_fs/windows/acl/ace.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 108 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/astrid-emit/src/lib.rs:480 — crates/astrid-emit/src/lib.rs:480-496 | crates/astrid-emit/src/lib.rs:504-520 — 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/astrid-kernel/src/storage_mount/process_broker/process_identity.rs:41 — crates/astrid-kernel/src/storage_mount/process_broker/process_identity.rs:41-57 | crates/astrid-storage-provider-winfsp/src/win.rs:475-491 — 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/astrid-storage-provider-fskit/src/main.rs:84 — crates/astrid-storage-provider-fskit/src/main.rs:84-100 | crates/astrid-storage-provider-winfsp/src/main.rs:90-106 — before extracting anything, compare `crates/astrid-storage-provider-fskit/src/main.rs` and `crates/astrid-storage-provider-winfsp/src/main.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 133 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.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×5
  • Duplicated block (16 lines × 2) crates/astrid-capsule-install/src/authority/leftover.rs:228 — crates/astrid-capsule-install/src/authority/leftover.rs:228-243 | crates/astrid-capsule-install/src/authority/status.rs:41-56 — 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 (16 lines × 2) crates/astrid-capsule/src/engine/wasm/host/net/tcp_stream.rs:156 — crates/astrid-capsule/src/engine/wasm/host/net/tcp_stream.rs:156-171 | crates/astrid-capsule/src/engine/wasm/host/net/tcp_stream.rs:251-266 — 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/astrid-kernel/src/invite/storage_migration.rs:81 — crates/astrid-kernel/src/invite/storage_migration.rs:81-96 | crates/astrid-kernel/src/pair_token/storage_migration.rs:97-112 — `crates/astrid-kernel/src/invite/storage_migration.rs` and `crates/astrid-kernel/src/pair_token/storage_migration.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 43 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 (16 lines × 2) crates/astrid-kernel/src/principal_home_migration/unbound.rs:290 — crates/astrid-kernel/src/principal_home_migration/unbound.rs:290-305 | crates/astrid-storage/src/principal_state/unbound_legacy.rs:288-303 — before extracting anything, compare `crates/astrid-kernel/src/principal_home_migration/unbound.rs` and `crates/astrid-storage/src/principal_state/unbound_legacy.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 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 (16 lines × 2) crates/astrid-storage/src/engine/durable/format/reader.rs:65 — crates/astrid-storage/src/engine/durable/format/reader.rs:65-80 | crates/astrid-storage/src/engine/durable/roots.rs:413-428 — before extracting anything, compare `crates/astrid-storage/src/engine/durable/format/reader.rs` and `crates/astrid-storage/src/engine/durable/roots.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 49 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.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×5
  • Duplicated block (10–11 lines × 2) crates/astrid-capsule/src/engine/wasm/host/fs/mod.rs:411 — crates/astrid-capsule/src/engine/wasm/host/fs/mod.rs:411-420 | crates/astrid-capsule/src/engine/wasm/host/fs/mod.rs:478-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 (10–11 lines × 2) crates/astrid-capsule/src/engine/wasm/host/http/backend.rs:508 — crates/astrid-capsule/src/engine/wasm/host/http/backend.rs:508-518 | crates/astrid-capsule/src/engine/wasm/host/http/backend.rs:648-657 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10–11 lines × 2) crates/astrid-cli-mockup/src/ui/render.rs:203 — crates/astrid-cli-mockup/src/ui/render.rs:203-213 | crates/astrid-cli/src/tui/render.rs:232-241 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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–11 lines × 2) crates/astrid-core/src/runtime_scratch.rs:40 — crates/astrid-core/src/runtime_scratch.rs:40-50 | crates/astrid-core/src/runtime_scratch.rs:129-138 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10–11 lines × 2) crates/astrid-storage/src/content_dag/mod.rs:390 — crates/astrid-storage/src/content_dag/mod.rs:390-400 | crates/astrid-storage/src/content_dag/read/traversal.rs:788-797 — 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.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×5
  • Duplicated block (9–10 lines × 2) crates/astrid-cli-mockup/src/ui/render.rs:522 — crates/astrid-cli-mockup/src/ui/render.rs:522-531 | crates/astrid-cli/src/tui/render.rs:774-782 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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–10 lines × 2) crates/astrid-gateway/src/routes/groups.rs:121 — crates/astrid-gateway/src/routes/groups.rs:121-129 | crates/astrid-gateway/src/routes/groups.rs:156-165 — 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 × 2) crates/astrid-kernel/src/legacy_migration_barrier/legacy_tmp.rs:48 — crates/astrid-kernel/src/legacy_migration_barrier/legacy_tmp.rs:48-57 | crates/astrid-kernel/src/principal_home_migration/mod.rs:867-875 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9–10 lines × 2) crates/astrid-storage/src/engine/durable/representations/mod.rs:196 — crates/astrid-storage/src/engine/durable/representations/mod.rs:196-204 | crates/astrid-storage/src/engine/durable/representations/volume.rs:80-89 — before extracting anything, compare `crates/astrid-storage/src/engine/durable/representations/mod.rs` and `crates/astrid-storage/src/engine/durable/representations/volume.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 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–10 lines × 2) crates/astrid-storage/src/kv/surreal.rs:266 — crates/astrid-storage/src/kv/surreal.rs:266-275 | crates/astrid-storage/src/kv/surreal.rs:299-307 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · astrid_gateway · ×4
  • astrid_gateway::routes::audit::paginate_page (cyclomatic 25) crates/astrid-gateway/src/routes/audit.rs:377 — astrid_gateway::routes::audit::paginate_page 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.
  • astrid_gateway::routes::agent::post_prompt (cyclomatic 18) crates/astrid-gateway/src/routes/agent.rs:205 — astrid_gateway::routes::agent::post_prompt 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.
  • astrid_gateway::auth::verify_bearer (cyclomatic 17) crates/astrid-gateway/src/auth.rs:160 — astrid_gateway::auth::verify_bearer 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.
  • astrid_gateway::revocations::migrate_legacy_file (cyclomatic 16) crates/astrid-gateway/src/revocations.rs:356 — astrid_gateway::revocations::migrate_legacy_file 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.
D2 · Cognitive Complexity · WorkspaceBranchStore · ×4
  • WorkspaceBranchStore::rename_batch_inner (cognitive 41) crates/astrid-storage/src/content/store/workspace/operations.rs:642 — WorkspaceBranchStore::rename_batch_inner has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 5 (9 pts), match/switch 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.
  • WorkspaceBranchStore::rename_membership_matches (cognitive 19) crates/astrid-storage/src/content/store/workspace/rename_guards.rs:36 — WorkspaceBranchStore::rename_membership_matches has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • WorkspaceBranchStore::create_branch (cognitive 17) crates/astrid-storage/src/content/store/workspace/lifecycle.rs:24 — WorkspaceBranchStore::create_branch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, 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.
  • WorkspaceBranchStore::fork_with_uid (cognitive 17) crates/astrid-storage/src/content/store/workspace/operations.rs:108 — WorkspaceBranchStore::fork_with_uid has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · PrincipalContentStore · ×4
  • PrincipalContentStore::rename_batch_replacing (cognitive 37) crates/astrid-storage/src/content/store.rs:601 — PrincipalContentStore::rename_batch_replacing has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 5 (9 pts), match/switch 4 (7 pts), boolean chains 1 (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.
  • PrincipalContentStore::publish_batch (cognitive 28) crates/astrid-storage/src/content/store/bulk/publish.rs:58 — PrincipalContentStore::publish_batch has cognitive complexity 28 (threshold 15). Drivers by points: loops 7 (17 pts), if/else 3 (7 pts), match/switch 2 (4 pts) (nesting depth added 16). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • PrincipalContentStore::migrate_legacy_catalog (cognitive 17) crates/astrid-storage/src/content/store.rs:103 — PrincipalContentStore::migrate_legacy_catalog has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PrincipalContentStore::delete_batch_if (cognitive 17) crates/astrid-storage/src/content/store.rs:519 — PrincipalContentStore::delete_batch_if has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 2 (5 pts), loops 3 (4 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.
D2 · Cognitive Complexity · astrid_uplink · ×4
  • astrid_uplink::native::serve_connection (cognitive 34) crates/astrid-uplink/src/native/mod.rs:451 — astrid_uplink::native::serve_connection has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (26 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (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.
  • astrid_uplink::native::input::handle_connection_input (cognitive 20) crates/astrid-uplink/src/native/input.rs:74 — astrid_uplink::native::input::handle_connection_input has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, 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.
  • astrid_uplink::native::process_inbound (cognitive 17) crates/astrid-uplink/src/native/mod.rs:365 — astrid_uplink::native::process_inbound has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (17 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • astrid_uplink::native::routing::reconcile_stream (cognitive 16) crates/astrid-uplink/src/native/routing.rs:133 — astrid_uplink::native::routing::reconcile_stream has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 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.
D2 · Cognitive Complexity · Kernel · ×4
  • Kernel::durable_principal_capsule_paths (cognitive 30) crates/astrid-kernel/src/lib.rs:2634 — Kernel::durable_principal_capsule_paths has cognitive complexity 30 (threshold 15). Drivers by points: match/switch 4 (15 pts), if/else 3 (11 pts), loops 1 (4 pts) (nesting depth added 22). 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.
  • Kernel::shutdown (cognitive 27) crates/astrid-kernel/src/lib.rs:3461 — Kernel::shutdown has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 3 (4 pts), boolean chains 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.
  • Kernel::unload_one_capsule_with_view_guard (cognitive 18) crates/astrid-kernel/src/capsule_removal.rs:31 — Kernel::unload_one_capsule_with_view_guard has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Kernel::load_capsule (cognitive 16) crates/astrid-kernel/src/lib.rs:1808 — Kernel::load_capsule has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 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.
D2 · Cognitive Complexity · astrid_config · ×4
  • astrid_config::merge::servers::sanitize_workspace_servers (cognitive 27) crates/astrid-config/src/merge/servers.rs:11 — astrid_config::merge::servers::sanitize_workspace_servers has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 2 (4 pts) (nesting depth added 17). 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.
  • astrid_config::env::resolve_string_refs (cognitive 22) crates/astrid-config/src/env.rs:174 — astrid_config::env::resolve_string_refs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts), boolean chains 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.
  • astrid_config::merge::deep::deep_merge_tracking (cognitive 16) crates/astrid-config/src/merge/deep.rs:27 — astrid_config::merge::deep::deep_merge_tracking has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 1 (2 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.
  • astrid_config::validate::validate_mcp_http (cognitive 16) crates/astrid-config/src/validate.rs:406 — astrid_config::validate::validate_mcp_http has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, loops 2 (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.
D2 · Cognitive Complexity · astrid_audit · ×4
  • astrid_audit::storage::append::advance_chain (cognitive 19) crates/astrid-audit/src/storage/append.rs:504 — astrid_audit::storage::append::advance_chain has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 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.
  • astrid_audit::storage::append_batch::next_chain_metadata (cognitive 17) crates/astrid-audit/src/storage/append_batch.rs:389 — astrid_audit::storage::append_batch::next_chain_metadata has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 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.
  • astrid_audit::log::archive::archive_pruned (cognitive 16) crates/astrid-audit/src/log/archive.rs:62 — astrid_audit::log::archive::archive_pruned has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 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.
  • astrid_audit::storage::blind_move::copy_namespace (cognitive 16) crates/astrid-audit/src/storage/blind_move.rs:141 — astrid_audit::storage::blind_move::copy_namespace has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · TooManyFields · ×4
  • TooManyFields: HostState crates/astrid-capsule/src/engine/wasm/host_state.rs:252 — TooManyFields — 92 stored fields beside 57 methods. The bar is 30 stored fields; this is 62 over it, 3.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: App crates/astrid-cli-mockup/src/ui/state.rs:671 — TooManyFields — 64 stored fields beside 10 methods. The bar is 30 stored fields; this is 34 over it, 2.13× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Kernel crates/astrid-kernel/src/lib.rs:213 — TooManyFields — 55 stored fields beside 76 methods. The bar is 30 stored fields; this is 25 over it, 1.83× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: WasmEngine crates/astrid-capsule/src/engine/wasm/mod.rs:195 — TooManyFields — 31 stored fields beside 6 methods. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×4
  • Duplicated block (21 lines × 2) crates/astrid-capsule/src/engine/wasm/host/process/audit.rs:39 — crates/astrid-capsule/src/engine/wasm/host/process/audit.rs:39-59 | crates/astrid-capsule/src/engine/wasm/host/process/audit.rs:223-243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (21 lines × 2) crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:862 — crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:862-882 | crates/astrid-kernel/src/storage_mount/process_broker/process_cleanup.rs:282-302 — 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 (21 lines × 2) crates/astrid-storage/src/resources/pool.rs:108 — crates/astrid-storage/src/resources/pool.rs:108-128 | crates/astrid-storage/src/resources/pool.rs:284-304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (21 lines × 2) scripts/musl_release_manifest.py:56 — scripts/musl_release_manifest.py:56-76 | scripts/windows_release_manifest.py:60-80 — before extracting anything, compare `scripts/musl_release_manifest.py` and `scripts/windows_release_manifest.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/musl_release_manifest.py:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×4
  • Duplicated block (12 lines × 3) crates/astrid-kernel/src/kernel_router/admin/invite_handlers.rs:68 — crates/astrid-kernel/src/kernel_router/admin/invite_handlers.rs:68-79 | crates/astrid-kernel/src/kernel_router/admin/invite_handlers.rs:138-149 | crates/astrid-kernel/src/kernel_router/admin/invite_handlers.rs:357-368 — 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 (12 lines × 3) crates/astrid-kernel/src/pair_token/durable_reservation.rs:254 — crates/astrid-kernel/src/pair_token/durable_reservation.rs:254-265 | crates/astrid-kernel/src/pair_token/durable_reservation.rs:280-291 | crates/astrid-kernel/src/pair_token/mod.rs:420-431 — 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/astrid-storage/src/engine/durable_cache/mod.rs:136 — crates/astrid-storage/src/engine/durable_cache/mod.rs:136-147 | crates/astrid-storage/src/engine/durable_cache/mod.rs:221-232 | crates/astrid-storage/src/engine/durable_cache/mod.rs:403-414 — 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 (12 lines × 3) crates/astrid-storage/src/principal_state/volume_migration.rs:26 — crates/astrid-storage/src/principal_state/volume_migration.rs:26-37 | crates/astrid-storage/src/principal_state/volume_migration.rs:142-153 | crates/astrid-storage/src/principal_state/volume_migration.rs:231-242 — 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.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×4
  • Duplicated block (11–12 lines × 2) crates/astrid-capabilities/src/store.rs:107 — crates/astrid-capabilities/src/store.rs:107-118 | crates/astrid-capabilities/src/store.rs:128-138 — 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–12 lines × 2) crates/astrid-cli-mockup/src/ui/render.rs:484 — crates/astrid-cli-mockup/src/ui/render.rs:484-495 | crates/astrid-cli/src/tui/render.rs:736-746 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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/astrid-cli/src/tui/render.rs:1214 — crates/astrid-cli/src/tui/render.rs:1214-1224 | crates/astrid-cli/src/tui/render.rs:1349-1360 — 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–12 lines × 2) crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:499 — crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:499-510 | crates/astrid-kernel/src/lib.rs:4323-4333 — 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.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×4
  • Duplicated block (10 lines × 3) crates/astrid-storage/src/content/store.rs:480 — crates/astrid-storage/src/content/store.rs:480-489 | crates/astrid-storage/src/content/store.rs:561-570 | crates/astrid-storage/src/content/store.rs:688-697 — 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/astrid-core/src/identity/ownership.rs:205 — crates/astrid-core/src/identity/ownership.rs:205-214 | crates/astrid-core/src/identity/ownership.rs:308-317 | crates/astrid-core/src/identity/principal.rs:214-223 — before extracting anything, compare `crates/astrid-core/src/identity/ownership.rs` and `crates/astrid-core/src/identity/principal.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 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/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:136 — crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:136-145 | crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:218-227 | crates/astrid-kernel/src/legacy_migration_barrier/legacy_tmp.rs:41-50 — before extracting anything, compare `crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs` and `crates/astrid-kernel/src/legacy_migration_barrier/legacy_tmp.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 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/astrid-kernel/src/lib.rs:2464 — crates/astrid-kernel/src/lib.rs:2464-2473 | crates/astrid-kernel/src/lib.rs:2477-2486 | crates/astrid-kernel/src/lib.rs:2583-2592 — 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.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×4
  • Duplicated block (7–8 lines × 2) crates/astrid-capsule-install/src/wasm.rs:87 — crates/astrid-capsule-install/src/wasm.rs:87-93 | crates/astrid-capsule-install/src/wit.rs:165-172 — 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–8 lines × 2) crates/astrid-capsule/src/engine/wasm/host/net/mod.rs:719 — crates/astrid-capsule/src/engine/wasm/host/net/mod.rs:719-726 | crates/astrid-capsule/src/engine/wasm/host/net/mod.rs:838-844 — 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–8 lines × 2) crates/astrid-cli/src/tui/input.rs:570 — crates/astrid-cli/src/tui/input.rs:570-576 | crates/astrid-cli/src/tui/input.rs:597-604 — 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–8 lines × 2) crates/astrid-vfs/src/workspace_cow/apfs.rs:76 — crates/astrid-vfs/src/workspace_cow/apfs.rs:76-83 | crates/astrid-vfs/src/workspace_cow/overlayfs.rs:165-171 — 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.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×4
  • Duplicated block (7 lines × 3) crates/astrid-capsule/src/engine/wasm/host/fs/mod.rs:411 — crates/astrid-capsule/src/engine/wasm/host/fs/mod.rs:411-417 | crates/astrid-capsule/src/engine/wasm/host/fs/mod.rs:478-484 | crates/astrid-capsule/src/engine/wasm/host/fs/mod.rs:667-673 — 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/astrid-cli/src/commands/daemon_control.rs:77 — crates/astrid-cli/src/commands/daemon_control.rs:77-83 | crates/astrid-cli/src/commands/daemon_control.rs:115-121 | crates/astrid-cli/src/commands/daemon_control.rs:137-143 — 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/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:884 — crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:884-890 | crates/astrid-kernel/src/principal_home_migration/paths.rs:24-30 | crates/astrid-kernel/src/principal_log_migration.rs:502-508 — 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 (7 lines × 3) crates/astrid-storage-provider-fskit/src/main.rs:293 — crates/astrid-storage-provider-fskit/src/main.rs:293-299 | crates/astrid-storage-provider-fuse/src/main.rs:894-900 | crates/astrid-storage-provider-winfsp/src/main.rs:303-309 — before extracting anything, compare `crates/astrid-storage-provider-fskit/src/main.rs` and `crates/astrid-storage-provider-winfsp/src/main.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 133 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.
D1 · Cyclomatic Complexity · astrid_capsule_install · ×3
  • astrid_capsule_install::local::install_from_local_path_internal (cyclomatic 33) crates/astrid-capsule-install/src/local.rs:547 — astrid_capsule_install::local::install_from_local_path_internal has cyclomatic complexity 33 (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.
  • astrid_capsule_install::storage::verify_package_identity (cyclomatic 29) crates/astrid-capsule-install/src/storage.rs:251 — astrid_capsule_install::storage::verify_package_identity has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • astrid_capsule_install::storage::migration::migrate_native_capsules_with_report (cyclomatic 19) crates/astrid-capsule-install/src/storage/migration.rs:92 — astrid_capsule_install::storage::migration::migrate_native_capsules_with_report 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.
D1 · Cyclomatic Complexity · astrid_capsule · ×3
  • astrid_capsule::dispatcher::collect_matching_interceptors (cyclomatic 24) crates/astrid-capsule/src/dispatcher.rs:717 — astrid_capsule::dispatcher::collect_matching_interceptors has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • astrid_capsule::engine::wasm::wasm_exports_contain (cyclomatic 20) crates/astrid-capsule/src/engine/wasm/mod.rs:4328 — astrid_capsule::engine::wasm::wasm_exports_contain 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.
  • astrid_capsule::engine::wasm::host::ipc::publish_inner (cyclomatic 19) crates/astrid-capsule/src/engine/wasm/host/ipc.rs:228 — astrid_capsule::engine::wasm::host::ipc::publish_inner 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.
D1 · Cyclomatic Complexity · HostState · ×3
  • HostState::bind_tcp (cyclomatic 22) crates/astrid-capsule/src/engine/wasm/host/net/mod.rs:481 — HostState::bind_tcp 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.
  • HostState::spawn_persistent (cyclomatic 21) crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:664 — HostState::spawn_persistent has cyclomatic complexity 21 (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.
  • HostState::request_approval (cyclomatic 18) crates/astrid-capsule/src/engine/wasm/host/approval.rs:358 — HostState::request_approval 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.
D2 · Cognitive Complexity · WasmEngine · ×3
  • WasmEngine::load (cognitive 122) crates/astrid-capsule/src/engine/wasm/mod.rs:1690 — WasmEngine::load has cognitive complexity 122 (threshold 15). Drivers by points: if/else 57 (74 pts), match/switch 9 (21 pts), loops 10 (20 pts), boolean chains 7 (nesting depth added 39). 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.
  • WasmEngine::invoke_interceptor (cognitive 27) crates/astrid-capsule/src/engine/wasm/mod.rs:3165 — WasmEngine::invoke_interceptor has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (13 pts), match/switch 9 (12 pts), boolean chains 2 (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.
  • WasmEngine::commit_workspace (cognitive 16) crates/astrid-capsule/src/engine/wasm/mod.rs:542 — WasmEngine::commit_workspace has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (9 pts), if/else 4 (5 pts), boolean chains 2 (nesting depth added 5). 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.
D2 · Cognitive Complexity · CapabilityStore · ×3
  • CapabilityStore::find_capability (cognitive 38) crates/astrid-capabilities/src/store.rs:419 — CapabilityStore::find_capability has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (30 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 20). 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.
  • CapabilityStore::purge_principal (cognitive 17) crates/astrid-capabilities/src/store.rs:635 — CapabilityStore::purge_principal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4, 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.
  • CapabilityStore::list_tokens (cognitive 16) crates/astrid-capabilities/src/store.rs:765 — CapabilityStore::list_tokens has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D35 · Change Coupling · Change coupling · ×3
  • Change coupling: mod.rs ↔ tests.rs crates/astrid-kernel/src/kernel_router/admin/handlers/mod.rs:1 — `crates/astrid-kernel/src/kernel_router/admin/handlers/mod.rs` and `crates/astrid-kernel/src/kernel_router/admin/tests.rs` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `58b5bbd7` fix(cli): bind signed Distro.toml apply to caller grants (#1827); `0da5b382` fix(kernel): preserve device attenuation across authority views (#1238) (at that commit the file was still `crates/astrid-kernel/src/kernel_router/admin/handlers.rs`); `cb2a988a` feat(cli): grant installed distro capsules to the target principal (#… (at that commit the file was still `crates/astrid-kernel/src/kernel_router/admin/handlers.rs`) — run `git show` on any of them.
  • Change coupling: capsule.rs ↔ manifest_gate.rs crates/astrid-capsule/src/capsule.rs:1 — `crates/astrid-capsule/src/capsule.rs` and `crates/astrid-capsule/src/security/manifest_gate.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 `67303316` fix(capsule): retire compiled cache keys after final runtime release …; `e1cfc0ac` feat(manifest): Cargo-shaped Capsule.toml schema with [publish] / [su…; `60d0ae3b` refactor: remove [[llm_provider]] from kernel manifest (#610) (at that commit the file was still `crates/astrid-capsule/src/security.rs`) — run `git show` on any of them.
  • Change coupling: registry.rs ↔ manifest_gate.rs crates/astrid-capsule/src/registry.rs:1 — `crates/astrid-capsule/src/registry.rs` and `crates/astrid-capsule/src/security/manifest_gate.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 `e1cfc0ac` feat(manifest): Cargo-shaped Capsule.toml schema with [publish] / [su…; `60d0ae3b` refactor: remove [[llm_provider]] from kernel manifest (#610) (at that commit the file was still `crates/astrid-capsule/src/security.rs`); `67351d24` refactor: remove ToolDef, CronDef, and dead cron host functions (#593) (at that commit the file was still `crates/astrid-capsule/src/security.rs`) — run `git show` on any of them.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×3
  • Duplicated block (12–14 lines × 2) crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:209 — crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:209-220 | crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:424-437 — 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–14 lines × 2) crates/astrid-kernel/src/kernel_router/admin/handlers/env_handlers.rs:43 — crates/astrid-kernel/src/kernel_router/admin/handlers/env_handlers.rs:43-54 | crates/astrid-kernel/src/kernel_router/install.rs:605-618 — 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–14 lines × 2) crates/astrid-storage/src/content/store.rs:342 — crates/astrid-storage/src/content/store.rs:342-355 | crates/astrid-storage/src/content/store.rs:418-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.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×3
  • Duplicated block (11 lines × 3) crates/astrid-storage/src/content/store.rs:159 — crates/astrid-storage/src/content/store.rs:159-169 | crates/astrid-storage/src/engine/kv.rs:634-644 | crates/astrid-storage/src/kv/tree/legacy_avl.rs:323-333 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (11 lines × 3) crates/astrid-storage/src/engine/durable/native_io.rs:158 — crates/astrid-storage/src/engine/durable/native_io.rs:158-168 | crates/astrid-storage/src/engine/durable/representations/contiguous/namespace.rs:103-113 | crates/astrid-storage/src/principal_state/native_io.rs:201-211 — before extracting anything, compare `crates/astrid-storage/src/engine/durable/native_io.rs` and `crates/astrid-storage/src/engine/durable/representations/contiguous/namespace.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 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 × 3) crates/astrid-capsule-install/src/authority/leftover.rs:309 — crates/astrid-capsule-install/src/authority/leftover.rs:309-319 | crates/astrid-kernel/src/principal_home_migration/unbound.rs:307-317 | crates/astrid-storage/src/principal_state/unbound_legacy.rs:305-315 — before extracting anything, compare `crates/astrid-capsule-install/src/authority/leftover.rs` and `crates/astrid-storage/src/principal_state/unbound_legacy.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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.
D4 · Code Duplication · Duplicated block (8–11 lines × 2) · ×3
  • Duplicated block (8–11 lines × 2) crates/astrid-cli-mockup/src/ui/views/log.rs:21 — crates/astrid-cli-mockup/src/ui/views/log.rs:21-28 | crates/astrid-cli/src/tui/render.rs:525-535 — 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–11 lines × 2) crates/astrid-gateway/src/routes/sessions.rs:468 — crates/astrid-gateway/src/routes/sessions.rs:468-478 | crates/astrid-gateway/src/routes/sessions.rs:616-623 — 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–11 lines × 2) crates/astrid-storage/src/content/store.rs:330 — crates/astrid-storage/src/content/store.rs:330-340 | crates/astrid-storage/src/content/store.rs:408-415 — 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.
D1 · Cyclomatic Complexity · WasmEngine · ×2
  • WasmEngine::load (cyclomatic 66) crates/astrid-capsule/src/engine/wasm/mod.rs:1690 — WasmEngine::load has cyclomatic complexity 66 (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.
  • WasmEngine::invoke_interceptor (cyclomatic 23) crates/astrid-capsule/src/engine/wasm/mod.rs:3165 — WasmEngine::invoke_interceptor 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.
D1 · Cyclomatic Complexity · astrid_core · ×2
  • astrid_core::local_transport::windows::validate_pipe_security (cyclomatic 18) crates/astrid-core/src/local_transport/windows.rs:882 — astrid_core::local_transport::windows::validate_pipe_security 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.
  • astrid_core::dirs::stopped_key::recognize (cyclomatic 17) crates/astrid-core/src/dirs/stopped_key.rs:7 — astrid_core::dirs::stopped_key::recognize 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.
D2 · Cognitive Complexity · CanonicalPhysicalMap · ×2
  • CanonicalPhysicalMap::rebuild_with_entries (cognitive 30) crates/astrid-storage/src/storage_model/physical/map.rs:612 — CanonicalPhysicalMap::rebuild_with_entries has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4 (8 pts), match/switch 2 (5 pts) (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.
  • CanonicalPhysicalMap::get (cognitive 16) crates/astrid-storage/src/storage_model/physical/map.rs:729 — CanonicalPhysicalMap::get has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 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.
D2 · Cognitive Complexity · astrid_storage_provider_fuse · ×2
  • astrid_storage_provider_fuse::service::service_loop (cognitive 30) crates/astrid-storage-provider-fuse/src/service.rs:105 — astrid_storage_provider_fuse::service::service_loop has cognitive complexity 30 (threshold 15). Drivers by points: match/switch 4 (14 pts), if/else 4 (13 pts), boolean chains 2, loops 1 (nesting depth added 19). 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.
  • astrid_storage_provider_fuse::service_loop (cognitive 18) crates/astrid-storage-provider-fuse/src/main.rs:501 — astrid_storage_provider_fuse::service_loop has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 3 (12 pts), if/else 3 (5 pts), loops 1 (nesting depth added 11). 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.
D2 · Cognitive Complexity · InputBuffer · ×2
  • InputBuffer::normalize (cognitive 27) crates/astrid-cli/src/tui/state.rs:495 — InputBuffer::normalize has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (24 pts), match/switch 1 (2 pts), 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.
  • InputBuffer::delete_forward (cognitive 21) crates/astrid-cli/src/tui/state.rs:211 — InputBuffer::delete_forward has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · astrid_hooks · ×2
  • astrid_hooks::discovery::discover_hooks_in_workspace (cognitive 24) crates/astrid-hooks/src/discovery.rs:68 — astrid_hooks::discovery::discover_hooks_in_workspace has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (8 pts), loops 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • astrid_hooks::discovery::load_hooks_from_dir (cognitive 20) crates/astrid-hooks/src/discovery.rs:122 — astrid_hooks::discovery::load_hooks_from_dir has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 2 (8 pts), if/else 3 (7 pts), loops 2 (4 pts), boolean chains 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.
D2 · Cognitive Complexity · astrid_storage_provider_winfsp · ×2
  • astrid_storage_provider_winfsp::win::validate_service_launch (cognitive 24) crates/astrid-storage-provider-winfsp/src/win.rs:236 — astrid_storage_provider_winfsp::win::validate_service_launch has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15, boolean chains 9. 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.
  • astrid_storage_provider_winfsp::win::private_service_loop (cognitive 24) crates/astrid-storage-provider-winfsp/src/win.rs:379 — astrid_storage_provider_winfsp::win::private_service_loop has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (17 pts), match/switch 2 (5 pts), boolean chains 1, loops 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.
D2 · Cognitive Complexity · TreeContext · ×2
  • TreeContext::build_sorted (cognitive 20) crates/astrid-storage/src/kv/tree/context.rs:95 — TreeContext::build_sorted has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (4 pts), match/switch 1 (3 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.
  • TreeContext::validate_page (cognitive 17) crates/astrid-storage/src/kv/tree/validation.rs:112 — TreeContext::validate_page has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (6 pts), boolean chains 2, 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.
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (33 shared lines) · ×2
  • Near-duplicate member pair (33 shared lines) crates/astrid-storage/src/volume/hosted/mod.rs:105 — crates/astrid-storage/src/volume/hosted/mod.rs:105-158 | crates/astrid-storage/src/volume/hosted/stream.rs:94-151 — These two members are variants of one another: 33 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 (33 shared lines) crates/astrid-cli-mockup/src/ui/render.rs:682 — crates/astrid-cli-mockup/src/ui/render.rs:682-774 | crates/astrid-cli/src/tui/render.rs:1471-1545 — These two members are variants of one another: 33 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (29 shared lines) · ×2
  • Near-duplicate member pair (29 shared lines) crates/astrid-kernel/src/invite/storage_migration.rs:60 — crates/astrid-kernel/src/invite/storage_migration.rs:60-96 | crates/astrid-kernel/src/pair_token/storage_migration.rs:76-112 — These two members are variants of one another: 29 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 (29 shared lines) crates/astrid-storage/src/engine/durable/representations/mod.rs:184 — crates/astrid-storage/src/engine/durable/representations/mod.rs:184-268 | crates/astrid-storage/src/engine/durable/representations/volume.rs:65-154 — These two members are variants of one another: 29 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (5 members, 50+ identical tokens) crates/astrid-capsule/src/engine/wasm/host/identity.rs:30 — crates/astrid-capsule/src/engine/wasm/host/identity.rs:30-64 | crates/astrid-capsule/src/engine/wasm/host/identity.rs:66-99 | crates/astrid-capsule/src/engine/wasm/host/identity.rs:101-130 | crates/astrid-capsule/src/engine/wasm/host/identity.rs:135-163 | crates/astrid-capsule/src/engine/wasm/host/identity.rs:168-205 — These 5 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 5 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 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) crates/astrid-gateway/src/routes/caps.rs:59 — crates/astrid-gateway/src/routes/caps.rs:59-78 | crates/astrid-gateway/src/routes/groups.rs:114-132 | crates/astrid-gateway/src/routes/groups.rs:150-168 | crates/astrid-gateway/src/routes/principals.rs:176-199 | crates/astrid-gateway/src/routes/principals.rs:317-338 — These 5 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 5 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 5 times.
D4 · Code Duplication · Duplicated block (57 lines × 2) · ×2
  • Duplicated block (57 lines × 2) crates/astrid-storage/src/engine/durable/recovery.rs:87 — crates/astrid-storage/src/engine/durable/recovery.rs:87-143 | crates/astrid-storage/src/engine/durable/recovery.rs:180-236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (57 lines × 2) scripts/musl_release_manifest.py:125 — scripts/musl_release_manifest.py:125-181 | scripts/windows_release_manifest.py:129-185 — before extracting anything, compare `scripts/musl_release_manifest.py` and `scripts/windows_release_manifest.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 147 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.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×2
  • Duplicated block (30 lines × 2) crates/astrid-kernel/src/pair_token/durable_reservation.rs:76 — crates/astrid-kernel/src/pair_token/durable_reservation.rs:76-105 | crates/astrid-kernel/src/pair_token/durable_reservation.rs:131-160 — 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 (30 lines × 2) scripts/musl_release_manifest.py:256 — scripts/musl_release_manifest.py:256-285 | scripts/windows_release_manifest.py:234-263 — before extracting anything, compare `scripts/musl_release_manifest.py` and `scripts/windows_release_manifest.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×2
  • Duplicated block (26 lines × 2) crates/astrid-audit/src/storage/append.rs:510 — crates/astrid-audit/src/storage/append.rs:510-535 | crates/astrid-audit/src/storage/append_batch.rs:395-420 — before extracting anything, compare `crates/astrid-audit/src/storage/append.rs` and `crates/astrid-audit/src/storage/append_batch.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 56 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 (26 lines × 2) crates/astrid-cli/src/commands/capsule/install.rs:799 — crates/astrid-cli/src/commands/capsule/install.rs:799-824 | crates/astrid-cli/src/commands/capsule/install.rs:915-940 — 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.
D4 · Code Duplication · Duplicated block (23–24 lines × 2) · ×2
  • Duplicated block (23–24 lines × 2) crates/astrid-cli-mockup/src/ui/render.rs:85 — crates/astrid-cli-mockup/src/ui/render.rs:85-108 | crates/astrid-cli/src/tui/render.rs:114-136 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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 (23–24 lines × 2) crates/astrid-cli-mockup/src/ui/render.rs:533 — crates/astrid-cli-mockup/src/ui/render.rs:533-556 | crates/astrid-cli/src/tui/render.rs:861-883 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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.
D4 · Code Duplication · Duplicated block (19–20 lines × 3) · ×2
  • Duplicated block (19–20 lines × 3) crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:240 — crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:240-258 | crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:469-488 | crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:750-769 — 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 × 3) crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:261 — crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:261-279 | crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:495-513 | crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:776-795 — 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.
D4 · Code Duplication · Duplicated block (15–18 lines × 2) · ×2
  • Duplicated block (15–18 lines × 2) crates/astrid-capsule/src/discovery.rs:212 — crates/astrid-capsule/src/discovery.rs:212-229 | crates/astrid-capsule/src/discovery.rs:237-251 — 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–18 lines × 2) crates/astrid-kernel/src/kernel_router/admin/agent_create_helpers/create.rs:338 — crates/astrid-kernel/src/kernel_router/admin/agent_create_helpers/create.rs:338-355 | crates/astrid-kernel/src/lib.rs:5539-5553 — 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.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×2
  • Duplicated block (15–17 lines × 2) crates/astrid-cli/src/commands/capsule/install_headless.rs:196 — crates/astrid-cli/src/commands/capsule/install_headless.rs:196-210 | crates/astrid-cli/src/commands/capsule/install_prompts.rs:411-427 — before extracting anything, compare `crates/astrid-cli/src/commands/capsule/install_headless.rs` and `crates/astrid-cli/src/commands/capsule/install_prompts.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 73 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–17 lines × 2) crates/astrid-storage/src/engine/durable_cache/mod.rs:873 — crates/astrid-storage/src/engine/durable_cache/mod.rs:873-887 | crates/astrid-storage/src/engine/durable_cache/mod.rs:916-932 — 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.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×2
  • Duplicated block (15–16 lines × 2) crates/astrid-cli/src/tui/mod.rs:744 — crates/astrid-cli/src/tui/mod.rs:744-759 | crates/astrid-cli/src/tui/mod.rs:775-789 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15–16 lines × 2) crates/astrid-kernel/src/invite/mod.rs:225 — crates/astrid-kernel/src/invite/mod.rs:225-239 | crates/astrid-kernel/src/pair_token/mod.rs:239-254 — `crates/astrid-kernel/src/invite/mod.rs` and `crates/astrid-kernel/src/pair_token/mod.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 17 separate duplicated blocks between them, totalling at least 162 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×2
  • Duplicated block (12–13 lines × 2) crates/astrid-capsule/src/engine/wasm/host/fs/mod.rs:235 — crates/astrid-capsule/src/engine/wasm/host/fs/mod.rs:235-246 | crates/astrid-capsule/src/engine/wasm/host/fs/mod.rs:289-301 — 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–13 lines × 2) crates/astrid-cli-mockup/src/ui/render.rs:109 — crates/astrid-cli-mockup/src/ui/render.rs:109-121 | crates/astrid-cli/src/tui/render.rs:138-149 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×2
  • Duplicated block (11–13 lines × 2) crates/astrid-capsule/src/engine/wasm/host/net/mod.rs:558 — crates/astrid-capsule/src/engine/wasm/host/net/mod.rs:558-568 | crates/astrid-capsule/src/engine/wasm/host/net/mod.rs:604-616 — 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–13 lines × 2) crates/astrid-cli-mockup/src/ui/input.rs:374 — crates/astrid-cli-mockup/src/ui/input.rs:374-386 | crates/astrid-cli/src/tui/input.rs:802-812 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/input.rs` and `crates/astrid-cli/src/tui/input.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 58 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.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×2
  • Duplicated block (10–12 lines × 2) crates/astrid-cli-mockup/src/ui/render.rs:618 — crates/astrid-cli-mockup/src/ui/render.rs:618-627 | crates/astrid-cli/src/tui/render.rs:947-958 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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–12 lines × 2) crates/astrid-uplink/src/socket_client.rs:261 — crates/astrid-uplink/src/socket_client.rs:261-272 | crates/astrid-uplink/src/socket_client.rs:293-302 — 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.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×2
  • Duplicated block (9–11 lines × 2) crates/astrid-storage/src/engine/durable/native_io.rs:16 — crates/astrid-storage/src/engine/durable/native_io.rs:16-26 | crates/astrid-storage/src/engine/durable/native_io.rs:35-43 — 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–11 lines × 2) crates/astrid-vfs/src/overlay.rs:127 — crates/astrid-vfs/src/overlay.rs:127-135 | crates/astrid-vfs/src/overlay.rs:193-203 — 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.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×2
  • Duplicated block (9 lines × 5) crates/astrid-cli/src/tui/mod.rs:104 — crates/astrid-cli/src/tui/mod.rs:104-112 | crates/astrid-cli/src/tui/mod.rs:611-619 | crates/astrid-cli/src/tui/mod.rs:754-762 | crates/astrid-cli/src/tui/mod.rs:784-792 | crates/astrid-cli/src/tui/mod.rs:808-816 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 5) crates/astrid-gateway/src/routes/caps.rs:70 — crates/astrid-gateway/src/routes/caps.rs:70-78 | crates/astrid-gateway/src/routes/groups.rs:124-132 | crates/astrid-gateway/src/routes/groups.rs:160-168 | crates/astrid-gateway/src/routes/principals.rs:191-199 | crates/astrid-gateway/src/routes/principals.rs:330-338 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×2
  • Duplicated block (8 lines × 4) crates/astrid-cli-mockup/src/ui/render.rs:151 — crates/astrid-cli-mockup/src/ui/render.rs:151-158 | crates/astrid-cli-mockup/src/ui/views/nexus.rs:59-66 | crates/astrid-cli/src/tui/render.rs:180-187 | crates/astrid-cli/src/tui/render.rs:645-652 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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 × 4) crates/astrid-kernel/src/invite/storage_migration.rs:14 — crates/astrid-kernel/src/invite/storage_migration.rs:14-21 | crates/astrid-kernel/src/invite/storage_migration.rs:64-71 | crates/astrid-kernel/src/pair_token/storage_migration.rs:15-22 | crates/astrid-kernel/src/pair_token/storage_migration.rs:80-87 — `crates/astrid-kernel/src/invite/storage_migration.rs` and `crates/astrid-kernel/src/pair_token/storage_migration.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 43 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.
D4 · Code Duplication · Duplicated block (7–8 lines × 3) · ×2
  • Duplicated block (7–8 lines × 3) crates/astrid-cli/src/commands/agent/mod.rs:627 — crates/astrid-cli/src/commands/agent/mod.rs:627-633 | crates/astrid-cli/src/commands/caps.rs:178-184 | crates/astrid-cli/src/commands/caps.rs:354-361 — 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 (7–8 lines × 3) crates/astrid-kernel/src/invite/mod.rs:382 — crates/astrid-kernel/src/invite/mod.rs:382-388 | crates/astrid-kernel/src/invite/mod.rs:433-440 | crates/astrid-kernel/src/invite/mod.rs:466-472 — 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.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×2
  • Duplicated block (7 lines × 5) crates/astrid-capsule/src/engine/wasm/host/identity.rs:34 — crates/astrid-capsule/src/engine/wasm/host/identity.rs:34-42 | crates/astrid-capsule/src/engine/wasm/host/identity.rs:73-79 | crates/astrid-capsule/src/engine/wasm/host/identity.rs:105-111 | crates/astrid-capsule/src/engine/wasm/host/identity.rs:139-145 | crates/astrid-capsule/src/engine/wasm/host/identity.rs:175-181 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 5) crates/astrid-storage/src/content/store.rs:542 — crates/astrid-storage/src/content/store.rs:542-548 | crates/astrid-storage/src/content/store.rs:635-641 | crates/astrid-storage/src/content/store.rs:654-660 | crates/astrid-storage/src/content/store.rs:671-677 | crates/astrid-storage/src/content/store/bulk/publish.rs:40-46 — there are 5 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 5 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×2
  • Duplicated block (6–7 lines × 2) crates/astrid-audit/src/host_call.rs:245 — crates/astrid-audit/src/host_call.rs:245-250 | crates/astrid-kernel/src/audit_sink/coverage.rs:62-68 — 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–7 lines × 2) crates/astrid-cli-mockup/src/ui/input.rs:23 — crates/astrid-cli-mockup/src/ui/input.rs:23-29 | crates/astrid-cli/src/tui/input.rs:14-19 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/input.rs` and `crates/astrid-cli/src/tui/input.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 58 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.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×2
  • Duplicated block (5 lines × 3) crates/astrid-capsule-install/src/authority.rs:332 — crates/astrid-capsule-install/src/authority.rs:332-336 | crates/astrid-cli/src/commands/daemon.rs:902-906 | crates/astrid-cli/src/commands/distro/trust.rs:107-111 — 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 (5 lines × 3) crates/astrid-capsule/src/engine/wasm/host/net/mod.rs:487 — crates/astrid-capsule/src/engine/wasm/host/net/mod.rs:487-491 | crates/astrid-capsule/src/engine/wasm/host/net/mod.rs:722-726 | crates/astrid-capsule/src/engine/wasm/host/net/mod.rs:840-844 — 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.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×2
  • Duplicated block (11 lines × 4) crates/astrid-capsule-install/src/archive.rs:91 — crates/astrid-capsule-install/src/archive.rs:91-101 | crates/astrid-capsule-install/src/authority.rs:682-692 | crates/astrid-capsule-install/src/authority.rs:742-752 | crates/astrid-capsule-install/src/local.rs:277-287 — before extracting anything, compare `crates/astrid-capsule-install/src/archive.rs` and `crates/astrid-capsule-install/src/local.rs` as WHOLE FILES: this scan already matched 4 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. 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 × 4) crates/astrid-capsule/src/engine/wasm/host/fs/mod.rs:66 — crates/astrid-capsule/src/engine/wasm/host/fs/mod.rs:66-76 | crates/astrid-capsule/src/engine/wasm/host/net/mod.rs:264-274 | crates/astrid-capsule/src/engine/wasm/host/process/audit.rs:40-50 | crates/astrid-capsule/src/engine/wasm/host/process/audit.rs:224-234 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
D1 · Cyclomatic Complexity · musl_release_manifest.validate_manifest (cyclomatic 49) · ×1
  • musl_release_manifest.validate_manifest (cyclomatic 49) scripts/musl_release_manifest.py:116 — musl_release_manifest.validate_manifest has cyclomatic complexity 49 (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.
D1 · Cyclomatic Complexity · windows_release_manifest.validate_manifest (cyclomatic 46) · ×1
  • windows_release_manifest.validate_manifest (cyclomatic 46) scripts/windows_release_manifest.py:120 — windows_release_manifest.validate_manifest has cyclomatic complexity 46 (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.
D1 · Cyclomatic Complexity · release_manifest.validate_manifest (cyclomatic 45) · ×1
  • release_manifest.validate_manifest (cyclomatic 45) scripts/release_manifest.py:221 — release_manifest.validate_manifest has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · runatal_v1_physical.validate_map (cyclomatic 36) · ×1
  • runatal_v1_physical.validate_map (cyclomatic 36) scripts/runatal_v1_physical.py:670 — runatal_v1_physical.validate_map has cyclomatic complexity 36 (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.
D1 · Cyclomatic Complexity · runatal_v1_reader.recover (cyclomatic 34) · ×1
  • runatal_v1_reader.recover (cyclomatic 34) scripts/runatal_v1_reader.py:837 — runatal_v1_reader.recover has cyclomatic complexity 34 (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.
D1 · Cyclomatic Complexity · runatal_v1_volume.recover_volume (cyclomatic 32) · ×1
  • runatal_v1_volume.recover_volume (cyclomatic 32) scripts/runatal_v1_volume.py:135 — runatal_v1_volume.recover_volume 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.
D1 · Cyclomatic Complexity · channel_metadata.validate_channel (cyclomatic 29) · ×1
  • channel_metadata.validate_channel (cyclomatic 29) scripts/channel_metadata.py:137 — channel_metadata.validate_channel has cyclomatic complexity 29 (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.
D1 · Cyclomatic Complexity · validate_macos_release.validate (cyclomatic 29) · ×1
  • validate_macos_release.validate (cyclomatic 29) scripts/validate_macos_release.py:19 — validate_macos_release.validate has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AllowancePattern · ×1
  • AllowancePattern::matches (cyclomatic 27) crates/astrid-approval/src/allowance/pattern.rs:119 — AllowancePattern::matches 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.
D1 · Cyclomatic Complexity · OwnershipSnapshot · ×1
  • OwnershipSnapshot::validate (cyclomatic 25) crates/astrid-storage/src/ownership.rs:161 — OwnershipSnapshot::validate 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.
D1 · Cyclomatic Complexity · astrid_storage_provider_winfsp · ×1
  • astrid_storage_provider_winfsp::win::validate_service_launch (cyclomatic 25) crates/astrid-storage-provider-winfsp/src/win.rs:236 — astrid_storage_provider_winfsp::win::validate_service_launch has cyclomatic complexity 25 (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.
D1 · Cyclomatic Complexity · runatal_v1_physical.decode_map_node (cyclomatic 25) · ×1
  • runatal_v1_physical.decode_map_node (cyclomatic 25) scripts/runatal_v1_physical.py:365 — runatal_v1_physical.decode_map_node 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.
D1 · Cyclomatic Complexity · WorkspaceBranchStore · ×1
  • WorkspaceBranchStore::rename_batch_inner (cyclomatic 23) crates/astrid-storage/src/content/store/workspace/operations.rs:642 — WorkspaceBranchStore::rename_batch_inner 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.
D1 · Cyclomatic Complexity · runatal_v1_kv.decode_legacy_node (cyclomatic 22) · ×1
  • runatal_v1_kv.decode_legacy_node (cyclomatic 22) scripts/runatal_v1_kv.py:323 — runatal_v1_kv.decode_legacy_node 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.
D1 · Cyclomatic Complexity · runatal_v1_sha384.verify_attestation (cyclomatic 22) · ×1
  • runatal_v1_sha384.verify_attestation (cyclomatic 22) scripts/runatal_v1_sha384.py:453 — runatal_v1_sha384.verify_attestation 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.
D1 · Cyclomatic Complexity · validate_release_archive.validate (cyclomatic 22) · ×1
  • validate_release_archive.validate (cyclomatic 22) scripts/validate_release_archive.py:36 — validate_release_archive.validate 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.
D1 · Cyclomatic Complexity · PrincipalContentStore · ×1
  • PrincipalContentStore::rename_batch_replacing (cyclomatic 20) crates/astrid-storage/src/content/store.rs:601 — PrincipalContentStore::rename_batch_replacing 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.
D1 · Cyclomatic Complexity · astrid_uplink · ×1
  • astrid_uplink::native::serve_connection (cyclomatic 20) crates/astrid-uplink/src/native/mod.rs:451 — astrid_uplink::native::serve_connection 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.
D1 · Cyclomatic Complexity · KernelProcessStorageMountBroker · ×1
  • KernelProcessStorageMountBroker::mount (cyclomatic 19) crates/astrid-kernel/src/storage_mount/process_broker/mod.rs:72 — KernelProcessStorageMountBroker::mount 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.
D1 · Cyclomatic Complexity · KvHotCache · ×1
  • KvHotCache::insert_bounded (cyclomatic 19) crates/astrid-storage/src/kv/tree/hot_cache.rs:487 — KvHotCache::insert_bounded 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.
D1 · Cyclomatic Complexity · CapabilityStore · ×1
  • CapabilityStore::find_capability (cyclomatic 18) crates/astrid-capabilities/src/store.rs:419 — CapabilityStore::find_capability 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.
D1 · Cyclomatic Complexity · ManifestSecurityGate · ×1
  • ManifestSecurityGate::check_fs_permission (cyclomatic 18) crates/astrid-capsule/src/security/manifest_gate.rs:150 — ManifestSecurityGate::check_fs_permission 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.
D1 · Cyclomatic Complexity · runatal_v1_physical.decode_representation (cyclomatic 18) · ×1
  • runatal_v1_physical.decode_representation (cyclomatic 18) scripts/runatal_v1_physical.py:294 — runatal_v1_physical.decode_representation 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.
D1 · Cyclomatic Complexity · WorkspaceFilesystem · ×1
  • WorkspaceFilesystem::rename_inner (cyclomatic 17) crates/astrid-storage/src/content/store/workspace/filesystem.rs:249 — WorkspaceFilesystem::rename_inner 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.
D1 · Cyclomatic Complexity · CanonicalPhysicalMap · ×1
  • CanonicalPhysicalMap::rebuild_with_entries (cyclomatic 17) crates/astrid-storage/src/storage_model/physical/map.rs:612 — CanonicalPhysicalMap::rebuild_with_entries 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.
D1 · Cyclomatic Complexity · Registry · ×1
  • Registry::install (cyclomatic 17) crates/astrid-uplink/src/native/egress.rs:208 — Registry::install 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.
D1 · Cyclomatic Complexity · changelog.roll_changelog (cyclomatic 17) · ×1
  • changelog.roll_changelog (cyclomatic 17) scripts/changelog.py:273 — changelog.roll_changelog 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.
D1 · Cyclomatic Complexity · runatal_v1_sketch.verify_sketch (cyclomatic 17) · ×1
  • runatal_v1_sketch.verify_sketch (cyclomatic 17) scripts/runatal_v1_sketch.py:160 — runatal_v1_sketch.verify_sketch 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.
D1 · Cyclomatic Complexity · astrid_build · ×1
  • astrid_build::rust::getrandom_rustflags_override (cyclomatic 16) crates/astrid-build/src/rust.rs:445 — astrid_build::rust::getrandom_rustflags_override 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.
D1 · Cyclomatic Complexity · AstridHome · ×1
  • AstridHome::ensure (cyclomatic 16) crates/astrid-core/src/dirs.rs:364 — AstridHome::ensure 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.
D1 · Cyclomatic Complexity · astrid_daemon · ×1
  • astrid_daemon::run_with_args (cyclomatic 16) crates/astrid-daemon/src/lib.rs:250 — astrid_daemon::run_with_args 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.
D1 · Cyclomatic Complexity · RouteEntry · ×1
  • RouteEntry::drr_drain (cyclomatic 16) crates/astrid-events/src/route/entry.rs:434 — RouteEntry::drr_drain 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.
D1 · Cyclomatic Complexity · ServerManager · ×1
  • ServerManager::build_sandboxed_command (cyclomatic 16) crates/astrid-mcp/src/server.rs:424 — ServerManager::build_sandboxed_command 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.
D1 · Cyclomatic Complexity · DurableEngine · ×1
  • DurableEngine::prepare (cyclomatic 16) crates/astrid-storage/src/engine/durable/engine.rs:613 — DurableEngine::prepare 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.
D1 · Cyclomatic Complexity · runatal_v1_physical.decode_fixture (cyclomatic 16) · ×1
  • runatal_v1_physical.decode_fixture (cyclomatic 16) scripts/runatal_v1_physical.py:820 — runatal_v1_physical.decode_fixture 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.
D1 · Cyclomatic Complexity · runatal_v1_physical_store.replay_state_journal (cyclomatic 16) · ×1
  • runatal_v1_physical_store.replay_state_journal (cyclomatic 16) scripts/runatal_v1_physical_store.py:122 — runatal_v1_physical_store.replay_state_journal 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.
D1 · Cyclomatic Complexity · supervised_fskit.approved_receipt (cyclomatic 16) · ×1
  • supervised_fskit.approved_receipt (cyclomatic 16) scripts/supervised_fskit.py:56 — supervised_fskit.approved_receipt 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.
D2 · Cognitive Complexity · runatal_v1_physical.validate_map (cognitive 81) · ×1
  • runatal_v1_physical.validate_map (cognitive 81) scripts/runatal_v1_physical.py:670 — runatal_v1_physical.validate_map has cognitive complexity 81 (threshold 15). Drivers by points: if/else 21 (61 pts), loops 4 (11 pts), boolean chains 9 (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · musl_release_manifest.validate_manifest (cognitive 76) · ×1
  • musl_release_manifest.validate_manifest (cognitive 76) scripts/musl_release_manifest.py:116 — musl_release_manifest.validate_manifest has cognitive complexity 76 (threshold 15). Drivers by points: if/else 28 (54 pts), boolean chains 16, loops 4 (6 pts) (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.
D2 · Cognitive Complexity · release_manifest.validate_manifest (cognitive 69) · ×1
  • release_manifest.validate_manifest (cognitive 69) scripts/release_manifest.py:221 — release_manifest.validate_manifest has cognitive complexity 69 (threshold 15). Drivers by points: if/else 26 (50 pts), boolean chains 15, loops 3 (4 pts) (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.
D2 · Cognitive Complexity · windows_release_manifest.validate_manifest (cognitive 60) · ×1
  • windows_release_manifest.validate_manifest (cognitive 60) scripts/windows_release_manifest.py:120 — windows_release_manifest.validate_manifest has cognitive complexity 60 (threshold 15). Drivers by points: if/else 27 (41 pts), boolean chains 15, loops 3 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runatal_v1_reader.recover (cognitive 59) · ×1
  • runatal_v1_reader.recover (cognitive 59) scripts/runatal_v1_reader.py:837 — runatal_v1_reader.recover has cognitive complexity 59 (threshold 15). Drivers by points: if/else 17 (33 pts), loops 6 (9 pts), ternaries 4 (7 pts), boolean chains 6, error handling 2 (4 pts) (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.
D2 · Cognitive Complexity · runatal_v1_volume.recover_volume (cognitive 53) · ×1
  • runatal_v1_volume.recover_volume (cognitive 53) scripts/runatal_v1_volume.py:135 — runatal_v1_volume.recover_volume has cognitive complexity 53 (threshold 15). Drivers by points: if/else 19 (44 pts), boolean chains 8, 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.
D2 · Cognitive Complexity · validate_macos_release.validate (cognitive 39) · ×1
  • validate_macos_release.validate (cognitive 39) scripts/validate_macos_release.py:19 — validate_macos_release.validate has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 11, error handling 1 (2 pts), loops 2, ternaries 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.
D2 · Cognitive Complexity · App · ×1
  • App::collect_copy_text (cognitive 37) crates/astrid-cli/src/tui/state.rs:1002 — App::collect_copy_text has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (28 pts), match/switch 2 (8 pts), loops 1 (nesting depth added 24). 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.
D2 · Cognitive Complexity · RouteEntry · ×1
  • RouteEntry::drr_drain (cognitive 35) crates/astrid-events/src/route/entry.rs:434 — RouteEntry::drr_drain has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 3 (6 pts), boolean chains 4 (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.
D2 · Cognitive Complexity · OwnershipSnapshot · ×1
  • OwnershipSnapshot::validate (cognitive 33) crates/astrid-storage/src/ownership.rs:161 — OwnershipSnapshot::validate has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 5 (6 pts), boolean chains 5 (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.
D2 · Cognitive Complexity · CommandHandler · ×1
  • CommandHandler::apply_env (cognitive 32) crates/astrid-hooks/src/handler/command.rs:80 — CommandHandler::apply_env has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · KernelProcessStorageMountBroker · ×1
  • KernelProcessStorageMountBroker::mount (cognitive 32) crates/astrid-kernel/src/storage_mount/process_broker/mod.rs:72 — KernelProcessStorageMountBroker::mount has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (21 pts), match/switch 7 (9 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.
D2 · Cognitive Complexity · KvHotCache · ×1
  • KvHotCache::insert_bounded (cognitive 32) crates/astrid-storage/src/kv/tree/hot_cache.rs:487 — KvHotCache::insert_bounded has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 5 (7 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · runatal_v1_physical.decode_map_node (cognitive 32) · ×1
  • runatal_v1_physical.decode_map_node (cognitive 32) scripts/runatal_v1_physical.py:365 — runatal_v1_physical.decode_map_node has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · channel_metadata.validate_channel (cognitive 31) · ×1
  • channel_metadata.validate_channel (cognitive 31) scripts/channel_metadata.py:137 — channel_metadata.validate_channel has cognitive complexity 31 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 7, loops 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.
D2 · Cognitive Complexity · OverlayVfs · ×1
  • OverlayVfs::open (cognitive 29) crates/astrid-vfs/src/overlay.rs:354 — OverlayVfs::open has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (28 pts), boolean chains 1 (nesting depth added 17). 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.
D2 · Cognitive Complexity · changelog.roll_changelog (cognitive 28) · ×1
  • changelog.roll_changelog (cognitive 28) scripts/changelog.py:273 — changelog.roll_changelog has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (25 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.
D2 · Cognitive Complexity · validate_release_archive.validate (cognitive 28) · ×1
  • validate_release_archive.validate (cognitive 28) scripts/validate_release_archive.py:36 — validate_release_archive.validate has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 8, error handling 1 (2 pts), loops 2, ternaries 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.
D2 · Cognitive Complexity · CapsuleWatcher · ×1
  • CapsuleWatcher::run (cognitive 26) crates/astrid-capsule/src/watcher.rs:133 — CapsuleWatcher::run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 4 (10 pts), loops 3 (5 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeUplink · ×1
  • NativeUplink::run (cognitive 26) crates/astrid-uplink/src/native/mod.rs:204 — NativeUplink::run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 4 (9 pts), loops 3 (4 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · supervised_fskit.approved_receipt (cognitive 25) · ×1
  • supervised_fskit.approved_receipt (cognitive 25) scripts/supervised_fskit.py:56 — supervised_fskit.approved_receipt has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 3, error handling 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.
D2 · Cognitive Complexity · McpHostEngine · ×1
  • McpHostEngine::load (cognitive 24) crates/astrid-capsule/src/engine/mcp.rs:95 — McpHostEngine::load has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 3 (nesting depth added 11). 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.
D2 · Cognitive Complexity · BusKernelClient · ×1
  • BusKernelClient::request (cognitive 24) crates/astrid-gateway/src/bus_kernel.rs:94 — BusKernelClient::request has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 2 (5 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.
D2 · Cognitive Complexity · runatal_v1_sketch.source_chunks (cognitive 24) · ×1
  • runatal_v1_sketch.source_chunks (cognitive 24) scripts/runatal_v1_sketch.py:124 — runatal_v1_sketch.source_chunks has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (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.
D2 · Cognitive Complexity · BusAdminClient · ×1
  • BusAdminClient::request (cognitive 23) crates/astrid-gateway/src/bus_admin.rs:112 — BusAdminClient::request has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 4 (9 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.
D2 · Cognitive Complexity · astrid_vfs · ×1
  • astrid_vfs::workspace_cow::overlayfs::copy_upper_into_lower (cognitive 23) crates/astrid-vfs/src/workspace_cow/overlayfs.rs:280 — astrid_vfs::workspace_cow::overlayfs::copy_upper_into_lower has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · crate_publication.publication_order (cognitive 23) · ×1
  • crate_publication.publication_order (cognitive 23) scripts/crate_publication.py:19 — crate_publication.publication_order has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 6 (9 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.
D2 · Cognitive Complexity · ManifestSecurityGate · ×1
  • ManifestSecurityGate::check_fs_permission (cognitive 22) crates/astrid-capsule/src/security/manifest_gate.rs:150 — ManifestSecurityGate::check_fs_permission has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 7 (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.
D2 · Cognitive Complexity · LegacyContext · ×1
  • LegacyContext::validate (cognitive 22) crates/astrid-storage/src/kv/tree/legacy_avl.rs:155 — LegacyContext::validate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, match/switch 1 (3 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.
D2 · Cognitive Complexity · World · ×1
  • World::publish_placement_epoch (cognitive 22) crates/astrid-storage/src/storage_model/world.rs:368 — World::publish_placement_epoch has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (5 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.
D2 · Cognitive Complexity · astrid_storage_provider_fskit · ×1
  • astrid_storage_provider_fskit::service::service_loop (cognitive 22) crates/astrid-storage-provider-fskit/src/service.rs:265 — astrid_storage_provider_fskit::service::service_loop has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 4 (14 pts), if/else 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 14). 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.
D2 · Cognitive Complexity · Registry · ×1
  • Registry::install (cognitive 22) crates/astrid-uplink/src/native/egress.rs:208 — Registry::install has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 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.
D2 · Cognitive Complexity · runatal_v1_kv.decode_leaf (cognitive 22) · ×1
  • runatal_v1_kv.decode_leaf (cognitive 22) scripts/runatal_v1_kv.py:137 — runatal_v1_kv.decode_leaf has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · runatal_v1_kv.decode_v4 (cognitive 22) · ×1
  • runatal_v1_kv.decode_v4 (cognitive 22) scripts/runatal_v1_kv.py:284 — runatal_v1_kv.decode_v4 has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (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.
D2 · Cognitive Complexity · runatal_v1_sha384.verify_attestation (cognitive 22) · ×1
  • runatal_v1_sha384.verify_attestation (cognitive 22) scripts/runatal_v1_sha384.py:453 — runatal_v1_sha384.verify_attestation has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 5, loops 3 (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.
D2 · Cognitive Complexity · ServerManager · ×1
  • ServerManager::build_sandboxed_command (cognitive 21) crates/astrid-mcp/src/server.rs:424 — ServerManager::build_sandboxed_command has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 5 (6 pts), boolean chains 2, match/switch 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.
D2 · Cognitive Complexity · StateOwnerResolver · ×1
  • StateOwnerResolver::resolve (cognitive 21) crates/astrid-storage/src/principal_state.rs:289 — StateOwnerResolver::resolve has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 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.
D2 · Cognitive Complexity · runatal_v1_kv.decode_legacy_node (cognitive 21) · ×1
  • runatal_v1_kv.decode_legacy_node (cognitive 21) scripts/runatal_v1_kv.py:323 — runatal_v1_kv.decode_legacy_node has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8, ternaries 8, boolean chains 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.
D2 · Cognitive Complexity · runatal_v1_physical_store.validate_direct_arena (cognitive 21) · ×1
  • runatal_v1_physical_store.validate_direct_arena (cognitive 21) scripts/runatal_v1_physical_store.py:285 — runatal_v1_physical_store.validate_direct_arena has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, error handling 1 (2 pts), 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.
D2 · Cognitive Complexity · AuthorityInner · ×1
  • AuthorityInner::recompute_logical_targets (cognitive 20) crates/astrid-storage/src/resources/authority/state.rs:269 — AuthorityInner::recompute_logical_targets has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 4 (7 pts), boolean chains 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.
D2 · Cognitive Complexity · AdminClient · ×1
  • AdminClient::send_and_wait (cognitive 20) crates/astrid-uplink/src/admin_client.rs:173 — AdminClient::send_and_wait has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (6 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.
D2 · Cognitive Complexity · runatal_v1_kv.decode_delta (cognitive 20) · ×1
  • runatal_v1_kv.decode_delta (cognitive 20) scripts/runatal_v1_kv.py:237 — runatal_v1_kv.decode_delta has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, ternaries 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.
D2 · Cognitive Complexity · Writer · ×1
  • Writer::next_work (cognitive 18) crates/astrid-kernel/src/audit_sink/writer.rs:214 — Writer::next_work has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · WorkspaceFilesystem · ×1
  • WorkspaceFilesystem::rename_inner (cognitive 18) crates/astrid-storage/src/content/store/workspace/filesystem.rs:249 — WorkspaceFilesystem::rename_inner has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 4 (8 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ObjectCache · ×1
  • ObjectCache::insert (cognitive 18) crates/astrid-storage/src/engine/durable_cache/mod.rs:193 — ObjectCache::insert has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runatal_v1_kv.decode_branch (cognitive 18) · ×1
  • runatal_v1_kv.decode_branch (cognitive 18) scripts/runatal_v1_kv.py:176 — runatal_v1_kv.decode_branch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, loops 2, ternaries 1 (2 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.
D2 · Cognitive Complexity · runatal_v1_physical_store.replay_state_journal (cognitive 18) · ×1
  • runatal_v1_physical_store.replay_state_journal (cognitive 18) scripts/runatal_v1_physical_store.py:122 — runatal_v1_physical_store.replay_state_journal has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkspaceBranchService · ×1
  • WorkspaceBranchService::cleanup_orphaned (cognitive 17) crates/astrid-capsule/src/context.rs:520 — WorkspaceBranchService::cleanup_orphaned has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (8 pts), if/else 3 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · astrid_storage_chunker_evidence · ×1
  • astrid_storage_chunker_evidence::corpus::measure_reader (cognitive 17) crates/astrid-storage-chunker-evidence/src/corpus.rs:325 — astrid_storage_chunker_evidence::corpus::measure_reader has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · release_publication.validate_release_assets (cognitive 17) · ×1
  • release_publication.validate_release_assets (cognitive 17) scripts/release_publication.py:32 — release_publication.validate_release_assets has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (6 pts), if/else 4 (5 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runatal_v1_physical.decode_fixture (cognitive 17) · ×1
  • runatal_v1_physical.decode_fixture (cognitive 17) scripts/runatal_v1_physical.py:820 — runatal_v1_physical.decode_fixture has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 2 (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.
D2 · Cognitive Complexity · runatal_v1_reader.decode_tree (cognitive 17) · ×1
  • runatal_v1_reader.decode_tree (cognitive 17) scripts/runatal_v1_reader.py:243 — runatal_v1_reader.decode_tree has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 7, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AllowancePattern · ×1
  • AllowancePattern::matches (cognitive 16) crates/astrid-approval/src/allowance/pattern.rs:119 — AllowancePattern::matches has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 3). 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.
D2 · Cognitive Complexity · CapsuleRegistry · ×1
  • CapsuleRegistry::unregister_for (cognitive 16) crates/astrid-capsule/src/registry.rs:471 — CapsuleRegistry::unregister_for has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExecutionAllocation · ×1
  • ExecutionAllocation::reserve_when_available (cognitive 16) crates/astrid-capsule/src/user_cpu/execution.rs:108 — ExecutionAllocation::reserve_when_available has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (12 pts), boolean chains 2, if/else 1, loops 1 (nesting depth added 7). 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.
D2 · Cognitive Complexity · DurableInviteStore · ×1
  • DurableInviteStore::ensure_legacy_import (cognitive 16) crates/astrid-kernel/src/invite/mod.rs:199 — DurableInviteStore::ensure_legacy_import has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 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.
D2 · Cognitive Complexity · DurablePairTokenStore · ×1
  • DurablePairTokenStore::ensure_legacy_import (cognitive 16) crates/astrid-kernel/src/pair_token/mod.rs:212 — DurablePairTokenStore::ensure_legacy_import has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 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.
D2 · Cognitive Complexity · ResidentMemoryAuthority · ×1
  • ResidentMemoryAuthority::register_principal (cognitive 16) crates/astrid-storage/src/resources/authority.rs:60 — ResidentMemoryAuthority::register_principal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Subscription · ×1
  • Subscription::human_reply_owner (cognitive 16) crates/astrid-uplink/src/native/egress.rs:383 — Subscription::human_reply_owner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · bench_daemon_boot.current_boot_records (cognitive 16) · ×1
  • bench_daemon_boot.current_boot_records (cognitive 16) scripts/bench_daemon_boot.py:22 — bench_daemon_boot.current_boot_records has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 1 (3 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.
D2 · Cognitive Complexity · check_dco.check_commits (cognitive 16) · ×1
  • check_dco.check_commits (cognitive 16) scripts/check_dco.py:38 — check_dco.check_commits has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · runatal_v1_physical.decode_representation (cognitive 16) · ×1
  • runatal_v1_physical.decode_representation (cognitive 16) scripts/runatal_v1_physical.py:294 — runatal_v1_physical.decode_representation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · runatal_v1_reader.validate_runtime_profile (cognitive 16) · ×1
  • runatal_v1_reader.validate_runtime_profile (cognitive 16) scripts/runatal_v1_reader.py:482 — runatal_v1_reader.validate_runtime_profile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · runatal_v1_sketch.verify_sketch (cognitive 16) · ×1
  • runatal_v1_sketch.verify_sketch (cognitive 16) scripts/runatal_v1_sketch.py:160 — runatal_v1_sketch.verify_sketch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (98 shared lines) · ×1
  • Near-duplicate member pair (98 shared lines) crates/astrid-cli-mockup/src/ui/render.rs:447 — crates/astrid-cli-mockup/src/ui/render.rs:447-564 | crates/astrid-cli/src/tui/render.rs:702-892 — These two members are variants of one another: 98 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (64 shared lines) · ×1
  • Near-duplicate member pair (64 shared lines) crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:184 — crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:184-389 | crates/astrid-capsule/src/engine/wasm/host/process/mod.rs:394-645 — These two members are variants of one another: 64 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (59 shared lines) · ×1
  • Near-duplicate member pair (59 shared lines) crates/astrid-kernel/src/invite/mod.rs:202 — crates/astrid-kernel/src/invite/mod.rs:202-288 | crates/astrid-kernel/src/pair_token/mod.rs:216-316 — These two members are variants of one another: 59 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (36 shared lines) · ×1
  • Near-duplicate member pair (36 shared lines) crates/astrid-storage/src/principal_state/volume_migration.rs:101 — crates/astrid-storage/src/principal_state/volume_migration.rs:101-158 | crates/astrid-storage/src/principal_state/volume_migration.rs:181-253 — 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.
D4 · Code Duplication · Near-duplicate member pair (28 shared lines) · ×1
  • Near-duplicate member pair (28 shared lines) crates/astrid-cli/src/commands/ps.rs:38 — crates/astrid-cli/src/commands/ps.rs:38-126 | crates/astrid-cli/src/commands/who.rs:47-143 — These two members are variants of one another: 28 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (20 shared lines) · ×1
  • Near-duplicate member pair (20 shared lines) crates/astrid-storage/src/kv/surreal.rs:358 — crates/astrid-storage/src/kv/surreal.rs:358-385 | crates/astrid-storage/src/kv/surreal.rs:387-417 — These two members are variants of one another: 20 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×1
  • Edited copy of a member (13 corresponding lines) scripts/musl_release_manifest.py:300 — scripts/musl_release_manifest.py:300-312 | scripts/windows_release_manifest.py:278-290 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) crates/astrid-kernel/src/invite/mod.rs:367 — crates/astrid-kernel/src/invite/mod.rs:367-418 | crates/astrid-kernel/src/invite/mod.rs:425-441 | crates/astrid-kernel/src/invite/mod.rs:449-479 | crates/astrid-kernel/src/pair_token/durable_reservation.rs:197-230 | crates/astrid-kernel/src/pair_token/durable_reservation.rs:239-296 | crates/astrid-kernel/src/pair_token/mod.rs:399-436 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Duplicated block (47–49 lines × 2) · ×1
  • Duplicated block (47–49 lines × 2) crates/astrid-core/src/local_transport/windows/acl.rs:255 — crates/astrid-core/src/local_transport/windows/acl.rs:255-301 | crates/astrid-core/src/platform_fs/windows/acl/ace.rs:172-220 — before extracting anything, compare `crates/astrid-core/src/local_transport/windows/acl.rs` and `crates/astrid-core/src/platform_fs/windows/acl/ace.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 108 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.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×1
  • Duplicated block (38 lines × 2) crates/astrid-storage-provider-fskit/src/main.rs:131 — crates/astrid-storage-provider-fskit/src/main.rs:131-168 | crates/astrid-storage-provider-winfsp/src/main.rs:140-177 — before extracting anything, compare `crates/astrid-storage-provider-fskit/src/main.rs` and `crates/astrid-storage-provider-winfsp/src/main.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 133 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.
D4 · Code Duplication · Duplicated block (34–36 lines × 2) · ×1
  • Duplicated block (34–36 lines × 2) crates/astrid-core/src/platform_fs/windows/acl.rs:57 — crates/astrid-core/src/platform_fs/windows/acl.rs:57-92 | crates/astrid-core/src/platform_fs/windows/acl.rs:346-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.
D4 · Code Duplication · Duplicated block (32–34 lines × 2) · ×1
  • Duplicated block (32–34 lines × 2) crates/astrid-gateway/src/revocations.rs:130 — crates/astrid-gateway/src/revocations.rs:130-163 | crates/astrid-gateway/src/revocations.rs:196-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.
D4 · Code Duplication · Duplicated block (24–32 lines × 2) · ×1
  • Duplicated block (24–32 lines × 2) crates/astrid-capsule/src/engine/wasm/mod.rs:552 — crates/astrid-capsule/src/engine/wasm/mod.rs:552-575 | crates/astrid-capsule/src/engine/wasm/mod.rs:600-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.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×1
  • Duplicated block (31 lines × 2) crates/astrid-cli-mockup/src/ui/render.rs:141 — crates/astrid-cli-mockup/src/ui/render.rs:141-171 | crates/astrid-cli/src/tui/render.rs:170-200 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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.
D4 · Code Duplication · Duplicated block (26–29 lines × 2) · ×1
  • Duplicated block (26–29 lines × 2) crates/astrid-cli-mockup/src/ui/views/log.rs:90 — crates/astrid-cli-mockup/src/ui/views/log.rs:90-115 | crates/astrid-cli-mockup/src/ui/views/nexus.rs:72-100 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/views/log.rs` and `crates/astrid-cli-mockup/src/ui/views/nexus.rs` as WHOLE FILES: this scan already matched 3 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.
D4 · Code Duplication · Duplicated block (25–29 lines × 2) · ×1
  • Duplicated block (25–29 lines × 2) crates/astrid-core/src/groups/io_impl.rs:81 — crates/astrid-core/src/groups/io_impl.rs:81-105 | crates/astrid-core/src/profile/io_impl.rs:130-158 — `crates/astrid-core/src/groups/io_impl.rs` and `crates/astrid-core/src/profile/io_impl.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 4 separate duplicated blocks between them, totalling at least 58 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.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) crates/astrid-core/src/dirs_layout_retirement.rs:347 — crates/astrid-core/src/dirs_layout_retirement.rs:347-373 | crates/astrid-core/src/runtime_scratch.rs:210-236 — before extracting anything, compare `crates/astrid-core/src/dirs_layout_retirement.rs` and `crates/astrid-core/src/runtime_scratch.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 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.
D4 · Code Duplication · Duplicated block (25–26 lines × 2) · ×1
  • Duplicated block (25–26 lines × 2) crates/astrid-cli-mockup/src/ui/render.rs:496 — crates/astrid-cli-mockup/src/ui/render.rs:496-521 | crates/astrid-cli/src/tui/render.rs:748-772 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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.
D4 · Code Duplication · Duplicated block (24–25 lines × 3) · ×1
  • Duplicated block (24–25 lines × 3) crates/astrid-core/src/platform_fs/windows/acl.rs:469 — crates/astrid-core/src/platform_fs/windows/acl.rs:469-492 | crates/astrid-core/src/platform_fs/windows/acl.rs:602-626 | crates/astrid-core/src/platform_fs/windows/acl.rs:689-712 — 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.
D4 · Code Duplication · Duplicated block (24–25 lines × 2) · ×1
  • Duplicated block (24–25 lines × 2) crates/astrid-audit/src/storage/append.rs:546 — crates/astrid-audit/src/storage/append.rs:546-569 | crates/astrid-audit/src/storage/append_batch.rs:424-448 — before extracting anything, compare `crates/astrid-audit/src/storage/append.rs` and `crates/astrid-audit/src/storage/append_batch.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 56 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.
D4 · Code Duplication · Duplicated block (11–25 lines × 2) · ×1
  • Duplicated block (11–25 lines × 2) crates/astrid-cli-mockup/src/ui/render.rs:1018 — crates/astrid-cli-mockup/src/ui/render.rs:1018-1028 | crates/astrid-cli/src/tui/render.rs:1567-1591 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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.
D4 · Code Duplication · Duplicated block (23–25 lines × 2) · ×1
  • Duplicated block (23–25 lines × 2) crates/astrid-gateway/src/routes/auth.rs:106 — crates/astrid-gateway/src/routes/auth.rs:106-130 | crates/astrid-gateway/src/routes/auth.rs:379-401 — 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.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×1
  • Duplicated block (22 lines × 2) crates/astrid-capsule-install/src/archive.rs:341 — crates/astrid-capsule-install/src/archive.rs:341-362 | crates/astrid-capsule-install/src/local.rs:507-528 — before extracting anything, compare `crates/astrid-capsule-install/src/archive.rs` and `crates/astrid-capsule-install/src/local.rs` as WHOLE FILES: this scan already matched 4 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. 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.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) crates/astrid-core/src/local_transport/windows/acl.rs:316 — crates/astrid-core/src/local_transport/windows/acl.rs:316-336 | crates/astrid-core/src/platform_fs/windows/acl/ace.rs:237-258 — before extracting anything, compare `crates/astrid-core/src/local_transport/windows/acl.rs` and `crates/astrid-core/src/platform_fs/windows/acl/ace.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 108 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.
D4 · Code Duplication · Duplicated block (15–21 lines × 2) · ×1
  • Duplicated block (15–21 lines × 2) crates/astrid-capsule/src/engine/wasm/host/ipc.rs:668 — crates/astrid-capsule/src/engine/wasm/host/ipc.rs:668-688 | crates/astrid-capsule/src/engine/wasm/host/ipc.rs:764-778 — 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.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) crates/astrid-cli-mockup/src/ui/render.rs:458 — crates/astrid-cli-mockup/src/ui/render.rs:458-478 | crates/astrid-cli/src/tui/render.rs:710-729 — before extracting anything, compare `crates/astrid-cli-mockup/src/ui/render.rs` and `crates/astrid-cli/src/tui/render.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 345 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.
D4 · Code Duplication · Duplicated block (20 lines × 4) · ×1
  • Duplicated block (20 lines × 4) crates/astrid-telemetry/src/logging.rs:360 — crates/astrid-telemetry/src/logging.rs:360-379 | crates/astrid-telemetry/src/logging.rs:389-408 | crates/astrid-telemetry/src/logging.rs:418-437 | crates/astrid-telemetry/src/logging.rs:446-465 — 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.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) crates/astrid-capsule/src/engine/wasm/host/net/handshake.rs:236 — crates/astrid-capsule/src/engine/wasm/host/net/handshake.rs:236-255 | crates/astrid-uplink/src/native/handshake.rs:175-193 — before extracting anything, compare `crates/astrid-capsule/src/engine/wasm/host/net/handshake.rs` and `crates/astrid-uplink/src/native/handshake.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 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.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×1
  • Duplicated block (16–18 lines × 2) crates/astrid-core/src/dirs_layout.rs:165 — crates/astrid-core/src/dirs_layout.rs:165-180 | crates/astrid-core/src/dirs_layout.rs:220-237 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12–18 lines × 2) · ×1
  • Duplicated block (12–18 lines × 2) crates/astrid-kernel/src/kernel_router/admin/invite_handlers.rs:139 — crates/astrid-kernel/src/kernel_router/admin/invite_handlers.rs:139-150 | crates/astrid-kernel/src/kernel_router/admin/invite_handlers.rs:358-375 — 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.
D4 · Code Duplication · Duplicated block (6–16 lines × 2) · ×1
  • Duplicated block (6–16 lines × 2) crates/astrid-capsule/src/engine/wasm/host/net/mod.rs:488 — crates/astrid-capsule/src/engine/wasm/host/net/mod.rs:488-493 | crates/astrid-capsule/src/engine/wasm/host/net/mod.rs:841-856 — 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.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×1
  • Duplicated block (14 lines × 3) crates/astrid-build/src/rust.rs:473 — crates/astrid-build/src/rust.rs:473-486 | crates/astrid-build/src/rust.rs:491-504 | crates/astrid-build/src/rust.rs:508-521 — 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) crates/astrid-cli/src/commands/capsule/install_update.rs:215 — crates/astrid-cli/src/commands/capsule/install_update.rs:215-227 | crates/astrid-cli/src/commands/capsule/install_update.rs:312-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.
D4 · Code Duplication · Duplicated block (8–13 lines × 2) · ×1
  • Duplicated block (8–13 lines × 2) crates/astrid-events/src/route/entry.rs:381 — crates/astrid-events/src/route/entry.rs:381-393 | crates/astrid-events/src/route/entry.rs:528-535 — 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.
D4 · Code Duplication · Duplicated block (9–13 lines × 2) · ×1
  • Duplicated block (9–13 lines × 2) crates/astrid-hooks/src/discovery.rs:143 — crates/astrid-hooks/src/discovery.rs:143-155 | crates/astrid-hooks/src/discovery.rs:163-171 — 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.
D4 · Code Duplication · Duplicated block (9–11 lines × 3) · ×1
  • Duplicated block (9–11 lines × 3) crates/astrid-capsule/src/engine/wasm/host/identity.rs:31 — crates/astrid-capsule/src/engine/wasm/host/identity.rs:31-41 | crates/astrid-capsule/src/engine/wasm/host/identity.rs:102-110 | crates/astrid-capsule/src/engine/wasm/host/identity.rs:136-144 — 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.
D4 · Code Duplication · Duplicated block (9–10 lines × 3) · ×1
  • Duplicated block (9–10 lines × 3) crates/astrid-capsule/src/engine/wasm/host/approval.rs:323 — crates/astrid-capsule/src/engine/wasm/host/approval.rs:323-331 | crates/astrid-capsule/src/engine/wasm/host/consent_egress.rs:288-296 | crates/astrid-capsule/src/engine/wasm/host/elicit.rs:143-152 — 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 6) · ×1
  • Duplicated block (8–9 lines × 6) crates/astrid-kernel/src/pair_token/durable_reservation.rs:204 — crates/astrid-kernel/src/pair_token/durable_reservation.rs:204-211 | crates/astrid-kernel/src/pair_token/durable_reservation.rs:221-229 | crates/astrid-kernel/src/pair_token/durable_reservation.rs:256-263 | crates/astrid-kernel/src/pair_token/durable_reservation.rs:282-289 | crates/astrid-kernel/src/pair_token/mod.rs:409-416 | crates/astrid-kernel/src/pair_token/mod.rs:422-429 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (8–9 lines × 4) · ×1
  • Duplicated block (8–9 lines × 4) crates/astrid-storage/src/engine/durable/native_io.rs:132 — crates/astrid-storage/src/engine/durable/native_io.rs:132-140 | crates/astrid-storage/src/engine/durable/representations/contiguous/namespace.rs:174-182 | crates/astrid-storage/src/principal_state/native_io.rs:501-508 | crates/astrid-storage/src/principal_state/native_io.rs:666-673 — before extracting anything, compare `crates/astrid-storage/src/engine/durable/native_io.rs` and `crates/astrid-storage/src/engine/durable/representations/contiguous/namespace.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 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.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×1
  • Duplicated block (7 lines × 4) crates/astrid-cli-mockup/src/ui/views/pulse.rs:59 — crates/astrid-cli-mockup/src/ui/views/pulse.rs:59-65 | crates/astrid-cli-mockup/src/ui/views/pulse.rs:119-125 | crates/astrid-cli-mockup/src/ui/views/pulse.rs:182-188 | crates/astrid-cli-mockup/src/ui/views/pulse.rs:228-234 — 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.
D4 · Code Duplication · Duplicated block (6–7 lines × 3) · ×1
  • Duplicated block (6–7 lines × 3) crates/astrid-storage/src/kv/surreal.rs:239 — crates/astrid-storage/src/kv/surreal.rs:239-245 | crates/astrid-storage/src/kv/surreal.rs:270-276 | crates/astrid-storage/src/kv/surreal.rs:303-308 — 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.
D4 · Code Duplication · Duplicated block (5–6 lines × 7) · ×1
  • Duplicated block (5–6 lines × 7) crates/astrid-core/src/dirs_layout_retirement.rs:14 — crates/astrid-core/src/dirs_layout_retirement.rs:14-19 | crates/astrid-core/src/dirs_layout_retirement.rs:99-103 | crates/astrid-core/src/runtime_scratch.rs:19-24 | crates/astrid-core/src/runtime_scratch.rs:106-110 | crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:161-166 | crates/astrid-kernel/src/legacy_migration_barrier/legacy_tmp.rs:39-44 | crates/astrid-kernel/src/principal_home_migration/unbound.rs:35-40 — before extracting anything, compare `crates/astrid-core/src/dirs_layout_retirement.rs` and `crates/astrid-core/src/runtime_scratch.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 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.
D4 · Code Duplication · Duplicated block (5–6 lines × 2) · ×1
  • Duplicated block (5–6 lines × 2) crates/astrid-cli/src/commands/mcp/lifecycle.rs:188 — crates/astrid-cli/src/commands/mcp/lifecycle.rs:188-192 | crates/astrid-cli/src/commands/mcp/lifecycle.rs:330-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.
D4 · Code Duplication · Duplicated block (5 lines × 6) · ×1
  • Duplicated block (5 lines × 6) crates/astrid-core/src/dirs_layout_retirement.rs:11 — crates/astrid-core/src/dirs_layout_retirement.rs:11-15 | crates/astrid-core/src/dirs_layout_retirement.rs:96-100 | crates/astrid-core/src/dirs_layout_retirement.rs:268-272 | crates/astrid-core/src/runtime_scratch.rs:16-20 | crates/astrid-core/src/runtime_scratch.rs:103-107 | crates/astrid-core/src/workspace_security.rs:301-305 — before extracting anything, compare `crates/astrid-core/src/dirs_layout_retirement.rs` and `crates/astrid-core/src/runtime_scratch.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 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.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) crates/astrid-gateway/src/routes/principals.rs:141 — crates/astrid-gateway/src/routes/principals.rs:141-145 | crates/astrid-gateway/src/routes/principals.rs:219-223 | crates/astrid-gateway/src/routes/principals.rs:484-488 | crates/astrid-gateway/src/routes/principals.rs:527-531 — 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.
D4 · Code Duplication · Duplicated block (3–5 lines × 3) · ×1
  • Duplicated block (3–5 lines × 3) crates/astrid-core/src/identity/ownership.rs:172 — crates/astrid-core/src/identity/ownership.rs:172-176 | crates/astrid-core/src/identity/ownership.rs:274-276 | crates/astrid-core/src/identity/principal.rs:181-185 — before extracting anything, compare `crates/astrid-core/src/identity/ownership.rs` and `crates/astrid-core/src/identity/principal.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 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.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) crates/astrid-cli/src/commands/capsule/install_daemon.rs:420 — crates/astrid-cli/src/commands/capsule/install_daemon.rs:420-425 | crates/astrid-cli/src/commands/update_channel.rs:300-305 | crates/astrid-cli/src/commands/update_channel.rs:307-312 | crates/astrid-kernel/src/kernel_router/resume_receipt.rs:143-148 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×1
  • Duplicated block (13 lines × 3) crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:185 — crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:185-197 | crates/astrid-kernel/src/legacy_migration_barrier/mod.rs:916-928 | crates/astrid-kernel/src/legacy_migration_barrier/mod.rs:953-965 — 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.
D4 · Code Duplication · Duplicated block (7 lines × 9) · ×1
  • Duplicated block (7 lines × 9) crates/astrid-core/src/dirs_layout_retirement.rs:15 — crates/astrid-core/src/dirs_layout_retirement.rs:15-24 | crates/astrid-core/src/dirs_layout_retirement.rs:100-106 | crates/astrid-core/src/runtime_scratch.rs:20-29 | crates/astrid-core/src/runtime_scratch.rs:107-113 | crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:162-171 | crates/astrid-kernel/src/legacy_migration_barrier/host_fs.rs:217-226 | crates/astrid-kernel/src/legacy_migration_barrier/ledger.rs:857-866 | crates/astrid-kernel/src/legacy_migration_barrier/legacy_tmp.rs:40-49 | crates/astrid-kernel/src/principal_home_migration/unbound.rs:36-45 — before extracting anything, compare `crates/astrid-core/src/dirs_layout_retirement.rs` and `crates/astrid-core/src/runtime_scratch.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 80 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.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×1
  • Duplicated block (13–15 lines × 2) scripts/changelog.py:309 — scripts/changelog.py:309-323 | scripts/changelog.py:328-340 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `scripts/changelog.py:309` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×1
  • Duplicated block (5 lines × 5) scripts/musl_release_manifest.py:45 — scripts/musl_release_manifest.py:45-49 | scripts/oci_export_binding.py:28-32 | scripts/oci_release.py:55-59 | scripts/release_publication.py:25-29 | scripts/windows_release_manifest.py:49-53 — before extracting anything, compare `scripts/musl_release_manifest.py` and `scripts/windows_release_manifest.py` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `path` to `pathlib.Path` in one and `Path` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D44 · Platform End-of-Life · End-of-life runtime · ×1
  • End-of-life runtime: Rust 1.95 rust-toolchain.toml:1 — rust-toolchain.toml declares Rust 1.95 as this project's toolchain file, and Rust 1.95, superseded by 1.96 on 2026-05-28 (the Rust project patches only the current stable). An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2026-05-28 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
D5 · Coupling · Unstable project astrid-gateway · ×1
  • Unstable project astrid-gateway — astrid-gateway has instability 0.89 with 1 dependents.
D5 · Coupling · Unstable project astrid-hooks · ×1
  • Unstable project astrid-hooks — astrid-hooks has instability 0.88 with 1 dependents.
D5 · Coupling · Unstable project astrid-kernel · ×1
  • Unstable project astrid-kernel — astrid-kernel has instability 0.93 with 1 dependents.
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 scripts/check_dco.py:25 — `check_commits` is public, takes a document from its caller (line 38) and hands it to `_flatten_commits`, which calls itself at line 25 (`_flatten_commits`) with a piece of `payload` — and nowhere in `_flatten_commits` 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. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_flatten_commits` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Minor — 96 finding(s)
X4 · Structured logging · Interpolated log message defeats structured logging · ×40
  • Interpolated log message defeats structured logging crates/astrid-workspace/src/worktree.rs:79 — `error!` at line 79 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-workspace/src/worktree.rs:85 — `info!` at line 85 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-workspace/src/worktree.rs:109 — `debug!` at line 109 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-workspace/src/worktree.rs:137 — `info!` at line 137 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-workspace/src/worktree.rs:139 — `error!` at line 139 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-workspace/src/worktree.rs:162 — `info!` at line 162 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-workspace/src/worktree.rs:168 — `error!` at line 168 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-workspace/src/worktree.rs:174 — `error!` at line 174 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-vfs/src/boundary.rs:57 — `error!` at line 57 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-vfs/src/host.rs:104 — `error!` at line 104 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-kernel/src/lib.rs:3153 — `warn!` at line 3153 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-config/src/merge/enforce.rs:19 — `warn!` at line 19 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-config/src/merge/enforce.rs:41 — `warn!` at line 41 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-config/src/merge/enforce.rs:60 — `warn!` at line 60 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-config/src/merge/enforce.rs:79 — `warn!` at line 79 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-config/src/merge/enforce.rs:109 — `warn!` at line 109 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-config/src/merge/enforce.rs:141 — `warn!` at line 141 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-config/src/merge/enforce.rs:160 — `warn!` at line 160 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-config/src/merge/enforce.rs:200 — `warn!` at line 200 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-config/src/merge/path.rs:24 — `warn!` at line 24 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-config/src/merge/servers.rs:44 — `warn!` at line 44 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-config/src/merge/servers.rs:52 — `warn!` at line 52 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-config/src/merge/servers.rs:71 — `warn!` at line 71 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-config/src/merge/servers.rs:79 — `warn!` at line 79 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • Interpolated log message defeats structured logging crates/astrid-cli/src/tui/mod.rs:449 — `warn!` at line 449 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
  • + 15 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate scripts/musl_release_manifest.py:159 — `"-nightly." in version and nightly_commit is None` appears character-identically in 3 files — scripts/musl_release_manifest.py, scripts/release_manifest.py, scripts/windows_release_manifest.py. 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 scripts/validate_macos_release.py:20 — `archive_path.is_symlink() or not archive_path.is_file()` appears character-identically in 2 files — scripts/validate_macos_release.py, scripts/validate_release_archive.py. 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 scripts/musl_release_manifest.py:322 — `args.verify_artifacts or args.require_bundles` appears character-identically in 3 files — scripts/musl_release_manifest.py, scripts/release_manifest.py, scripts/windows_release_manifest.py. 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 scripts/release_draft_recovery.py:23 — `directory.is_dir() and not directory.is_symlink()` appears character-identically in 2 files — scripts/release_draft_recovery.py, scripts/release_publication.py. 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 scripts/musl_release_manifest.py:200 — `entry["asset"] != asset or entry["sigstore-bundle"] != f"{asset}.sigstore.json"` appears character-identically in 3 files — scripts/musl_release_manifest.py, scripts/release_manifest.py, scripts/windows_release_manifest.py. 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 scripts/oci_export_binding.py:104 — `isinstance(size, int) and not isinstance(size, bool) and size > 0` appears character-identically in 2 files — scripts/oci_export_binding.py, scripts/oci_release.py. 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 scripts/musl_release_manifest.py:249 — `legacy_manifest_blake3 is None or legacy["metadata-blake3"] != legacy_manifest_blake3` appears character-identically in 2 files — scripts/musl_release_manifest.py, scripts/windows_release_manifest.py. 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 scripts/oci_export_binding.py:65 — `member.isdir() and member.name.endswith("/")` appears character-identically in 2 files — scripts/oci_export_binding.py, scripts/oci_release.py. 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 scripts/musl_release_manifest.py:161 — `nightly_commit is not None and nightly_commit != data["source-commit"]` appears character-identically in 2 files — scripts/musl_release_manifest.py, scripts/windows_release_manifest.py. 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 scripts/runatal_v1_physical.py:62 — `not algorithm or not construction or not length` appears character-identically in 4 files — scripts/runatal_v1_physical.py, scripts/runatal_v1_reader.py, scripts/runatal_v1_sha384.py, scripts/runatal_v1_sketch.py. 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 scripts/musl_release_manifest.py:231 — `not bundle.is_file() or bundle.is_symlink()` appears character-identically in 3 files — scripts/musl_release_manifest.py, scripts/release_manifest.py, scripts/windows_release_manifest.py. 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 scripts/musl_release_manifest.py:154 — `not isinstance(data["source-commit"], str) or release_manifest.COMMIT.fullmatch(data["source-commit"]) is None` appears character-identically in 2 files — scripts/musl_release_manifest.py, scripts/windows_release_manifest.py. 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 scripts/musl_release_manifest.py:188 — `not isinstance(entry, dict) or set(entry) != release_manifest.TARGET_KEYS` appears character-identically in 2 files — scripts/musl_release_manifest.py, scripts/windows_release_manifest.py. 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 scripts/musl_release_manifest.py:171 — `not isinstance(legacy, dict) or set(legacy) != LEGACY_RELEASE_KEYS` appears character-identically in 2 files — scripts/musl_release_manifest.py, scripts/windows_release_manifest.py. 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 scripts/musl_release_manifest.py:176 — `not isinstance(legacy.get("metadata-blake3"), str) or release_manifest.HEX_64.fullmatch(legacy["metadata-blake3"]) is None` appears character-identically in 2 files — scripts/musl_release_manifest.py, scripts/windows_release_manifest.py. 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 scripts/musl_release_manifest.py:212 — `not isinstance(value, str) or release_manifest.HEX_64.fullmatch(value) is None` appears character-identically in 2 files — scripts/musl_release_manifest.py, scripts/windows_release_manifest.py. 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 scripts/musl_release_manifest.py:219 — `not path.is_file() or path.is_symlink() or path.stat().st_size != entry["size"]` appears character-identically in 3 files — scripts/musl_release_manifest.py, scripts/release_manifest.py, scripts/windows_release_manifest.py. 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 scripts/release_draft_recovery.py:30 — `path.is_symlink() or not stat.S_ISREG(path.lstat().st_mode)` appears character-identically in 2 files — scripts/release_draft_recovery.py, scripts/release_publication.py. 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 scripts/musl_release_manifest.py:79 — `set(blake3) != expected_all or set(sha256) != expected_all` appears character-identically in 2 files — scripts/musl_release_manifest.py, scripts/windows_release_manifest.py. 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 scripts/runatal_v1_reader.py:127 — `target[:2] != (1, 1) or len(target[2]) != 32` appears character-identically in 2 files — scripts/runatal_v1_reader.py, scripts/runatal_v1_sha384.py. 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 scripts/musl_release_manifest.py:133 — `type(data["schema-version"]) is not int or data["schema-version"] != 1 or data["kind"] != KIND or data["product"] != release_manifest.PRODUC…` appears character-identically in 2 files — scripts/musl_release_manifest.py, scripts/windows_release_manifest.py. 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 scripts/musl_release_manifest.py:205 — `type(entry["size"]) is not int or entry["size"] <= 0` appears character-identically in 2 files — scripts/musl_release_manifest.py, scripts/windows_release_manifest.py. 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/astrid-capsule-install/src/source_digest.rs:86 — `!entry_type.is_dir() && !entry_type.is_file()` appears character-identically in 2 files — crates/astrid-capsule-install/src/source_digest.rs, crates/astrid-capsule-install/src/storage.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/astrid-types/src/ipc/delivery_failure.rs:30 — `!id.is_nil() && id.simple().to_string() == value` appears character-identically in 2 files — crates/astrid-types/src/ipc/delivery_failure.rs, crates/astrid-types/src/ipc/request_failure.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/astrid-storage-provider-fskit/src/service.rs:159 — `!lease.resource_path.is_absolute() || !lease.callback_path.is_absolute()` appears character-identically in 2 files — crates/astrid-storage-provider-fskit/src/service.rs, crates/astrid-storage-provider-fuse/src/service.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.
D7 · Architectural Integrity · Classify ADR enforcement · ×14
  • Classify ADR enforcement: 2182.fixed changes/2182.fixed.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: 2186.security changes/2186.security.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: 2188.fixed changes/2188.fixed.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: 2191.fixed changes/2191.fixed.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: 2194.fixed changes/2194.fixed.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: 2198.fixed changes/2198.fixed.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: 2202.fixed changes/2202.fixed.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: 2208.fixed changes/2208.fixed.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: 2209.fixed changes/2209.fixed.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: 2209.security changes/2209.security.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: 2214.fixed changes/2214.fixed.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: 2243.fixed changes/2243.fixed.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: 2287.fixed changes/2287.fixed.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
  • Classify ADR enforcement: 2319.fixed changes/2319.fixed.md — This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
X7 · Silent fallback defaults · Silent fallback default on Err · ×10
  • Silent fallback default on Err crates/astrid-approval/src/deferred.rs:376 — `get_pending` 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/astrid-approval/src/deferred.rs:406 — `cleanup_old` turns every `Err` into `0` — 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/astrid-capsule/src/engine/wasm/host/io.rs:164 — `to_debug_string` turns every `Err` into `"error resource not found".to_string()` — 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/astrid-capsule-install/src/manifest_check.rs:42 — `validate_imports_with_layout` 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/astrid-capsule-install/src/manifest_check.rs:71 — `validate_imports_in_workspace` 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/astrid-cli/src/commands/capsule/model_discovery.rs:138 — `parse_options_response` 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 REDACTED:475 — `resource_hosts` 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/astrid-cli/src/commands/self_update/mod.rs:73 — `api_base` turns every `Err` into `"https://api.github.com".to_string()` — 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/astrid-kernel/src/lib.rs:2726 — `enumerate_profile_principals` 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/astrid-storage/src/resident_cache.rs:81 — `ensure_logical_capacity` turns every `Err` into `0` — 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.
X9 · Subsumed condition operand · Subsumed condition operand · ×2
  • Subsumed condition operand crates/astrid-kernel/src/kernel_router/admin/enforcement_tests.rs:179 — `err_msg.contains("agent is disabled")` can never decide this `||` — every value satisfying `err_msg.contains("agent is disabled")` also satisfies `err_msg.contains("disabled")`, 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/astrid-kernel/src/kernel_router/admin/enforcement_tests.rs:610 — `err.contains("outside the authenticating device's scope")` can never decide this `||` — every value satisfying `err.contains("outside the authenticating device's scope")` also satisfies `err.contains("device")`, 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.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 5 of 33 project(s) overshoot their size bounds, lowering Project Cohesion to 7.0/10. The most over is `crates/astrid-storage` (87410 LoC, 445 module-visible types across 39 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 22/27 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `crates/astrid-emit`, `crates/astrid-storage-chunker-evidence`, `crates/astrid-storage-provider-fskit`, `crates/astrid-storage-provider-fuse`, `crates/astrid-storage-provider-winfsp`.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×1
  • Silent fallback default on parse failure scripts/runatal_v1_sha384.py:282 — `ed25519_verify` returns `False` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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.
Minor — 22 finding(s)
D12 · Dependency Hygiene · Outdated · ×22
  • Outdated: arbitrary — `arbitrary` is locked at 1.4.2 but 1.5.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in fuzz/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p arbitrary` and commit the updated REDACTED.
  • Outdated: arboard — `arboard` is locked at 3.6.1 but 3.7.0 is the current stable release on crates.io, and it already satisfies the `"3"` requirement declared in crates/astrid-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p arboard` and commit the updated REDACTED.
  • Outdated: arc-swap — `arc-swap` is locked at 1.9.2 but 1.9.3 is the current stable release on crates.io, and it already satisfies the `"1.7"` requirement declared in crates/astrid-capsule/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p arc-swap` and commit the updated REDACTED.
  • Outdated: clap — `clap` is locked at 4.6.6 but 4.6.7 is the current stable release on crates.io, and it already satisfies the `"4.5"` requirement declared in crates/astrid-build/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p clap` and commit the updated REDACTED.
  • Outdated: clap_complete — `clap_complete` is locked at 4.6.9 but 4.6.11 is the current stable release on crates.io, and it already satisfies the `"4.5"` requirement declared in crates/astrid-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p clap_complete` and commit the updated REDACTED.
  • Outdated: flate2 — `flate2` is locked at 1.1.9 but 1.1.10 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in crates/astrid-build/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p flate2` and commit the updated REDACTED.
  • Outdated: libc — `libc` is locked at 0.2.189 but 0.2.191 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in crates/astrid-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p libc` and commit the updated REDACTED.
  • Outdated: notify — `notify` is locked at 8.2.0 but 8.2.1 is the current stable release on crates.io, and it already satisfies the `"8"` requirement declared in crates/astrid-capsule/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p notify` and commit the updated REDACTED.
  • Outdated: process-wrap — `process-wrap` is locked at 10.0.0 but 10.0.1 is the current stable release on crates.io, and it already satisfies the `"10"` requirement declared in crates/astrid-mcp/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p process-wrap` and commit the updated REDACTED.
  • Outdated: rand — `rand` is locked at 0.10.2 but 0.10.3 is the current stable release on crates.io, and it already satisfies the `"0.10"` requirement declared in crates/astrid-capsule/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rand` and commit the updated REDACTED.
  • Outdated: serde_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.0"` requirement declared in crates/astrid-audit/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/astrid-audit/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p sha2` and commit the updated REDACTED.
  • Outdated: signal-hook — `signal-hook` is locked at 0.4.4 but 0.4.5 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in crates/astrid-daemon/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p signal-hook` and commit the updated REDACTED.
  • Outdated: syn — `syn` is locked at 3.0.4 but 3.0.9 is the current stable release on crates.io, and it already satisfies the `"~3.0.4"` requirement declared in crates/astrid-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p syn` and commit the updated REDACTED.
  • Outdated: thiserror — `thiserror` is locked at 2.0.20 but 2.0.21 is the current stable release on crates.io, and it already satisfies the `"2.0"` requirement declared in crates/astrid-approval/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p thiserror` and commit the updated REDACTED.
  • Outdated: tokio — `tokio` is locked at 1.53.1 but 1.54.1 is the current stable release on crates.io, and it already satisfies the `"1.49"` requirement declared in crates/astrid-approval/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio` and commit the updated REDACTED.
  • Outdated: tokio-util — `tokio-util` is locked at 0.7.19 but 0.7.20 is the current stable release on crates.io, and it already satisfies the `"0.7"` requirement declared in crates/astrid-capsule/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio-util` and commit the updated REDACTED.
  • Outdated: toml_edit — `toml_edit` is locked at 0.25.13+spec-1.1.0 but 0.25.17+spec-1.1.0 is the current stable release on crates.io, and it already satisfies the `"0.25.3"` requirement declared in crates/astrid-build/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p toml_edit` and commit the updated REDACTED.
  • Outdated: tower-http — `tower-http` is locked at 0.7.0 but 0.7.1 is the current stable release on crates.io, and it already satisfies the `"0.7"` requirement declared in crates/astrid-gateway/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tower-http` and commit the updated REDACTED.
  • Outdated: wasm-bindgen-futures — `wasm-bindgen-futures` is locked at 0.4.77 but 0.4.79 is the current stable release on crates.io, and it already satisfies the `"0.4.76"` requirement declared in crates/astrid-runtime/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p wasm-bindgen-futures` and commit the updated REDACTED.
  • Outdated: which — `which` is locked at 8.0.5 but 8.0.6 is the current stable release on crates.io, and it already satisfies the `"8"` requirement declared in crates/astrid-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p which` and commit the updated REDACTED.
  • Outdated: zeroize — `zeroize` is locked at 1.9.0 but 1.9.1 is the current stable release on crates.io, and it already satisfies the `"1.8"` requirement declared in crates/astrid-capsule/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p zeroize` and commit the updated REDACTED.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-4e2a4313d4364551861af245f1726372/history.json --exit-code 0 --source .4artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-4e2a4313d4364551861af245f1726372/tree.json --exit-code 0 --source .4artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .4artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .9artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .0artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—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.0—
D40 · Network Egress Confinementruntime-hardening—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.0—
D41 · Kernel & Syscall Confinementruntime-hardening—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.0—
D42 · Runtime Threat Enforcementruntime-hardening—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.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a17ba0-c7c0-79b9-b597-ce43517632cd · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

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.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md