Public report — ARES, published 3 Aug 2026.
Concrete security findings (CVE IDs, secret matches, dependency versions) are hidden in this version;
ask the repo owner for the full report.
775findings with an exact file:lineof 787 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
35/104dimensions across the health lenses156261 LoC — wide & deep
Executive summary
Read through the Preview lens: this repo is pre-1.0 / in development, so the colour bands are relaxed to what a preview needs — *green* means good enough for a preview, not yet production-stable. Code correctness and security stay near-strict even here; the score itself is absolute and comparable across repos.
Timwood0x10/ARES is sound in substance but carries real gaps (53%). It is not in crisis, but the issues below raise the cost of changing it — friction its consumers ultimately inherit.
It is strongest in Architecture (100%) — the structure is clean and changes stay contained. Event Sourcing (100%) is solid too.
Most urgent: a critical security exposure was detected (see the Security & Compliance lens). Treat it as a priority regardless of the overall grade.
The area that most needs attention is Security (37%) — exposure to security and compliance incidents is elevated. Readiness (63%) is the next concern — releases are harder to depend on — versioning, release notes and dependency hygiene are thin, so consumers can't easily tell what changed or trust an upgrade.
How the score is built — each lens's share of the headlineWidth is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
235 finding(s) are new versus the previous scan (2026-07-29) — surfaced by this scheduled scan itself, no pull request required. Showing the first 100; the full set is in the report.
A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.
Rebuild cost & value ~ Modeled — €140,000–€690,000
0.7× (at 53% quality) — the last 20% of quality is most of the work
Size & shape
Large · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)
This codebase represents roughly ~2.8 person-years of build effort (about ~€410,000 to rebuild). Its weakest lens is Security at 37% — the part of that asset most exposed by the findings below.
How we model this: boilerplate at a scaffolding rate + logic × domain High (×1.4) — domain model, event sourcing × a 0.7× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).
Top priorities
The highest-leverage moves; the full ranked list is in the Roadmap below.
1
Resolve the 3 Secret finding(s) in Secrets (history) — start with config.yaml (3).
Value concentrated against a weak lens · High · Value at risk
This is a Large asset (~2.8 person-years to rebuild), and its weakest lens is Security at 37%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
→ Direct remediation budget at Security first — highest risk-reduction per euro on an asset this size.
The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 1–3 engineer-days once. Not doing it costs about 189.9–1139.6 engineer-days every year, paid as drag on the ~1,792,925 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–2 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 4–10% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 442,091 line(s) changed over a 90-day window ⇒ ~1,792,925/year · D1/D2/D4 code quality: averaging 6.3/10 ⇒ a 4–10% drag on each change · top-ranked remediation: Low effort ⇒ about 1–3 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 2 months.
Root cause: an un-encapsulated domain · Medium · Root cause
13 findings across public setters, anemic types and primitive ids share one root cause — the domain layer doesn't protect its own invariants. Fixing the encapsulation pattern resolves them together, rather than chasing each finding.
→ Address encapsulation as one pattern (private setters + behaviour + strongly-typed ids), not 100 separate findings.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Resolve the 49 High finding(s) in Static Analysis (SAST) — start with ci.yml (10), cd.yml (7), vector.go (5). The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Resolve the 49 High finding(s) in Static Analysis (SAST) — start with ci.yml (10), cd.yml (7), vector.go (5).
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 6.3/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 4–10% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4 code quality: averaging 6.3/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.
Architecture — module dependency matrix
218 modules, 519 dependencies — 2 dependency cycles, shown as the red cell(s) above the diagonal. Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)
At a glance — Code Health · 71% · Adequate · gated by D2
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A03:2021 — Injection
50
High / Critical
A06:2021 — Vulnerable & Outdated Components
20
High / Critical
A02:2021 — Cryptographic Failures
5
High / Critical
A05:2021 — Security Misconfiguration
4
High / Critical
Roadmap
Begin by addressing the 49 high-priority static analysis findings, focusing first on ci.yml, cd.yml, and vector.go. Next, eliminate the three exposed secrets from the repository history, specifically in config.yaml. Then, resolve the 13 medium-severity dependency vulnerabilities, prioritizing uv.lock and go.mod. Finally, rotate the single exposed credential and remove the one leaked secret from config.yaml.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 3 Secret finding(s) in Secrets (history) — start with config.yaml (3).
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. 34 of 35 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 1 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.6 — 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 — 35 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 775 of 787 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D19 Documentation Quality — LLM provider failed — The model provider returned an unusable result, so this LLM-assisted dimension fell back to a measurement gap (confidence 0) rather than a penalty. Re-run with a reachable provider to score it.
D30 Dependency Vulnerabilities — scanner not present in this environment — The backing tool was not installed where this scan ran, so this dimension was not scored. Install the tool (or run in the hosted environment, where it is always present) for a graded result.
Repo exclusion declarations: 3 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.
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 (jscpd) — 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.
D13 Secret Scanning: Secret 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").
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.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
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").
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.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A clean result is "no unlabelled native control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
DM4 Rich vs anemic model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
The LLM boundary
LLM-set scores this run (2): D21, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score (documentation, ADR quality, naming, comment value, onboarding) — D25 sets the ADR-conformance fraction over sampled code, D22 judges API accuracy over a sample. These are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
138 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was renderDetailDrawer at 104. A further 1 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being flight.ClassifyError at 19 — they are counted neither in the figure above nor in this dimension's score.
+ 131 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 (anonymous) (cyclomatic 21) finding(s) in Cyclomatic Complexity — start with app.js (2). — One of this dimension's main actionable groups (2 warning-level).
Resolve the 2 main.run (cyclomatic 19) finding(s) in Cyclomatic Complexity — start with main.go (2). — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 renderDetailDrawer (cyclomatic 104) finding(s) in Cyclomatic Complexity — start with app.js. — One of this dimension's main actionable groups (1 warning-level).
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 284 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 main.printReport (cognitive 22) finding(s) in Cognitive Complexity — start with main.go, arena.go. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 2 actionHandler.handleChaos (cognitive 19) finding(s) in Cognitive Complexity — start with actions.go (2). — One of this dimension's main actionable groups (2 warning-level).
Resolve the 2 (anonymous) (cognitive 18) finding(s) in Cognitive Complexity — start with app.js (2). — One of this dimension's main actionable groups (2 warning-level).
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes9.5 / 10Exemplary✓ 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.
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.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with config.yaml. — One of this dimension's main actionable groups (1 issue-level).
Enforce Secret Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: 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.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Git-history secret scan via gitleaks detect over full history in an isolated checkout; each match flagged High. Exhaustive; degrades cleanly when tool absent.
9 finding(s): 0 critical, 9 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
Secret: generic-api-key · ×3cmd/monitor-live/config.yaml:13detected by gitleaks finding
Rotate the exposed credentials — git history can't be un-committed
What to do
Resolve the 3 Secret finding(s) in Secrets (history) — start with config.yaml (3). — One of this dimension's main actionable groups (3 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
High: dependabot-missing-cooldown · ×49.github/dependabot.yml:3detected by semgrep finding
Medium: math-random-usedcmd/ares/actions.go:8detected by semgrep finding
What to do
Resolve the 49 High finding(s) in Static Analysis (SAST) — start with ci.yml (10), cd.yml (7), vector.go (5). — One of this dimension's main actionable groups (49 issue-level).
Resolve the 1 Medium finding(s) in Static Analysis (SAST) — start with actions.go. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether 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.
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; coupling through a build step, config, or non-source file isn't seen.
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.
Resolve the 1 Unpinned build actions finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 PR-triggered workflow without a permissions block finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 No build provenance finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether dependencies have known published vulnerabilities (CVEs) per the OSV database — read natively from whatever lockfile the repository ships (Cargo, npm, Go, Python, Maven, RubyGems, …). D33 and D30 add ecosystem-specific scanners on top for npm and .NET.
Method: Multi-ecosystem dependency-CVE scan via osv-scanner --recursive (queries the osv.dev database + parses lockfiles natively across ecosystems: npm package-lock/yarn/pnpm/bun, Go go.mod, Rust Cargo.lock, Maven/Gradle pom.xml/gradle.lockfile, PyPI requirements.txt/poetry.lock/Pipfile.lock, Composer composer.lock, RubyGems Gemfile.lock, Hex mix.lock, pub pubspec.lock, Swift Package.resolved); severity tally (Critical/High/Medium/Low) to 0-10 tight normalizer (8.0). NotApplicable only when the repo declares no supported non-.NET dependency lockfile (a NuGet-only repo stays NotApplicable — .NET CVEs are D30's domain); coverage needs a resolved lockfile. Additive to D33 (trivy fs); exhaustive + deterministic, DB kept fresh.
High CVE: [GHSA redacted] · ×5go.moddetected by osv-scanner finding
Critical CVE: [GHSA redacted] · ×2go.moddetected by osv-scanner finding
Medium CVE: [GHSA redacted] · ×13services/embedding/uv.lockdetected by osv-scanner finding
What to do
Resolve the 13 Medium CVE finding(s) in OSV Dependency Vulnerabilities — start with uv.lock (8), go.mod (5). — One of this dimension's main actionable groups (13 warning-level).
Resolve the 5 High CVE finding(s) in OSV Dependency Vulnerabilities — start with uv.lock (3), go.mod (2). — One of this dimension's main actionable groups (5 issue-level).
Resolve the 2 Critical CVE finding(s) in OSV Dependency Vulnerabilities — start with go.mod (2). — One of this dimension's main actionable groups (2 issue-level).
Detailed fixes: d38_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC2 · Forms & labels10.0 / 10Exemplary○ Nothing flagged
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×2) — index.html:2, index.html:2
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
No accessibility enforcement found — no automated accessibility check runs over the HTML your app renders. Assert the accessibility invariants over that HTML in the test suite you already have (parse the output and assert, or drive a browser), and gate that test in CI so a regression blocks the merge.
What to do
Enforce accessibility in the test suite you already have: assert the accessibility invariants over the HTML your app renders — parse the rendered output in an existing test, or drive a real browser from one — and gate that test in CI so a regression blocks the merge.
Other · Domain Modelling — Whether aggregates reference each other by identity (id) rather than by direct object reference — the core DDD consistency-boundary rule.
Method: Roslyn (DDD-gated): aggregate roots identified by convention; each aggregate field checked for direct references to other aggregates versus id-only. Deterministic, DDD-native.
Coverage: Population: aggregate roots identified by AggregateRoot/IAggregateRoot base/interface NAME convention; reference-by-identity then checked exhaustively within that set — a root not using those names is invisible.
Other · Domain Modelling — How much of the domain uses strongly-typed ids vs raw Guid/string/int — adoption curve, not all-or-nothing.
Method: Roslyn (DDD-gated): strongly-typed id adoption on domain entities/events; raw Guid/int/string ids counted versus wrapped types. Deterministic, adoption percentage.
Coverage: Population: id-like members by *Id/*Key NAME suffix; strongly-typed-ID shape then checked semantically — non-suffixed identifiers are not seen.
`RecommendResult.SessionID` is a raw `string` — give it a strongly-typed id: a dedicated single-field type wrapping the `string`, in whatever form your language spells that. — recommend.go:10
`RecommendResult.UserID` is a raw `string` — give it a strongly-typed id: a dedicated single-field type wrapping the `string`, in whatever form your language spells that. — recommend.go:11
`Session.SessionID` is a raw `string` — give it a strongly-typed id: a dedicated single-field type wrapping the `string`, in whatever form your language spells that. — session.go:7
`Session.UserID` is a raw `string` — give it a strongly-typed id: a dedicated single-field type wrapping the `string`, in whatever form your language spells that. — session.go:8
`TaskResult.TaskID` is a raw `string` — give it a strongly-typed id: a dedicated single-field type wrapping the `string`, in whatever form your language spells that. — task.go:50
`Tool.ID` is a raw `string` — give it a strongly-typed id: a dedicated single-field type wrapping the `string`, in whatever form your language spells that. — tool.go:9
`Tool.TenantID` is a raw `string` — give it a strongly-typed id: a dedicated single-field type wrapping the `string`, in whatever form your language spells that. — tool.go:10
What to do
Adopt strongly-typed ids across the domain — finish the migration or document the boundary; primitive ids invite transposed-argument bugs.
Do you agree with this assessment?
DM4 · Rich vs anemic model10.0 / 10Exemplary✓ Tool-verified
Other · Domain Modelling — Whether aggregates/entities carry the behaviour that protects their invariants, rather than being data bags driven by external services.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.
Other · Domain Modelling — Whether entities protect their state (private/init-only setters) instead of exposing public setters that bypass invariants. Softened when a rehydration framework (Marten/EF) is present.
Method: Roslyn (DDD-gated): public setters on entities detected; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
`MutableDAG` exposes publicly writable state (SchedulerType). — mutable_dag.go:20
What to do
Make entity setters private/init-only; change state only through methods that enforce the invariants (Marten/EF can bind via constructor or private setters).
Other · Domain Modelling — Whether clusters of primitives that travel together (a missing value object) are extracted — a low-weight suggestion, LLM-confirmed when configured.
Method: Roslyn (DDD-gated): primitive parameter clusters recurring three or more times across signatures extracted, then confirmed by language model when configured. Advisory, low-weight.
Other · Event Sourcing — Whether Apply/When folds reconstruct state purely from the event (no DateTime.Now, Guid.NewGuid, Random or IO) so replay is reproducible.
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.
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
Add a 'Testing' section to the root README — how to run the test suite.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no `NNNN-title.md` documents and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree with `NNNN-title.md` names is the most discoverable form).
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.
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
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
What to do
Add an approval/environment gate (required reviewers / protection rules) before production promotion.
Do you agree with this assessment?
P5 · DR & Backup6.0 / 10Adequate✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
Codify backups + geo-recovery in IaC (snapshot/replication/geo-redundant) to back the DR plan.
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.
What to do
Stamp a version in your build/package manifest (e.g. csproj <Version>, package.json, pyproject.toml, Cargo.toml, or a VERSION file) or tag releases with semver so builds and releases are traceable.
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 10 of 55 WCAG 2.2 Level A/AA success criteria (18%; ≈20% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 45 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Not included — 69 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 image/media element found in the parsed markup — AC1 not applicable here.
AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
AC5 ARIA correctness — No ARIA usage found in the parsed markup — AC5 not applicable here.
AX1 Captive dependencies — no DI registrations detected
AX10 Code composition — not assessed — code composition is computed by ROLE over a document set 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
AX2 Stateful singletons — no singleton implementations detected
AX3 Project dependency cycles — not assessed — project cycles and dependency direction are computed over a project-reference graph 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
AX4 Dependency direction — not assessed — project cycles and dependency direction are computed over a project-reference graph 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
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
AX8 Test isolation — not assessed — test isolation is computed from a project graph (which projects are test projects, and what they reference) 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
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D10 Test Quality — ~146689 lines of test source are present (.go) but the test-quality collector reads C# only, 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
D12 Dependency Hygiene — Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
D14 License Compliance — Not scored — this repository's package manifest is not parsed for licence data yet. A gap in the analyzer's language coverage, NOT a finding that the repository's licenses are compliant (a Go module (go.mod/go.sum)), which this pass does not parse yet — so this dimension asserts nothing about this repository's licensing in either direction.
D16 Bus Factor — single-maintainer — knowledge-concentration (bus factor) risk
D17 Explicit Debt — explicit-debt markers are read through a C# workspace today, so they were not read for this repository's language — this asserts nothing about how many markers the code carries. Not scored — this is a gap in the analyzer, not a finding about this repository
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.
D19 Documentation Quality — LLM evaluation failed
D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
D22 Internal API Consistency — No exposed public API
D23 Boundary Type-Coupling — Production source is present (.go, .py) but bounded contexts are resolved over the C#/VB project set, which exposed none, so context scope could not be assessed. Not scored — this is a gap in the analyzer, not a verdict about this repository. Declaring the codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed — see the recommendation on this dimension for where. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
D27 Navigability — No calls could be sampled, so navigability was not assessed — tracing effort is measured over resolved call sites and this target exposed none. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Go module (go.mod/go.sum) — not scanned yet) — where an OSV-supported manifest exists, dependency vulnerabilities for this repository are reported under D38 instead.
D32 Data Compliance (PII/GDPR) — No PII/GDPR-handling patterns detected (p/gdpr ruleset) — no data-compliance surface to assess.
D33 JS/npm Dependency Vulnerabilities — No JS/npm manifest or lockfile found outside build output (package.json, package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb); no JS dependencies to scan.
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.
D5 Coupling — Inter-project coupling could not be assessed — no analyzable project graph was found for this repository. Not scored: a gap in the analyzer's reach, not a verdict about this repository. (Coupling here is Martin afferent/efferent/instability plus reference cycles across a project-reference graph, read today from .NET project files; other ecosystems' module graphs are not read yet.)
D6 Cohesion (LCOM4) — Cohesion (LCOM4) is measured over a C#/VB class graph, and this repository's production source is mostly .go, .py, which this pass does not read, so cohesion was not assessed for this repository. Not scored — this is a gap in the analyzer, not a finding about this repository.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not included — suite not readable by the collector
D9 Test Distribution — Test source is present (.go) but the test-pyramid classifier reads C# only, so its unit/integration/BDD/E2E split couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
DM3 Integration-event coupling — no integration events detected — coupling check not applicable
DM6 Domain ↔ infrastructure boundary — no domain-layer types detected — domain↔infrastructure boundary check not applicable
ED1 Event-Driven — not scored — this repository shows only 1 of the 3 signals this check looks for (23 event-sourced shape(s) (event folds / event-recording aggregates))
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES2 Immutable events — no persisted event types detected — immutability check not applicable
ES3 PII in the event store — no persisted event types detected — PII-in-events check not applicable
GD1 Unfinished & placeholder code — no source files
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, 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'.
P2 Observability — Observability was not assessed: this check reads a source model that does not carry this repository's product — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of a logging idiom this check recognises is NOT evidence that this repo lacks structured logging (it may log through its own ecosystem's logger). This is a gap in the analyzer, not a finding about this repository.
P7 Outbound HTTP resilience — not measured — the application kind could not be determined for this repo
P8 Schema migrations — not assessed — schema-migration practice is read from a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (`go test -coverprofile=coverage.out ./...`) into the repo working tree before the scan — a CI step is the usual place, since the artefact is commonly gitignored, or wire coverage collection into CI, to enable this cross-layer check
PF1 Benchmark discipline — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
PF2 Allocation hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
PF3 Async & latency hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X1 Async correctness — not 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
X3 Exception handling — 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
X4 Structured logging — 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
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
High: dependabot-missing-cooldown .github/dependabot.yml:3— This Dependabot configuration does not set a cooldown period. Newly published packages can be malicious or unstable. Add a `cooldown` block with `default-days: 7` to each `package-ecosystem` entry under `updates` to wait 7 days before proposing updates to newly published package versions. Reference: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#cooldown. This is a semgrep security-AUDIT rule reporting a POLICY that is absent or weaker than its recommendation, not an exploitable defect. Confirm whether the current setting is a deliberate decision for this repository — and apply the change where it is not; where it is (a policy your release process already enforces elsewhere, or one this repository has consciously opted out of), record the decision and leave the configuration as it is.
High: github-actions-mutable-action-tag .github/workflows/cd.yml:22— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/cd.yml:25— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: docker/setup-buildx-action@<40-character SHA>`. This step references `docker/setup-buildx-action@v3`; resolve the SHA it points at today with `gh api repos/docker/setup-buildx-action/commits/v3 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/cd.yml:28— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: docker/login-action@<40-character SHA>`. This step references `docker/login-action@v3`; resolve the SHA it points at today with `gh api repos/docker/login-action/commits/v3 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/cd.yml:36— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: docker/metadata-action@<40-character SHA>`. This step references `docker/metadata-action@v5`; resolve the SHA it points at today with `gh api repos/docker/metadata-action/commits/v5 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/cd.yml:47— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: docker/build-push-action@<40-character SHA>`. This step references `docker/build-push-action@v5`; resolve the SHA it points at today with `gh api repos/docker/build-push-action/commits/v5 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/cd.yml:63— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/cd.yml:66— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: softprops/action-gh-release@<40-character SHA>`. This step references `softprops/action-gh-release@v1`; resolve the SHA it points at today with `gh api repos/softprops/action-gh-release/commits/v1 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/ci.yml:18— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/ci.yml:21— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-go@<40-character SHA>`. This step references `actions/setup-go@v5`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v5 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/ci.yml:38— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: dominikh/staticcheck-action@<40-character SHA>`. This step references `dominikh/staticcheck-action@v1`; resolve the SHA it points at today with `gh api repos/dominikh/staticcheck-action/commits/v1 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/ci.yml:50— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/ci.yml:53— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-go@<40-character SHA>`. This step references `actions/setup-go@v5`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v5 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/ci.yml:82— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/ci.yml:85— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-go@<40-character SHA>`. This step references `actions/setup-go@v5`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v5 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/ci.yml:113— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/ci.yml:116— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-go@<40-character SHA>`. This step references `actions/setup-go@v5`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v5 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/ci.yml:127— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/upload-artifact@<40-character SHA>`. This step references `actions/upload-artifact@v4`; resolve the SHA it points at today with `gh api repos/actions/upload-artifact/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/release.yml:17— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/release.yml:20— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-go@<40-character SHA>`. This step references `actions/setup-go@v5`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v5 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/release.yml:29— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: softprops/action-gh-release@<40-character SHA>`. This step references `softprops/action-gh-release@v2`; resolve the SHA it points at today with `gh api repos/softprops/action-gh-release/commits/v2 --jq .sha`.
High: string-formatted-query cmd/ares/db_migrate.go:121— String-formatted SQL query detected. This could lead to SQL injection if the string is not sanitized properly. Audit this call to ensure the SQL is not manipulable by external data. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
High: string-formatted-query cmd/create_distilled_table/main.go:120— String-formatted SQL query detected. This could lead to SQL injection if the string is not sanitized properly. Audit this call to ensure the SQL is not manipulable by external data. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
High: string-formatted-query cmd/migrate_db/main.go:115— String-formatted SQL query detected. This could lead to SQL injection if the string is not sanitized properly. Audit this call to ensure the SQL is not manipulable by external data. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
High: string-formatted-query cmd/setup_test_db/main.go:109— String-formatted SQL query detected. This could lead to SQL injection if the string is not sanitized properly. Audit this call to ensure the SQL is not manipulable by external data. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
+ 24 more in this group — see findings.md.
D38 · OSV Dependency Vulnerabilities· High CVE · ×5
High CVE: [GHSA redacted] go.mod— github.com/expr-lang/expr 1.16.9: [GHSA redacted] — upgrade to 1.17.0. This one row stands for the 2 advisories this scan raises against github.com/expr-lang/expr 1.16.9: [GHSA redacted], [GHSA redacted].
High CVE: [GHSA redacted] go.mod— go.opentelemetry.io/otel/sdk 1.28.0: [GHSA redacted] — upgrade to 1.40.0. This one row stands for the 2 advisories this scan raises against go.opentelemetry.io/otel/sdk 1.28.0: [GHSA redacted], [GHSA redacted].
High CVE: [GHSA redacted] services/embedding/uv.lock— starlette 0.52.1: [GHSA redacted] — starlette is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or constrain starlette to >=1.3.1 in your constraints/requirements file). This is 1 of 5 advisories with a published fix this scan raises against starlette 0.52.1, and their fixed versions do not agree — anything below 1.3.1 still leaves at least one of them open. Take this package to 1.3.1 or later: that is the floor for the package, not this row's target alone. This one row stands for the 5 advisories this scan raises against starlette 0.52.1: [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], PYSEC-2026-248.
High CVE: [GHSA redacted] services/embedding/uv.lock— transformers 5.3.0: [GHSA redacted] — transformers is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or constrain transformers to >=5.5.0 in your constraints/requirements file).
High CVE: [GHSA redacted] services/embedding/uv.lock— urllib3 2.6.3: [GHSA redacted] — urllib3 is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or constrain urllib3 to >=2.7.0 in your constraints/requirements file). This one row stands for the 2 advisories this scan raises against urllib3 2.6.3: [GHSA redacted], [GHSA redacted].
High IaC: DS-0002 Dockerfile.demo— Image user should not be 'root' A container that starts as root runs your process with root's capabilities inside the namespace, so a compromise of the process starts from there. The step: create an unprivileged account in the image (`RUN adduser -S -D app`), give it ownership of the paths the process writes at runtime (`COPY --chown=` on those layers, or a `RUN chown -R`), and end the final stage with `USER app` so it is the default at start. Build stages that only compile can stay root; it is the stage that RUNS that needs the account. If the process genuinely requires root — it manages the container runtime, ptraces another process or opens raw devices — say so here rather than making a change that breaks it.
High IaC: DS-0029 services/embedding/Dockerfile— 'apt-get' missing '--no-install-recommends'
Critical CVE: [GHSA redacted] go.mod— github.com/jackc/pgx/v5 5.7.1: [GHSA redacted] — upgrade to 5.9.0. This one row stands for the 3 advisories this scan raises against github.com/jackc/pgx/v5 5.7.1: [GHSA redacted], [GHSA redacted], GO-2026-5004.
Critical CVE: [GHSA redacted] go.mod— golang.org/x/crypto 0.49.0: [GHSA redacted] — upgrade to 0.52.0. This one row stands for the 14 advisories this scan raises against golang.org/x/crypto 0.49.0: [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], GO-2026-5932.
Leaked secret: high-entropy-secret cmd/monitor-live/config.yaml:13— high-entropy-secret detected. Treat the value as compromised: it is readable by everyone who has ever had the repository, and deleting the line does not un-publish it. In order — (1) REVOKE it at whatever issued it and issue a replacement, which is the only step that actually closes the exposure; (2) load the replacement at run time from your platform's secret store or the process environment instead of from the tree, so no future value is committable; (3) remove the file or line and add its path to the repository's ignore rules, so it cannot come back; (4) if the value was ever live, purge it from the history as well, since a clone taken before the deletion still carries it. If this is instead a FIXTURE — key material generated for tests and valid nowhere — then the exposure is nil and the fix is to make that legible: generate it in test setup, or keep it under a test-data path, so a reader (and this scan) can tell it from the real thing.
Duplicated block (11 lines × 2) api/client/simple.go:82— api/client/simple.go:82-92 | api/client/simple.go:121-131 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) api/handler/evolution.go:34— api/handler/evolution.go:34-44 | api/handler/evolution.go:59-69 — both copies are in the same file, so extract the 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 `api/handler/evolution.go:34` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) cmd/ares/actions.go:168— cmd/ares/actions.go:168-178 | cmd/monitor-live/actions.go:168-178 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/ares/actions.go:168` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) cmd/ares/serve.go:236— cmd/ares/serve.go:236-246 | cmd/monitor-live/main.go:163-176 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/ares/serve.go:236` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) cmd/ares/serve.go:487— cmd/ares/serve.go:487-497 | cmd/monitor-live/main.go:280-290 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) cmd/monitor-demo/main.go:35— cmd/monitor-demo/main.go:35-45 | cmd/ares/demo.go:49-59 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/monitor-demo/main.go:35` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) examples/11-knowledge-import/main.go:574— examples/11-knowledge-import/main.go:574-584 | examples/11-knowledge-import/main.go:598-608 — both copies are in the same file, so extract the 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 `examples/11-knowledge-import/main.go:574` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 2) internal/agents/sub/executor.go:200— internal/agents/sub/executor.go:200-210 | internal/agents/sub/executor.go:233-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 (11 lines × 2) internal/ares_eval/dimension_judge.go:138— internal/ares_eval/dimension_judge.go:138-148 | internal/ares_eval/llm_judge.go:259-270 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (11 lines × 2) internal/ares_events/memory_store.go:126— internal/ares_events/memory_store.go:126-137 | internal/ares_events/memory_store.go:165-175 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_events/memory_store.go:126` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) internal/ares_evolution/genome_wiring_system.go:363— internal/ares_evolution/genome_wiring_system.go:363-373 | internal/ares_evolution/rollback_policy.go:500-512 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_evolution/genome_wiring_system.go:363` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) internal/ares_evolution/service/service.go:265— internal/ares_evolution/service/service.go:265-278 | internal/ares_evolution/service/report_hook.go:32-42 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (11 lines × 2) internal/ares_experience/conflict_resolver.go:203— internal/ares_experience/conflict_resolver.go:203-214 | internal/ares_memory/context/rag.go:242-252 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_experience/conflict_resolver.go:203` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) internal/ares_memory/manager.go:262— internal/ares_memory/manager.go:262-272 | internal/ares_memory/production_manager.go:791-801 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_memory/manager.go:262` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) internal/ares_memory/memory_patcher.go:75— internal/ares_memory/memory_patcher.go:75-85 | internal/ares_memory/memory_patcher.go:101-113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_memory/memory_patcher.go:75` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (11 lines × 2) internal/ares_ratelimit/sliding_window.go:109— internal/ares_ratelimit/sliding_window.go:109-119 | internal/ares_ratelimit/sliding_window.go:149-159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_ratelimit/sliding_window.go:109` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) internal/ares_security/sanitizer.go:204— internal/ares_security/sanitizer.go:204-214 | internal/ares_security/sanitizer.go:262-272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_security/sanitizer.go:204` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) internal/ares_security/sanitizer.go:321— internal/ares_security/sanitizer.go:321-331 | internal/ares_security/sanitizer.go:341-351 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_security/sanitizer.go:321` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) internal/knowledge/provider/mysql/provider.go:178— internal/knowledge/provider/mysql/provider.go:178-188 | internal/knowledge/provider/postgres/provider.go:222-232 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/knowledge/provider/mysql/provider.go:178` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) internal/llm/client.go:479— internal/llm/client.go:479-489 | internal/llm/client.go:687-697 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/llm/client.go:479` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (11 lines × 2) internal/llm/output/openai.go:186— internal/llm/output/openai.go:186-196 | internal/llm/output/openrouter.go:165-175 — before extracting anything, compare `internal/llm/output/openai.go` and `internal/llm/output/openrouter.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 126 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.
Duplicated block (11 lines × 2) internal/llm/output/openai.go:213— internal/llm/output/openai.go:213-223 | internal/llm/output/openrouter.go:192-202 — before extracting anything, compare `internal/llm/output/openai.go` and `internal/llm/output/openrouter.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 126 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 `internal/llm/output/openai.go:213` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) internal/plugins/resurrection/resurrection.go:417— internal/plugins/resurrection/resurrection.go:417-427 | internal/ares_runtime/manager_lifecycle.go:233-244 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/plugins/resurrection/resurrection.go:417` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) internal/storage/postgres/embedding/cache.go:126— internal/storage/postgres/embedding/cache.go:126-136 | internal/storage/postgres/query/cache.go:116-126 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/embedding/cache.go:126` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) internal/storage/postgres/embedding/client.go:271— internal/storage/postgres/embedding/client.go:271-281 | internal/storage/postgres/embedding/client.go:321-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/embedding/client.go:271` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (10 lines × 2) cmd/ares/actions.go:125— cmd/ares/actions.go:125-134 | cmd/monitor-live/actions.go:124-133 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/ares/actions.go:125` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) cmd/ares/serve.go:445— cmd/ares/serve.go:445-454 | cmd/monitor-live/main.go:238-247 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/ares/serve.go:445` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) cmd/embedding-mcp/main.go:157— cmd/embedding-mcp/main.go:157-166 | internal/tools/resources/builtin/embedding/embedding.go:186-195 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) cmd/embedding-mcp/main.go:229— cmd/embedding-mcp/main.go:229-238 | cmd/mcp-null/main.go:54-64 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/embedding-mcp/main.go:229` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) cmd/flight/main.go:452— cmd/flight/main.go:452-461 | cmd/ares/flight.go:368-377 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) internal/ares_bootstrap/retriever_wiring.go:145— internal/ares_bootstrap/retriever_wiring.go:145-154 | sdk/memory_wiring.go:366-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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_bootstrap/retriever_wiring.go:145` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) internal/ares_eval/service/service.go:306— internal/ares_eval/service/service.go:306-315 | internal/ares_eval/service/service.go:400-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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_eval/service/service.go:306` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) internal/ares_events/memory_summary_repo.go:46— internal/ares_events/memory_summary_repo.go:46-55 | internal/ares_events/memory_summary_repo.go:67-76 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_events/memory_summary_repo.go:46` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 2) internal/ares_flight/timeline.go:135— internal/ares_flight/timeline.go:135-144 | internal/dashboard/api_handlers.go:645-654 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_flight/timeline.go:135` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) internal/ares_mcp/config_watcher.go:220— internal/ares_mcp/config_watcher.go:220-229 | internal/ares_bootstrap/provide_mcp.go:45-54 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_mcp/config_watcher.go:220` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) internal/ares_mcp/server.go:471— internal/ares_mcp/server.go:471-480 | internal/ares_mcp/server.go:715-724 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_mcp/server.go:471` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (10 lines × 2) internal/ares_memory/manager_impl.go:432— internal/ares_memory/manager_impl.go:432-441 | internal/ares_memory/production_manager.go:732-741 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (10 lines × 2) internal/ares_runtime/checkpoint.go:248— internal/ares_runtime/checkpoint.go:248-257 | internal/ares_runtime/checkpoint.go:308-317 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) internal/knowledge/provider/mysql/provider.go:233— internal/knowledge/provider/mysql/provider.go:233-242 | internal/knowledge/provider/postgres/provider.go:37-46 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/knowledge/provider/mysql/provider.go:233` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) internal/llm/output/openai.go:117— internal/llm/output/openai.go:117-126 | internal/llm/output/openrouter.go:97-106 — before extracting anything, compare `internal/llm/output/openai.go` and `internal/llm/output/openrouter.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 126 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.
Duplicated block (10 lines × 2) internal/llm/output/parser.go:343— internal/llm/output/parser.go:343-352 | internal/llm/output/parser.go:422-431 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/llm/output/parser.go:343` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) internal/storage/postgres/pool.go:236— internal/storage/postgres/pool.go:236-245 | internal/storage/postgres/pool.go:308-317 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/pool.go:236` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) internal/storage/postgres/repositories/secret_repository.go:321— internal/storage/postgres/repositories/secret_repository.go:321-330 | internal/storage/postgres/repositories/secret_repository.go:719-728 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/repositories/secret_repository.go:321` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) internal/storage/postgres/repositories/task_result_repository.go:296— internal/storage/postgres/repositories/task_result_repository.go:296-305 | internal/storage/postgres/repositories/task_result_repository.go:398-407 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/repositories/task_result_repository.go:296` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (10 lines × 2) internal/storage/postgres/repositories/task_result_repository.go:362— internal/storage/postgres/repositories/task_result_repository.go:362-371 | internal/storage/postgres/repositories/task_result_repository.go:448-457 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/repositories/task_result_repository.go:362` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) internal/tools/resources/builtin/file/file_tools.go:489— internal/tools/resources/builtin/file/file_tools.go:489-498 | internal/tools/resources/builtin/file/file_tools.go:538-547 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tools/resources/builtin/file/file_tools.go:489` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) internal/tools/resources/builtin/knowledge/knowledge_base.go:208— internal/tools/resources/builtin/knowledge/knowledge_base.go:208-217 | internal/tools/resources/builtin/knowledge/knowledge_base.go:396-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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 2) internal/tools/resources/builtin/knowledge/knowledge_base.go:237— internal/tools/resources/builtin/knowledge/knowledge_base.go:237-247 | internal/tools/resources/builtin/knowledge/knowledge_base.go:336-345 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tools/resources/builtin/knowledge/knowledge_base.go:237` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 2) internal/tools/resources/builtin/planning/task_planner.go:463— internal/tools/resources/builtin/planning/task_planner.go:463-472 | internal/tools/resources/builtin/text/json_tools.go:272-281 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tools/resources/builtin/planning/task_planner.go:463` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) cmd/arena/main.go:748— cmd/arena/main.go:748-757 | cmd/arena/main.go:800-809 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/arena/main.go:748` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (12 lines × 2) api/evolution/genome/genome.go:127— api/evolution/genome/genome.go:127-138 | api/evolution/genome/genome.go:169-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. Read the line range as the matched WINDOW rather than a finished unit: at `api/evolution/genome/genome.go:127` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) cmd/ares/serve.go:466— cmd/ares/serve.go:466-477 | cmd/monitor-live/main.go:259-270 — 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) cmd/flight/main.go:83— cmd/flight/main.go:83-94 | cmd/flight/main.go:133-144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/flight/main.go:83` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) examples/01-quickstart/main.go:32— examples/01-quickstart/main.go:32-43 | examples/12-yaml-driven-flags/main.go:39-50 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) examples/04-multi-agent/main.go:26— examples/04-multi-agent/main.go:26-38 | examples/05-evolution-demo/main.go:34-45 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `examples/04-multi-agent/main.go:26` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 2) examples/07-human-in-loop/main.go:75— examples/07-human-in-loop/main.go:75-86 | examples/08-mcp-integration/main.go:70-81 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `examples/07-human-in-loop/main.go:75` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) internal/ares_evolution/experience/memory_store.go:209— internal/ares_evolution/experience/memory_store.go:209-221 | internal/ares_evolution/experience/memory_store.go:326-337 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_evolution/experience/memory_store.go:209` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (12 lines × 2) internal/ares_memory/manager_impl.go:356— internal/ares_memory/manager_impl.go:356-367 | internal/ares_memory/production_manager.go:636-648 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_memory/manager_impl.go:356` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) internal/ares_memory/production_manager.go:455— internal/ares_memory/production_manager.go:455-466 | internal/ares_memory/production_manager.go:576-587 — both copies are in the same file, so extract the block into 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) internal/discovery/providers/filesystem.go:166— internal/discovery/providers/filesystem.go:166-177 | internal/discovery/providers/filesystem.go:196-207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/discovery/providers/filesystem.go:166` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 2) internal/knowledge/store/postgres/store.go:126— internal/knowledge/store/postgres/store.go:126-137 | internal/knowledge/store/sqlite/store.go:139-150 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/knowledge/store/postgres/store.go:126` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) internal/knowledge/store/postgres/store.go:205— internal/knowledge/store/postgres/store.go:205-216 | internal/knowledge/store/postgres/store.go:255-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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/knowledge/store/postgres/store.go:205` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) internal/knowledge/store/sqlite/store.go:144— internal/knowledge/store/sqlite/store.go:144-155 | internal/knowledge/store/sqlite/store.go:309-320 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/knowledge/store/sqlite/store.go:144` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) internal/knowledge/store/sqlite/store.go:203— internal/knowledge/store/sqlite/store.go:203-214 | internal/knowledge/store/sqlite/store.go:235-246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/knowledge/store/sqlite/store.go:203` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (12 lines × 2) internal/llm/output/openai.go:79— internal/llm/output/openai.go:79-90 | internal/llm/output/openrouter.go:60-71 — before extracting anything, compare `internal/llm/output/openai.go` and `internal/llm/output/openrouter.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 126 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 `internal/llm/output/openai.go:79` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) internal/monitoring/data/trace_linker.go:142— internal/monitoring/data/trace_linker.go:142-153 | internal/monitoring/data/trace_linker.go:208-219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (12 lines × 2) internal/storage/postgres/profile.go:31— internal/storage/postgres/profile.go:31-42 | internal/storage/postgres/profile.go:138-149 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/profile.go:31` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) internal/tools/resources/builtin/hash/hash.go:51— internal/tools/resources/builtin/hash/hash.go:51-62 | internal/tools/resources/builtin/stringutils/stringutils.go:68-79 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tools/resources/builtin/hash/hash.go:51` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) internal/workflow/engine/mutable_dag.go:225— internal/workflow/engine/mutable_dag.go:225-236 | internal/workflow/engine/mutable_dag.go:285-296 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/workflow/engine/mutable_dag.go:225` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (12 lines × 2) internal/workflow/graph/graph.go:155— internal/workflow/graph/graph.go:155-166 | internal/workflow/graph/graph.go:223-234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (12 lines × 2) cmd/arena/main.go:242— cmd/arena/main.go:242-253 | cmd/ares/arena.go:407-418 — 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) cmd/arena/main.go:887— cmd/arena/main.go:887-898 | cmd/ares/arena.go:598-609 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/arena/main.go:887` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) cmd/ares/db_migrate.go:54— cmd/ares/db_migrate.go:54-65 | cmd/migrate_db/main.go:45-56 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/ares/db_migrate.go:54` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) cmd/migrate_db/main.go:47— cmd/migrate_db/main.go:47-58 | cmd/setup_test_db/main.go:52-63 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/migrate_db/main.go:47` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) internal/dashboard/api_handlers.go:573— internal/dashboard/api_handlers.go:573-584 | internal/dashboard/api_handlers.go:678-689 — both copies are in the same file, so extract the block into 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) api/evolution/genome/genome.go:195— api/evolution/genome/genome.go:195-203 | internal/ares_evolution/genome/crossover.go:507-516 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `api/evolution/genome/genome.go:195` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) cmd/ares/mcp_adapter.go:19— cmd/ares/mcp_adapter.go:19-27 | cmd/monitor-live/mcp_adapter.go:19-27 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/ares/mcp_adapter.go:19` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) cmd/ares/serve.go:192— cmd/ares/serve.go:192-200 | cmd/monitor-live/main.go:125-133 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/ares/serve.go:192` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) cmd/flight/main.go:64— cmd/flight/main.go:64-72 | cmd/arena/main.go:95-103 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/flight/main.go:64` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) cmd/flight/main.go:429— cmd/flight/main.go:429-437 | cmd/ares/flight.go:356-364 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/flight/main.go:429` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) cmd/monitor-demo/main.go:126— cmd/monitor-demo/main.go:126-134 | cmd/ares/demo.go:140-148 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/monitor-demo/main.go:126` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) cmd/monitor-live/main.go:324— cmd/monitor-live/main.go:324-332 | cmd/ares/mcp.go:43-51 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/monitor-live/main.go:324` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) examples/11-knowledge-import/store.go:312— examples/11-knowledge-import/store.go:312-320 | internal/storage/postgres/write_buffer.go:207-216 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `examples/11-knowledge-import/store.go:312` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) examples/runtime_evolution/full/main.go:109— examples/runtime_evolution/full/main.go:109-117 | examples/runtime_evolution/knowledge/main.go:33-41 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `examples/runtime_evolution/full/main.go:109` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) internal/agents/sub/agent.go:290— internal/agents/sub/agent.go:290-298 | internal/agents/sub/agent.go:375-384 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/agents/sub/agent.go:290` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) internal/ares_eval/agent_runner.go:125— internal/ares_eval/agent_runner.go:125-133 | internal/ares_eval/report.go:190-198 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_eval/agent_runner.go:125` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 2) internal/ares_evolution/dream_cycle.go:801— internal/ares_evolution/dream_cycle.go:801-809 | internal/ares_evolution/dream_cycle.go:861-869 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_evolution/dream_cycle.go:801` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 2) internal/ares_memory/production_manager.go:432— internal/ares_memory/production_manager.go:432-441 | internal/ares_memory/production_manager.go:556-564 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_memory/production_manager.go:432` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) internal/knowledge/store/postgres/store.go:28— internal/knowledge/store/postgres/store.go:28-36 | internal/knowledge/store/sqlite/store.go:46-54 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/knowledge/store/postgres/store.go:28` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) internal/llm/client.go:339— internal/llm/client.go:339-347 | internal/llm/generate.go:105-113 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/llm/client.go:339` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) internal/llm/client.go:465— internal/llm/client.go:465-473 | internal/llm/client.go:673-681 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/llm/client.go:465` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) internal/monitoring/tabs/workflow_tab.go:116— internal/monitoring/tabs/workflow_tab.go:116-124 | internal/monitoring/tabs/workflow_tab.go:130-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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/monitoring/tabs/workflow_tab.go:116` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (9 lines × 2) internal/storage/postgres/repositories/distilled_memory_repository.go:254— internal/storage/postgres/repositories/distilled_memory_repository.go:254-262 | internal/storage/postgres/repositories/distilled_memory_repository.go:340-348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/repositories/distilled_memory_repository.go:254` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (9 lines × 2) internal/storage/postgres/services/retrieval_service.go:501— internal/storage/postgres/services/retrieval_service.go:501-509 | internal/storage/postgres/services/retrieval_service.go:543-551 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/services/retrieval_service.go:501` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) internal/storage/postgres/services/simple_retrieval_service.go:267— internal/storage/postgres/services/simple_retrieval_service.go:267-275 | internal/storage/postgres/services/simple_retrieval_service.go:307-315 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/services/simple_retrieval_service.go:267` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) internal/storage/postgres/session.go:198— internal/storage/postgres/session.go:198-206 | internal/storage/postgres/vector.go:96-104 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/session.go:198` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) internal/tools/resources/builtin/text/json_tools.go:128— internal/tools/resources/builtin/text/json_tools.go:128-136 | internal/tools/resources/builtin/text/json_tools.go:157-166 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tools/resources/builtin/text/json_tools.go:128` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) internal/tools/resources/builtin/text/log_analyzer.go:206— internal/tools/resources/builtin/text/log_analyzer.go:206-214 | internal/tools/resources/builtin/text/log_analyzer.go:232-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tools/resources/builtin/text/log_analyzer.go:206` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) internal/workflow/graph/graph.go:65— internal/workflow/graph/graph.go:65-73 | internal/workflow/graph/graph.go:108-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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/workflow/graph/graph.go:65` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) api/service/knowledge/service.go:122— api/service/knowledge/service.go:122-129 | api/service/knowledge/service.go:155-162 — both copies are in the same file, so extract the block into 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) cmd/ares/actions.go:77— cmd/ares/actions.go:77-84 | cmd/monitor-live/actions.go:76-83 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/ares/actions.go:77` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) cmd/ares/serve.go:270— cmd/ares/serve.go:270-277 | cmd/monitor-live/main.go:191-198 — 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) cmd/ares/serve.go:301— cmd/ares/serve.go:301-308 | cmd/monitor-live/main.go:212-219 — 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) cmd/flight/main.go:468— cmd/flight/main.go:468-475 | cmd/ares/flight.go:383-390 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/flight/main.go:468` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) cmd/monitor-demo/main.go:143— cmd/monitor-demo/main.go:143-150 | cmd/ares/demo.go:157-164 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/monitor-demo/main.go:143` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) examples/11-knowledge-import/main.go:640— examples/11-knowledge-import/main.go:640-647 | examples/11-knowledge-import/store.go:250-257 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `examples/11-knowledge-import/main.go:640` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) internal/agents/leader/agent.go:400— internal/agents/leader/agent.go:400-407 | internal/agents/leader/agent.go:415-422 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) internal/agents/leader/agent.go:769— internal/agents/leader/agent.go:769-776 | internal/agents/leader/agent.go:840-847 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/agents/leader/agent.go:769` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) internal/api_impl/adapters.go:22— internal/api_impl/adapters.go:22-29 | internal/api_impl/adapters.go:75-82 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) internal/ares_events/memory_summary_repo.go:163— internal/ares_events/memory_summary_repo.go:163-171 | internal/ares_events/memory_summary_repo.go:187-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 (8 lines × 2) internal/ares_evolution/genome/adaptive.go:599— internal/ares_evolution/genome/adaptive.go:599-606 | internal/ares_evolution/genome/population_guard.go:90-97 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_evolution/genome/adaptive.go:599` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) internal/ares_memory/manager.go:213— internal/ares_memory/manager.go:213-220 | internal/ares_memory/production_manager.go:602-609 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_memory/manager.go:213` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) internal/ares_runtime/bus.go:159— internal/ares_runtime/bus.go:159-166 | internal/ares_runtime/bus.go:183-190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_runtime/bus.go:159` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) internal/discovery/providers/filesystem.go:158— internal/discovery/providers/filesystem.go:158-165 | internal/discovery/providers/filesystem.go:188-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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/discovery/providers/filesystem.go:158` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) internal/knowledge/mcp/mcp.go:124— internal/knowledge/mcp/mcp.go:124-131 | internal/knowledge/mcp/mcp.go:261-268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) internal/knowledge/provider/mysql/provider.go:153— internal/knowledge/provider/mysql/provider.go:153-160 | internal/knowledge/provider/postgres/provider.go:175-182 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/knowledge/provider/mysql/provider.go:153` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) internal/llm/output/openai.go:103— internal/llm/output/openai.go:103-110 | internal/llm/output/openai.go: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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/llm/output/openai.go:103` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (8 lines × 2) internal/llm/output/openai.go:174— internal/llm/output/openai.go:174-181 | internal/llm/output/openai.go:411-418 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/llm/output/openai.go:174` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 2) internal/llm/output/openrouter.go:86— internal/llm/output/openrouter.go:86-93 | internal/llm/output/openrouter.go:154-161 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/llm/output/openrouter.go:86` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (8 lines × 2) internal/memoryservice/service.go:252— internal/memoryservice/service.go:252-259 | internal/tools/resources/builtin/memory/memory_tools.go:80-87 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/memoryservice/service.go:252` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) internal/storage/postgres/repositories/task_result_repository.go:406— internal/storage/postgres/repositories/task_result_repository.go:406-413 | internal/storage/postgres/repositories/task_result_repository.go:491-498 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/repositories/task_result_repository.go:406` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) internal/workflow/engine/mutable_dag.go:100— internal/workflow/engine/mutable_dag.go:100-108 | internal/workflow/engine/types.go:255-262 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/workflow/engine/mutable_dag.go:100` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13 lines × 2) cmd/flight/main.go:208— cmd/flight/main.go:208-221 | cmd/ares/flight.go:156-168 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/flight/main.go:208` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) internal/agents/leader/agent.go:751— internal/agents/leader/agent.go:751-763 | internal/agents/leader/agent.go:843-855 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/agents/leader/agent.go:751` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13 lines × 2) internal/agents/sub/agent.go:227— internal/agents/sub/agent.go:227-239 | internal/agents/sub/agent.go: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 `internal/agents/sub/agent.go:227` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (13 lines × 2) internal/ares_evolution/experience/memory_store.go:155— internal/ares_evolution/experience/memory_store.go:155-167 | internal/ares_evolution/experience/memory_store.go:262-274 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_evolution/experience/memory_store.go:155` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (13 lines × 2) internal/ares_evolution/experience/normalizer.go:286— internal/ares_evolution/experience/normalizer.go:286-299 | internal/ares_evolution/experience/normalizer.go:374-386 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_evolution/experience/normalizer.go:286` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13 lines × 2) internal/ares_evolution/experience/types.go:245— internal/ares_evolution/experience/types.go:245-258 | internal/ares_evolution/experience/types.go:332-344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_evolution/experience/types.go:245` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) internal/ares_evolution/genome/adaptive.go:458— internal/ares_evolution/genome/adaptive.go:458-470 | internal/llm/output/validator.go:446-458 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_evolution/genome/adaptive.go:458` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) internal/ares_evolution/report.go:274— internal/ares_evolution/report.go:274-287 | internal/ares_evolution/report.go:315-327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_evolution/report.go:274` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) internal/discovery/providers/filesystem.go:135— internal/discovery/providers/filesystem.go:135-147 | internal/discovery/providers/filesystem.go:196-208 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/discovery/providers/filesystem.go:135` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) internal/knowledge/provider/postgres/provider.go:84— internal/knowledge/provider/postgres/provider.go:84-96 | internal/knowledge/provider/vector/provider.go:110-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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/knowledge/provider/postgres/provider.go:84` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) internal/llm/output/parser.go:369— internal/llm/output/parser.go:369-383 | internal/llm/output/parser.go:408-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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/llm/output/parser.go:369` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) internal/monitoring/dag/engine.go:271— internal/monitoring/dag/engine.go:271-283 | internal/monitoring/data/agent_tracker.go:32-45 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/monitoring/dag/engine.go:271` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) internal/monitoring/data/agent_tracker.go:189— internal/monitoring/data/agent_tracker.go:189-201 | internal/monitoring/data/cost_aggregator.go:39-51 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (13 lines × 2) internal/storage/postgres/repositories/task_result_repository.go:37— internal/storage/postgres/repositories/task_result_repository.go:37-49 | internal/storage/postgres/repositories/task_result_repository.go:204-217 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) internal/tools/planner/bridge.go:134— internal/tools/planner/bridge.go:134-149 | internal/tools/planner/bridge.go:189-201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tools/planner/bridge.go:134` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) internal/tools/resources/builtin/execution/code_runner.go:350— internal/tools/resources/builtin/execution/code_runner.go:350-362 | internal/tools/resources/builtin/execution/code_runner.go:404-416 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tools/resources/builtin/execution/code_runner.go:350` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) internal/tools/resources/builtin/file/file_tools.go:249— internal/tools/resources/builtin/file/file_tools.go:249-261 | internal/tools/resources/builtin/file/file_tools.go:336-348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tools/resources/builtin/file/file_tools.go:249` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) internal/workflow/engine/reloader.go:335— internal/workflow/engine/reloader.go:335-347 | internal/workflow/engine/reloader.go:355-367 — both copies are in the same file, so extract the block into 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) cmd/ares/db_check_rls.go:34— cmd/ares/db_check_rls.go:34-46 | cmd/check_rls/main.go:15-28 — before extracting anything, compare `cmd/ares/db_check_rls.go` and `cmd/check_rls/main.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/ares/db_check_rls.go:34` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) internal/ares_evolution/genome/population_guard.go:487— internal/ares_evolution/genome/population_guard.go:487-499 | internal/ares_evolution/genome/population_guard.go:543-555 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_evolution/genome/population_guard.go:487` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) internal/ares_memory/manager_rag.go:43— internal/ares_memory/manager_rag.go:43-57 | internal/ares_memory/production_manager_rag.go:44-56 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_memory/manager_rag.go:43` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) cmd/monitor-demo/main.go:102— cmd/monitor-demo/main.go:102-116 | cmd/ares/demo.go:117-130 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/monitor-demo/main.go:102` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) cmd/monitor-live/agents.go:209— cmd/monitor-live/agents.go:209-222 | cmd/ares/agents.go:206-219 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/monitor-live/agents.go:209` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) cmd/monitor-live/bridge.go:77— cmd/monitor-live/bridge.go:77-92 | cmd/ares/bridge.go:65-78 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/monitor-live/bridge.go:77` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) internal/ares_flight/collector.go:53— internal/ares_flight/collector.go:53-66 | internal/ares_flight/genealogy_collector.go:29-42 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_flight/collector.go:53` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) internal/ares_memory/distillation/resolver.go:152— internal/ares_memory/distillation/resolver.go:152-165 | internal/ares_memory/manager_impl.go:675-688 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_memory/distillation/resolver.go:152` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) internal/ares_quant/marketmaking_api/paper.go:136— internal/ares_quant/marketmaking_api/paper.go:136-149 | internal/ares_quant/marketmaking_api/paper.go:182-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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_quant/marketmaking_api/paper.go:136` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) internal/knowledge/mcp/mcp.go:106— internal/knowledge/mcp/mcp.go:106-119 | internal/knowledge/mcp/mcp.go:143-156 — both copies are in the same file, so extract the block into 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) internal/knowledge/pipeline/llm_summarizer.go:40— internal/knowledge/pipeline/llm_summarizer.go:40-53 | internal/knowledge/pipeline/normalizer.go:90-103 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) internal/llm/client.go:415— internal/llm/client.go:415-428 | internal/llm/generate.go:137-150 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/llm/client.go:415` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) internal/llm/output/openai.go:141— internal/llm/output/openai.go:141-154 | internal/llm/output/openrouter.go:121-134 — before extracting anything, compare `internal/llm/output/openai.go` and `internal/llm/output/openrouter.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 126 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 `internal/llm/output/openai.go:141` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) internal/storage/postgres/embedding/cache.go:370— internal/storage/postgres/embedding/cache.go:370-383 | internal/storage/postgres/query/memory_cache.go:103-116 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/embedding/cache.go:370` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (14 lines × 2) internal/storage/postgres/repositories/experience_repository.go:274— internal/storage/postgres/repositories/experience_repository.go:274-287 | internal/storage/postgres/repositories/task_result_repository.go:349-365 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/repositories/experience_repository.go:274` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14 lines × 2) internal/storage/postgres/repositories/secret_repository.go:362— internal/storage/postgres/repositories/secret_repository.go:362-376 | internal/storage/postgres/repositories/secret_repository.go:551-564 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14 lines × 2) internal/tools/planner/evidence.go:138— internal/tools/planner/evidence.go:138-151 | internal/tools/planner/scorer.go:56-70 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tools/planner/evidence.go:138` 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.
D38 · OSV Dependency Vulnerabilities· Medium CVE · ×13
Medium CVE: [GHSA redacted] services/embedding/uv.lock— aiohttp 3.13.3: [GHSA redacted] — upgrade to 3.14.1. This is 1 of 21 advisories with a published fix this scan raises against aiohttp 3.13.3, and their fixed versions do not agree — anything below 3.14.1 still leaves at least one of them open. Take this package to 3.14.1 or later: that is the floor for the package, not this row's target alone. This one row stands for the 21 advisories this scan raises against aiohttp 3.13.3: [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], PYSEC-2026-2095, PYSEC-2026-2096, PYSEC-2026-2099, PYSEC-2026-2100, PYSEC-2026-2101, PYSEC-2026-2102, PYSEC-2026-2106, PYSEC-2026-2112, PYSEC-2026-2113, PYSEC-2026-237.
Medium CVE: PYSEC-2026-2132 services/embedding/uv.lock— click 8.3.1: PYSEC-2026-2132 — click is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or constrain click to >=8.3.3 in your constraints/requirements file).
Medium CVE: [GHSA redacted] go.mod— github.com/quic-go/quic-go 0.59.0: [GHSA redacted] — github.com/quic-go/quic-go is not a DIRECT requirement of this module: go.mod records it as `// indirect`, pulled in transitively, so raise it in place (run `go get github.com/quic-go/quic-go@v0.59.1`, which updates the require line go.mod already holds for it).
Medium CVE: [GHSA redacted] go.mod— golang.org/x/net 0.51.0: [GHSA redacted] — golang.org/x/net is not a DIRECT requirement of this module: go.mod records it as `// indirect`, pulled in transitively, so raise it in place (run `go get golang.org/x/net@v0.55.0`, which updates the require line go.mod already holds for it). This one row stands for the 8 advisories this scan raises against golang.org/x/net 0.51.0: [GHSA redacted], GO-2026-4918, GO-2026-5025, GO-2026-5026, GO-2026-5027, GO-2026-5029, GO-2026-5030, GO-2026-5942.
Medium CVE: GO-2026-5024 go.mod— golang.org/x/sys 0.42.0 (golang.org/x/sys/windows): GO-2026-5024 — golang.org/x/sys is not a DIRECT requirement of this module: go.mod records it as `// indirect`, pulled in transitively, so raise it in place (run `go get golang.org/x/sys@v0.44.0`, which updates the require line go.mod already holds for it).
Medium CVE: GO-2026-5970 go.mod— golang.org/x/text 0.35.0 (golang.org/x/text/unicode/norm): GO-2026-5970 — upgrade to 0.39.0
Medium CVE: [GHSA redacted] services/embedding/uv.lock— idna 3.11: [GHSA redacted] — idna is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or constrain idna to >=3.15 in your constraints/requirements file).
Medium CVE: PYSEC-2026-2987 services/embedding/uv.lock— pygments 2.19.2: PYSEC-2026-2987 — pygments is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or constrain pygments to >=2.20.0 in your constraints/requirements file).
Medium CVE: [GHSA redacted] services/embedding/uv.lock— pytest 9.0.2: [GHSA redacted] — upgrade to 9.0.3
Medium CVE: [GHSA redacted] services/embedding/uv.lock— requests 2.32.5: [GHSA redacted] — upgrade to 2.33.0
Medium CVE: [GHSA redacted] services/embedding/uv.lock— setuptools 82.0.1: [GHSA redacted] — setuptools is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or constrain setuptools to >=83.0.0 in your constraints/requirements file).
Medium CVE: GO-2026-4864 go.mod— stdlib 1.26.1 (internal/syscall/unix): GO-2026-4864 — fixed in Go 1.26.2; pin a build toolchain at or above it (go.mod `toolchain` directive, or your CI's Go version) — the `go` directive is a minimum language version, not the compiler that builds your binaries. This one row stands for the 20 advisories this scan raises against stdlib 1.26.1: GO-2026-4864, GO-2026-4865, GO-2026-4866, GO-2026-4869, GO-2026-4870, GO-2026-4918, GO-2026-4946, GO-2026-4947, GO-2026-4970, GO-2026-4971, GO-2026-4976, GO-2026-4977, GO-2026-4980, GO-2026-4981, GO-2026-4982, GO-2026-4986, GO-2026-5037, GO-2026-5038, GO-2026-5039, GO-2026-5856.
Medium CVE: PYSEC-2026-139 services/embedding/uv.lock— torch 2.10.0: PYSEC-2026-139 — no fixed version has been published yet. Track the advisory, and remove or replace torch if the exposure is not acceptable until one lands. This one row stands for the 2 advisories this scan raises against torch 2.10.0: [GHSA redacted], PYSEC-2026-139.
FileTooLong: static/app.js internal/monitoring/static/app.js:0— FileTooLong — 1932 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). 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: openai_api/openai_api.go compat/protocol/openai_api/openai_api.go:0— FileTooLong — 724 significant lines (blank, comment-only and punctuation-only lines excluded). 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: sdk/sdk.go sdk/sdk.go:0— FileTooLong — 647 significant lines (blank, comment-only and punctuation-only lines excluded). 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: arena/main.go cmd/arena/main.go:0— FileTooLong — 580 significant lines (blank, comment-only and punctuation-only lines excluded). 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: dashboard/orchestrator.go internal/dashboard/orchestrator.go:0— FileTooLong — 552 significant lines (blank, comment-only and punctuation-only lines excluded). 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: math/calculator.go internal/tools/resources/builtin/math/calculator.go:0— FileTooLong — 548 significant lines (blank, comment-only and punctuation-only lines excluded). 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: ares_evolution/genome_wiring_system.go internal/ares_evolution/genome_wiring_system.go:0— FileTooLong — 547 significant lines (blank, comment-only and punctuation-only lines excluded). 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: dashboard/api_handlers.go internal/dashboard/api_handlers.go:0— FileTooLong — 542 significant lines (blank, comment-only and punctuation-only lines excluded). 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: service/service.go internal/ares_evolution/service/service.go:0— FileTooLong — 525 significant lines (blank, comment-only and punctuation-only lines excluded). 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: portfolio/simulator.go internal/ares_quant/portfolio/simulator.go:0— FileTooLong — 515 significant lines (blank, comment-only and punctuation-only lines excluded). 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: ares_evolution/dream_cycle.go internal/ares_evolution/dream_cycle.go:0— FileTooLong — 509 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
Hotspot: internal/agents/leader/agent.go internal/agents/leader/agent.go— internal/agents/leader/agent.go changed 29 times in last 90 days, max complexity 39. 6 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: internal/ares_evolution/genome/population.go internal/ares_evolution/genome/population.go— internal/ares_evolution/genome/population.go changed 30 times in last 90 days, max complexity 26. 6 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: internal/ares_evolution/service/service.go internal/ares_evolution/service/service.go— internal/ares_evolution/service/service.go changed 21 times in last 90 days, max complexity 32. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: internal/llm/client.go internal/llm/client.go— internal/llm/client.go changed 27 times in last 90 days, max complexity 23. 7 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: internal/ares_evolution/genome_wiring_system.go internal/ares_evolution/genome_wiring_system.go— internal/ares_evolution/genome_wiring_system.go changed 22 times in last 90 days, max complexity 28. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: internal/ares_bootstrap/bootstrap.go internal/ares_bootstrap/bootstrap.go— internal/ares_bootstrap/bootstrap.go changed 21 times in last 90 days, max complexity 27. 1 of those changes was a fix/bug commit, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: internal/monitoring/static/app.js internal/monitoring/static/app.js— internal/monitoring/static/app.js changed 5 times in last 90 days, max complexity 104. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: sdk/sdk.go sdk/sdk.go— sdk/sdk.go changed 20 times in last 90 days, max complexity 24. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: internal/dashboard/orchestrator.go internal/dashboard/orchestrator.go— internal/dashboard/orchestrator.go changed 17 times in last 90 days, max complexity 28. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Hotspot: internal/agents/leader/supervisor.go internal/agents/leader/supervisor.go— internal/agents/leader/supervisor.go changed 16 times in last 90 days, max complexity 27. 2 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, 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.
Duplicated block (16 lines × 2) cmd/flight/main.go:266— cmd/flight/main.go:266-282 | cmd/ares/flight.go:209-224 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/flight/main.go:266` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) cmd/monitor-live/agents.go:110— cmd/monitor-live/agents.go:110-125 | cmd/ares/agents.go:108-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. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/monitor-live/agents.go:110` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) internal/ares_evolution/scoring/memory_aware_scorer.go:380— internal/ares_evolution/scoring/memory_aware_scorer.go:380-395 | internal/ares_evolution/scoring/memory_aware_scorer.go:457-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 (16 lines × 2) internal/ares_memory/manager_impl.go:66— internal/ares_memory/manager_impl.go:66-81 | internal/ares_memory/manager_impl.go:106-121 — both copies are in the same file, so extract the block into 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) internal/ares_memory/manager_impl.go:383— internal/ares_memory/manager_impl.go:383-398 | internal/ares_memory/production_manager.go:690-705 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 2) internal/ares_security/sanitizer.go:223— internal/ares_security/sanitizer.go:223-238 | internal/ares_security/sanitizer.go:279-294 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_security/sanitizer.go:223` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) internal/knowledge/provider/code/provider.go:78— internal/knowledge/provider/code/provider.go:78-93 | internal/knowledge/provider/memory/provider.go:64-79 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/knowledge/provider/code/provider.go:78` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 2) internal/monitoring/data/agent_tracker.go:158— internal/monitoring/data/agent_tracker.go:158-173 | internal/monitoring/data/agent_tracker.go:217-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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 2) internal/storage/postgres/repositories/task_result_repository.go:333— internal/storage/postgres/repositories/task_result_repository.go:333-348 | internal/storage/postgres/repositories/task_result_repository.go:426-441 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/repositories/task_result_repository.go:333` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) internal/ares_archive/extract.go:350— internal/ares_archive/extract.go:350-365 | internal/ares_archive/extract.go:435-450 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_archive/extract.go:350` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) cmd/flight/main.go:354— cmd/flight/main.go:354-368 | cmd/ares/flight.go:289-303 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/flight/main.go:354` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) internal/agents/memory_repository_impl.go:138— internal/agents/memory_repository_impl.go:138-152 | internal/retrievalservice/memory_repository.go:270-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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/agents/memory_repository_impl.go:138` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) internal/agents/service_impl.go:40— internal/agents/service_impl.go:40-54 | internal/memoryservice/service.go:39-53 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/agents/service_impl.go:40` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) internal/agents/service_impl.go:282— internal/agents/service_impl.go:282-304 | internal/retrievalservice/service.go:277-291 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `internal/agents/service_impl.go:282` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) internal/ares_evolution/genome/adaptive.go:235— internal/ares_evolution/genome/adaptive.go:235-249 | internal/ares_evolution/genome/adaptive.go:421-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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_evolution/genome/adaptive.go:235` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15 lines × 2) internal/ares_evolution/genome/selection.go:371— internal/ares_evolution/genome/selection.go:371-387 | internal/ares_evolution/genome/selection.go:680-694 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_evolution/genome/selection.go:371` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15 lines × 2) internal/evolution/genome/scheduler_genome.go:129— internal/evolution/genome/scheduler_genome.go:129-143 | internal/evolution/genome/workflow_genome.go:186-201 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/evolution/genome/scheduler_genome.go:129` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) internal/llm/output/parser.go:38— internal/llm/output/parser.go:38-52 | internal/llm/output/parser.go:364-378 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/llm/output/parser.go:38` 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.
TooManyMethods: APIv2 internal/dashboard/api.go:79— TooManyMethods — 50 methods, declared across 2 files: dashboard/api_handlers.go (36), dashboard/api.go (14). 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: Population internal/ares_evolution/genome/population.go:28— TooManyMethods — 49 methods, declared across 4 files: genome/population.go (19), genome/adaptive.go (11), genome/population_guard.go (10), genome/population_history.go (9). 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: RetrievalService internal/storage/postgres/services/retrieval_service.go:147— TooManyMethods — 46 methods, declared across 5 files: services/retrieval_search.go (21), services/retrieval_rewrite.go (12), services/retrieval_service.go (9), services/retrieval_embedding.go (2), +1 more file(s). 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: ExecutionScope internal/workflow/scope.go:149— TooManyMethods — 40 methods, declared across 2 files: workflow/scope.go (31), workflow/scope_recovery.go (9). 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: Runner internal/workflow/runner.go:56— TooManyMethods — 37 methods, declared across 7 files: workflow/runner_execution.go (14), workflow/runner_checkpoint.go (11), workflow/runner_plugins.go (6), workflow/runner.go (2), +3 more file(s). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Manager internal/ares_runtime/manager.go:41— TooManyMethods — 31 methods, declared across 3 files: ares_runtime/manager.go (15), ares_runtime/manager_chaos.go (10), ares_runtime/manager_lifecycle.go (6). 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: Calculator internal/tools/resources/builtin/math/calculator.go:21— TooManyMethods — 31 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (7 lines × 2) cmd/embedding-mcp/main.go:108— cmd/embedding-mcp/main.go:108-114 | cmd/embedding-mcp/main.go:172-178 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/embedding-mcp/main.go:108` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) cmd/monitor-demo/main.go:176— cmd/monitor-demo/main.go:176-182 | cmd/ares/demo.go:190-196 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/monitor-demo/main.go:176` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) internal/agents/sub/agent.go:308— internal/agents/sub/agent.go:308-314 | internal/agents/sub/agent.go:400-406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/agents/sub/agent.go:308` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) internal/ares_runtime/bus.go:101— internal/ares_runtime/bus.go:101-107 | internal/ares_runtime/bus.go:132-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. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_runtime/bus.go:101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) internal/dashboard/orchestrator.go:442— internal/dashboard/orchestrator.go:442-448 | internal/dashboard/orchestrator.go:487-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 (7 lines × 2) internal/llm/output/openrouter.go:77— internal/llm/output/openrouter.go:77-83 | internal/llm/output/openrouter.go:145-151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/llm/output/openrouter.go:77` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) internal/tools/resources/builtin/embedding/embedding.go:149— internal/tools/resources/builtin/embedding/embedding.go:149-155 | internal/tools/resources/builtin/embedding/embedding.go:201-207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tools/resources/builtin/embedding/embedding.go:149` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) cmd/ares/mcp_adapter.go:30— cmd/ares/mcp_adapter.go:30-35 | cmd/monitor-live/mcp_adapter.go:30-35 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/ares/mcp_adapter.go:30` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) cmd/monitor-demo/main.go:155— cmd/monitor-demo/main.go:155-160 | cmd/ares/demo.go:169-174 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/monitor-demo/main.go:155` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) cmd/monitor-live/agents.go:34— cmd/monitor-live/agents.go:34-39 | cmd/ares/agents.go:35-40 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) internal/ares_events/compactor.go:412— internal/ares_events/compactor.go:412-417 | internal/ares_events/compactor.go:422-427 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_events/compactor.go:412` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) internal/storage/postgres/recommend.go:100— internal/storage/postgres/recommend.go:100-105 | internal/storage/postgres/recommend.go:177-182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/recommend.go:100` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) cmd/ares/db_check_rls.go:69— cmd/ares/db_check_rls.go:69-74 | cmd/check_rls/main.go:55-62 — before extracting anything, compare `cmd/ares/db_check_rls.go` and `cmd/check_rls/main.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/ares/db_check_rls.go:69` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) internal/ares_quant/research/memory_store.go:145— internal/ares_quant/research/memory_store.go:145-153 | internal/ares_quant/research/memory_store.go:185-193 | internal/ares_quant/research/memory_store.go:279-287 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_quant/research/memory_store.go:145` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (9 lines × 3) internal/evolution/patch/patch.go:326— internal/evolution/patch/patch.go:326-334 | internal/evolution/patch/patch.go:359-367 | internal/evolution/patch/patch.go:374-382 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/evolution/patch/patch.go:326` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) internal/ares_evolution/genome/population_guard.go:427— internal/ares_evolution/genome/population_guard.go:427-435 | internal/ares_evolution/genome/population_guard.go:492-501 | internal/ares_evolution/genome/population_guard.go:548-557 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_evolution/genome/population_guard.go:427` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) internal/dashboard/api_handlers.go:757— internal/dashboard/api_handlers.go:757-765 | internal/dashboard/api_handlers.go:769-777 | internal/dashboard/api_handlers.go:796-804 — 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 (5 lines × 2) internal/storage/postgres/repositories/knowledge_repository.go:476— internal/storage/postgres/repositories/knowledge_repository.go:476-480 | internal/storage/postgres/repositories/knowledge_repository.go:561-565 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/repositories/knowledge_repository.go:476` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) internal/storage/postgres/session.go:91— internal/storage/postgres/session.go:91-95 | internal/storage/postgres/session.go:195-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/session.go:91` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) internal/tools/resources/builtin/math/calculator.go:286— internal/tools/resources/builtin/math/calculator.go:286-290 | internal/tools/resources/builtin/math/calculator.go:301-305 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tools/resources/builtin/math/calculator.go:286` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) internal/tools/resources/builtin/memory/memory_tools.go:287— internal/tools/resources/builtin/memory/memory_tools.go:287-291 | internal/tools/resources/builtin/memory/memory_tools.go:305-309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tools/resources/builtin/memory/memory_tools.go:287` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) cmd/ares/actions.go:49— cmd/ares/actions.go:49-66 | cmd/monitor-live/actions.go:48-65 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/ares/actions.go:49` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) cmd/monitor-live/agents.go:150— cmd/monitor-live/agents.go:150-167 | cmd/ares/agents.go:148-165 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/monitor-live/agents.go:150` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) cmd/monitor-live/agents.go:234— cmd/monitor-live/agents.go:234-251 | cmd/ares/agents.go:231-248 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/monitor-live/agents.go:234` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) cmd/flight/main.go:400— cmd/flight/main.go:400-416 | cmd/ares/flight.go:330-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. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/flight/main.go:400` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) internal/ares_evolution/genome/crossover.go:343— internal/ares_evolution/genome/crossover.go:343-359 | internal/ares_evolution/genome/crossover.go:408-424 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_evolution/genome/crossover.go:343` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) cmd/ares/db_check_rls.go:83— cmd/ares/db_check_rls.go:83-99 | cmd/check_rls/main.go:71-88 — before extracting anything, compare `cmd/ares/db_check_rls.go` and `cmd/check_rls/main.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/ares/db_check_rls.go:83` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 3) internal/llm/client.go:731— internal/llm/client.go:731-744 | internal/llm/output/openai.go:296-309 | internal/llm/output/openrouter.go:274-287 — before extracting anything, compare `internal/llm/output/openai.go` and `internal/llm/output/openrouter.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 126 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 `internal/llm/client.go:731` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 3) internal/storage/postgres/repositories/experience_repository.go:338— internal/storage/postgres/repositories/experience_repository.go:338-351 | internal/storage/postgres/repositories/experience_repository.go:395-408 | internal/storage/postgres/repositories/experience_repository.go:482-495 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/repositories/experience_repository.go:338` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 3) cmd/arena/main.go:534— cmd/arena/main.go:534-547 | cmd/arena/main.go:562-575 | cmd/arena/main.go:590-603 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/arena/main.go:534` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (11 lines × 3) examples/02-tool-calling/main.go:24— examples/02-tool-calling/main.go:24-34 | examples/04-multi-agent/main.go:21-31 | examples/05-evolution-demo/main.go:29-39 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `examples/02-tool-calling/main.go:24` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) internal/llm/output/ollama.go:180— internal/llm/output/ollama.go:180-190 | internal/llm/output/openai.go:249-259 | internal/llm/output/openrouter.go:227-237 — before extracting anything, compare `internal/llm/output/openai.go` and `internal/llm/output/openrouter.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 126 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 `internal/llm/output/ollama.go:180` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (11 lines × 3) internal/tools/resources/builtin/text/data_transform.go:61— internal/tools/resources/builtin/text/data_transform.go:61-71 | internal/tools/resources/builtin/text/data_validation.go:52-62 | internal/tools/resources/builtin/text/json_tools.go:58-68 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tools/resources/builtin/text/data_transform.go:61` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) internal/llm/client.go:689— internal/llm/client.go:689-698 | internal/llm/output/openai.go:251-260 | internal/llm/output/openrouter.go:229-238 — before extracting anything, compare `internal/llm/output/openai.go` and `internal/llm/output/openrouter.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 126 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 `internal/llm/client.go:689` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (10 lines × 3) internal/tools/resources/builtin/embedding/embedding.go:117— internal/tools/resources/builtin/embedding/embedding.go:117-126 | internal/tools/resources/builtin/embedding/embedding.go:159-168 | internal/tools/resources/builtin/embedding/embedding.go:211-220 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/tools/resources/builtin/embedding/embedding.go:117` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 3) cmd/create_distilled_table/main.go:102— cmd/create_distilled_table/main.go:102-111 | cmd/migrate_db/main.go:97-106 | cmd/setup_test_db/main.go:91-100 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/create_distilled_table/main.go:102` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
(anonymous) (cyclomatic 21) internal/monitoring/static/app.js:600— (anonymous) has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
(anonymous) (cyclomatic 21) internal/dashboard/static/app.js:183— (anonymous) has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
main.run (cyclomatic 19) examples/11-knowledge-import/akg/main.go:76— main.run 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.
main.run (cyclomatic 19) examples/eval/main.go:25— main.run has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 156, 65, 95, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
main.printReport (cognitive 22) cmd/arena/main.go:850— main.printReport has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, loops 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.
main.printReport (cognitive 22) cmd/ares/arena.go:561— main.printReport has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, loops 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.
actionHandler.handleChaos (cognitive 19) cmd/ares/actions.go:88— actionHandler.handleChaos has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, loops 4, 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.
actionHandler.handleChaos (cognitive 19) cmd/monitor-live/actions.go:87— actionHandler.handleChaos has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, loops 4, 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.
(anonymous) (cognitive 18) internal/monitoring/static/app.js:303— (anonymous) has cognitive complexity 18 (threshold 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.
(anonymous) (cognitive 18) internal/dashboard/static/app.js:183— (anonymous) has cognitive complexity 18 (threshold 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.
Duplicated block (15 lines × 3) internal/ares_evolution/genome/selection.go:335— internal/ares_evolution/genome/selection.go:335-349 | internal/ares_evolution/genome/selection.go:569-583 | internal/ares_evolution/genome/selection.go:707-721 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_evolution/genome/selection.go:335` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 3) internal/storage/postgres/repositories/experience_repository.go:522— internal/storage/postgres/repositories/experience_repository.go:522-536 | internal/storage/postgres/repositories/knowledge_repository.go:748-762 | internal/storage/postgres/repositories/task_result_repository.go:557-571 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/repositories/experience_repository.go:522` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 3) internal/ares_events/summary_repository.go:128— internal/ares_events/summary_repository.go:128-140 | internal/ares_events/summary_repository.go:167-179 | internal/ares_events/summary_repository.go:206-218 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/ares_events/summary_repository.go:128` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 3) internal/storage/postgres/repositories/knowledge_repository.go:564— internal/storage/postgres/repositories/knowledge_repository.go:564-576 | internal/storage/postgres/repositories/knowledge_repository.go:627-639 | internal/storage/postgres/repositories/knowledge_repository.go:702-714 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/repositories/knowledge_repository.go:564` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) examples/05-evolution-demo/main.go:55— examples/05-evolution-demo/main.go:55-61 | examples/07-human-in-loop/main.go:72-78 | examples/08-mcp-integration/main.go:67-73 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `examples/05-evolution-demo/main.go:55` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) cmd/create_distilled_table/main.go:114— cmd/create_distilled_table/main.go:114-120 | cmd/migrate_db/main.go:109-115 | cmd/setup_test_db/main.go:103-109 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/create_distilled_table/main.go:114` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) internal/storage/postgres/repositories/knowledge_repository.go:333— internal/storage/postgres/repositories/knowledge_repository.go:333-339 | internal/storage/postgres/repositories/knowledge_repository.go:623-628 | internal/storage/postgres/repositories/knowledge_repository.go:698-703 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/repositories/knowledge_repository.go:333` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 3) internal/storage/postgres/repositories/knowledge_repository.go:556— internal/storage/postgres/repositories/knowledge_repository.go:556-561 | internal/storage/postgres/repositories/knowledge_repository.go:619-624 | internal/storage/postgres/repositories/knowledge_repository.go:694-699 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/repositories/knowledge_repository.go:556` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) examples/13-archive-akg-chain/main.go:60— examples/13-archive-akg-chain/main.go:60-64 | examples/runtime_evolution/full/main.go:105-109 | examples/runtime_evolution/knowledge/main.go:29-33 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `examples/13-archive-akg-chain/main.go:60` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) internal/storage/postgres/repositories/task_result_repository.go:163— internal/storage/postgres/repositories/task_result_repository.go:163-168 | internal/storage/postgres/repositories/task_result_repository.go:413-417 | internal/storage/postgres/repositories/task_result_repository.go:498-502 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `internal/storage/postgres/repositories/task_result_repository.go:163` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note 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.
renderDetailDrawer (cyclomatic 104) internal/monitoring/static/app.js:2317— renderDetailDrawer has cyclomatic complexity 104 (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.
Config.setDefaults (cyclomatic 55) internal/ares_config/config_defaults.go:30— Config.setDefaults has cyclomatic complexity 55 (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.
Compactor.buildSummary (cyclomatic 48) internal/ares_events/compactor.go:158— Compactor.buildSummary has cyclomatic complexity 48 (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.
Validator.validateValue (cyclomatic 40) internal/llm/output/validator.go:78— Validator.validateValue 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.
leaderAgent.ProcessStream (cyclomatic 39) internal/agents/leader/agent.go:662— leaderAgent.ProcessStream has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 5 of the 39 points are its own statements and the rest belongs to one function literal inside it that branches (line 710). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
MultiAssetSimulator.RunMultiAssetSimulation (cyclomatic 37) internal/ares_quant/portfolio/simulator.go:445— MultiAssetSimulator.RunMultiAssetSimulation has cyclomatic complexity 37 (threshold 15). Of this number, 35 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MutableDAG.ReplaceNode (cyclomatic 36) internal/workflow/engine/mutable_dag.go:629— MutableDAG.ReplaceNode 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.
showDAGTooltip (cyclomatic 34) internal/monitoring/static/app.js:1333— showDAGTooltip has cyclomatic complexity 34 (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.
UserProfile.Execute (cyclomatic 33) internal/tools/resources/builtin/memory/memory_tools.go:151— UserProfile.Execute has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
(anonymous) (cyclomatic 33) internal/monitoring/static/app.js:713— (anonymous) has cyclomatic complexity 33 (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.
Service.CreateWiredSystem (cyclomatic 32) internal/ares_evolution/service/service.go:130— Service.CreateWiredSystem has cyclomatic complexity 32 (threshold 15). Of this number, 24 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ares_events.DefaultSummarizer (cyclomatic 31) internal/ares_events/compactor.go:321— ares_events.DefaultSummarizer 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.
FileTools.listFiles (cyclomatic 31) internal/tools/resources/builtin/file/file_tools.go:400— FileTools.listFiles has cyclomatic complexity 31 (threshold 15). Of this number, 20 points are the body's own statements and 11 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
main.runServe (cyclomatic 29) cmd/ares/serve.go:62— main.runServe has cyclomatic complexity 29 (threshold 15). Of this number, 21 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
main.main (cyclomatic 29) cmd/embedding-mcp/main.go:56— main.main has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 8 of the 29 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 152, 92, 212, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
renderDAG (cyclomatic 29) internal/monitoring/static/app.js:396— renderDAG has cyclomatic complexity 29 (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.
evolution.RunIdleEvolution (cyclomatic 28) internal/ares_evolution/genome_wiring_system.go:678— evolution.RunIdleEvolution has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Manager.executePhase (cyclomatic 28) internal/ares_shutdown/manager.go:141— Manager.executePhase has cyclomatic complexity 28 (threshold 15). Of this number, 21 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Orchestrator.runAgent (cyclomatic 28) internal/dashboard/orchestrator.go:369— Orchestrator.runAgent has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LeaderSupervisor.doFailover (cyclomatic 27) internal/agents/leader/supervisor.go:209— LeaderSupervisor.doFailover has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
arena.ValidateAction (cyclomatic 27) internal/ares_arena/http.go:585— arena.ValidateAction has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Service.Execute (cyclomatic 27) internal/ares_arena/service.go:70— Service.Execute has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ares_bootstrap.Bootstrap (cyclomatic 27) internal/ares_bootstrap/bootstrap.go:67— ares_bootstrap.Bootstrap has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
arena.RunScenarioReport (cyclomatic 26) internal/ares_arena/scenario.go:116— arena.RunScenarioReport has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Population.doEvolve (cyclomatic 26) internal/ares_evolution/genome/population.go:258— Population.doEvolve has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ExperienceExtractor.parseUserProfile (cyclomatic 26) internal/ares_memory/distillation/extractor.go:413— ExperienceExtractor.parseUserProfile has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HTTPRequest.Execute (cyclomatic 26) internal/tools/resources/builtin/network/http_request.go:69— HTTPRequest.Execute has cyclomatic complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Runner.ResumeExecution (cyclomatic 26) internal/workflow/runner_checkpoint.go:43— Runner.ResumeExecution has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
profileParser.parseResponse (cyclomatic 25) internal/agents/leader/profile.go:153— profileParser.parseResponse 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.
ares_bootstrap.wireGAEvolution (cyclomatic 25) internal/ares_bootstrap/bootstrap_steps.go:96— ares_bootstrap.wireGAEvolution has cyclomatic complexity 25 (threshold 15). Of this number, 15 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ExperienceGuidedMutator.chooseGuidedMutationType (cyclomatic 25) internal/ares_evolution/mutation/guided_mutator.go:403— ExperienceGuidedMutator.chooseGuidedMutationType 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.
ConfigFile.Validate (cyclomatic 25) sdk/config.go:148— ConfigFile.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.
ArenaAdapter.Execute (cyclomatic 24) internal/api_impl/adapters.go:165— ArenaAdapter.Execute 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.
Registry.ApplySet (cyclomatic 24) internal/evolution/patch/patch.go:303— Registry.ApplySet 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.
CodeProvider.Stream (cyclomatic 24) internal/knowledge/provider/code/provider.go:76— CodeProvider.Stream has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to one function literal inside it that branches (line 84). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
output.scanFixJSON (cyclomatic 24) internal/llm/output/parser.go:203— output.scanFixJSON 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.
KnowledgeRepository.CreateBatch (cyclomatic 24) internal/storage/postgres/repositories/knowledge_repository.go:178— KnowledgeRepository.CreateBatch has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StringUtils.Execute (cyclomatic 24) internal/tools/resources/builtin/stringutils/stringutils.go:67— StringUtils.Execute has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Agent.Run (cyclomatic 24) sdk/sdk.go:853— Agent.Run 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.
main.main (cyclomatic 23) examples/runtime_evolution/full/main.go:25— main.main has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
resultAggregator.Aggregate (cyclomatic 23) internal/agents/leader/aggregator.go:50— resultAggregator.Aggregate has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EventRecovery.RecoverFromEvents (cyclomatic 23) internal/agents/leader/event_recovery.go:54— EventRecovery.RecoverFromEvents 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.
MemoryPatchExecutor.Apply (cyclomatic 23) internal/ares_memory/memory_patcher.go:99— MemoryPatchExecutor.Apply 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.
DefaultReducer.Reduce (cyclomatic 23) internal/knowledge/runtime/components.go:63— DefaultReducer.Reduce 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.
Client.streamAnthropic (cyclomatic 23) internal/llm/client.go:522— Client.streamAnthropic has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 9 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 574). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
MemoryRepository.ListKnowledge (cyclomatic 23) internal/retrievalservice/memory_repository.go:227— MemoryRepository.ListKnowledge 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.
computeDAGLayout (cyclomatic 23) internal/monitoring/static/app.js:1098— computeDAGLayout has cyclomatic complexity 23 (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.
ConfigFile.validate (cyclomatic 22) api/client/config.go:403— ConfigFile.validate 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.
main.runEvolutionCycle (cyclomatic 22) cmd/ares/evolution.go:70— main.runEvolutionCycle 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.
PostgresEventStore.Append (cyclomatic 22) internal/ares_events/pg_store.go:45— PostgresEventStore.Append has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
evolution.NewWiredEvolutionSystem (cyclomatic 22) internal/ares_evolution/genome_wiring_system.go:454— evolution.NewWiredEvolutionSystem 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.
DateTime.Execute (cyclomatic 22) internal/tools/resources/builtin/math/calculator.go:565— DateTime.Execute 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.
WebSearch.Execute (cyclomatic 22) internal/tools/resources/builtin/network/web_search.go:128— WebSearch.Execute has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
apiimpl.StartService (cyclomatic 21) internal/api_impl/service.go:89— apiimpl.StartService has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ares_bootstrap.ProvideNewEvolution (cyclomatic 21) internal/ares_bootstrap/provide_new_evolution.go:73— ares_bootstrap.ProvideNewEvolution 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.
mutation.valuesEqual (cyclomatic 21) internal/ares_evolution/mutation/mutator.go:512— mutation.valuesEqual has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function taking that case's concrete type, so the dispatch reads one line per case. These arms are selected by TYPE rather than by value, so there is no key a lookup table could be built on; where you own the matched types, giving them one shared interface method and calling that is the form a table would have taken, and where you do not, keep the cases — they stay explicit and reviewable.
MMBacktestRunner.Run (cyclomatic 21) internal/ares_quant/marketmaking/mm_backtest.go:113— MMBacktestRunner.Run 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.
KnowledgePipeline.Process (cyclomatic 21) internal/knowledge/pipeline.go:107— KnowledgePipeline.Process 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.
Client.streamOpenRouter (cyclomatic 21) internal/llm/client.go:636— Client.streamOpenRouter has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 689). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
main.main (cyclomatic 20) examples/13-archive-akg-chain/main.go:24— main.main 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.
leaderAgent.ReplayEvents (cyclomatic 20) internal/agents/leader/agent.go:561— leaderAgent.ReplayEvents 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.
taskPlanner.Plan (cyclomatic 20) internal/agents/leader/planner.go:131— taskPlanner.Plan 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.
subAgent.ProcessStream (cyclomatic 20) internal/agents/sub/agent.go:321— subAgent.ProcessStream has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 358). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
RegressionTester.runAdaptive (cyclomatic 20) internal/ares_arena/regression.go:223— RegressionTester.runAdaptive has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DreamCycle.findWinner (cyclomatic 20) internal/ares_evolution/dream_cycle.go:781— DreamCycle.findWinner has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DefaultNormalizer.Normalize (cyclomatic 20) internal/ares_evolution/experience/normalizer.go:59— DefaultNormalizer.Normalize has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
memoryManager.StoreDistilledTask (cyclomatic 20) internal/ares_memory/manager_impl.go:497— memoryManager.StoreDistilledTask has cyclomatic complexity 20 (threshold 15). Of this number, 14 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
portfolio.LoadSignalsFromCSV (cyclomatic 20) internal/ares_quant/portfolio/csv_loader.go:32— portfolio.LoadSignalsFromCSV has cyclomatic complexity 20 (threshold 15). To reduce it, separate t...
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.