Public report of MemPalace/mempalace, published 25 October 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Watchdog signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 25 October 2026, 02:48 UTC · Survey ID cd_61add0977001438bb7aa0574b788264d

MemPalace/mempalace

Measured 25 October 2026, 02:40 UTC, at code version f41e8e7

No regression since the last survey

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

CAI score 62out of 100 At risk Down 3 since the last survey

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A medium codebase: 84,259 lines of product code in 5 projects, tests not counted · Estimated rebuild effort: about 1.5 person-years · Weakest lens: Accessibility, 55

Findings by how serious they are

18 critical 712 serious 110 minor

8 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
25 October 2026, 02:40 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that implements it, and today Watchdog is the only one that does.

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

69of 75 dimensions measured by tools. The other 6 are advisory notes from an AI model, which explain the code but don't count towards the score.
828of 840 findings point to an exact file and line, so you can open each one in the code. The other 12 concern the repository as a whole, such as missing documentation.
75dimensions across 7 lenses, read from 84,259 lines of product code in 5 projects.
Chapters

Executive summary

MemPalace/mempalace scores 62 out of 100, but it is rated At risk while a critical security finding is open; the score itself is unchanged.

The weakest lens counts most in the score, and here that is Accessibility, which scores 55 and is rated Adequate. Its Visual & motion safety dimension scores 2.2 out of 10, and until that reaches 4, Accessibility can't be rated higher than Adequate. The first actions are to the findings name the configuration each number was taken from and, for the assertions, the files that hold them and to keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1, and if Accessibility rose to 70, the score would rise from 62 to about 66.

18 findings are critical: ten in Dependency Vulnerabilities, six in Static Analysis (SAST) and two in IaC & Container Security.

Watchdog couldn't measure 8 dimensions in this code, among them Code Coverage, Dependency Hygiene and Navigability, so they are left out of the score. The product code is 84,259 lines, which would take an estimated 1.5 person-years, around €220,000, to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Accessibility 55 · counts for 46%Code Health 56 · counts for 25%Security and Compliance 76 · counts for 14%Maturity 80 · counts for 8%Production Readiness 81 · counts for 4%Performance 89 · counts for 2%Architecture 91 · counts for 1%

If Accessibility rose from 55 to 70, the lowest score rated Strong, the score would rise from 62 to about 66.

Code composition: what the lines of code are
Product code 42%Tests 58%
New since the last survey: 129 findings

These 129 critical or serious findings weren't in the previous survey, on 11 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.

Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 199 findings

These 199 critical or serious findings were in the previous survey, on 11 October 2026, and are gone from this one. The first 100 are listed here.

  • Cyclomatic Complexity · protocol.handle_request (cyclomatic 41) mempalace/mcp_server/protocol.py
  • Cyclomatic Complexity · format_miner.mine_formats (cyclomatic 30) mempalace/format_miner.py
  • Cyclomatic Complexity · mcp_light_server.tool_palace_query (cyclomatic 28) mempalace/mcp_light_server.py
  • Cyclomatic Complexity · normalize._try_chatgpt_json (cyclomatic 27) mempalace/normalize.py
  • Cyclomatic Complexity · ChromaCollection._lexical_search_via_sqlite (cyclomatic 26) REDACTED
  • Cyclomatic Complexity · mcp_light_server.tool_palace_exec (cyclomatic 23) mempalace/mcp_light_server.py
  • Cyclomatic Complexity · tunnels_tool.prune_tunnels (cyclomatic 22) mempalace/tunnels_tool.py
  • Cyclomatic Complexity · migrate.migrate_wing_names (cyclomatic 21) mempalace/migrate.py
  • Cyclomatic Complexity · chroma._sqlite_recent_records (cyclomatic 20) REDACTED
  • Cyclomatic Complexity · convo_miner._file_chunks_locked (cyclomatic 20) mempalace/convo_miner.py
  • Cyclomatic Complexity · migrate.migrate (cyclomatic 20) mempalace/migrate.py
  • Cyclomatic Complexity · candidates._enrich_closet_hits (cyclomatic 20) mempalace/searcher/candidates.py
  • Cyclomatic Complexity · fact_checker._check_kg_contradictions (cyclomatic 19) mempalace/fact_checker.py
  • Cyclomatic Complexity · llm_refine._extract_json_candidates (cyclomatic 19) mempalace/llm_refine.py
  • Cyclomatic Complexity · runtime._run_stdio_loop (cyclomatic 19) mempalace/mcp_server/runtime.py
  • Cyclomatic Complexity · tools_read.tool_status (cyclomatic 19) mempalace/mcp_server/tools_read.py
  • Cyclomatic Complexity · repair.repair_max_seq_id (cyclomatic 19) mempalace/repair.py
  • Cyclomatic Complexity · chroma.sqlite_list_id_metadata (cyclomatic 18) REDACTED
  • Cyclomatic Complexity · tools_write.tool_list_drawers (cyclomatic 18) mempalace/mcp_server/tools_write.py
  • Cyclomatic Complexity · onboarding._generate_aaak_bootstrap (cyclomatic 18) mempalace/onboarding.py
  • Cognitive Complexity · protocol.handle_request (cognitive 71) mempalace/mcp_server/protocol.py
  • Cognitive Complexity · normalize._try_chatgpt_json (cognitive 52) mempalace/normalize.py
  • Cognitive Complexity · format_miner.mine_formats (cognitive 46) mempalace/format_miner.py
  • Cognitive Complexity · candidates._enrich_closet_hits (cognitive 37) mempalace/searcher/candidates.py
  • Cognitive Complexity · fact_checker._check_kg_contradictions (cognitive 35) mempalace/fact_checker.py
  • Cognitive Complexity · ChromaCollection._lexical_search_via_sqlite (cognitive 34) REDACTED
  • Cognitive Complexity · onboarding.run_onboarding (cognitive 32) mempalace/onboarding.py
  • Cognitive Complexity · llm_refine._extract_json_candidates (cognitive 31) mempalace/llm_refine.py
  • Cognitive Complexity · chroma._sqlite_recent_records (cognitive 30) REDACTED
  • Cognitive Complexity · format_miner._file_chunks_locked (cognitive 29) mempalace/format_miner.py
  • Cognitive Complexity · onboarding._ask_people (cognitive 28) mempalace/onboarding.py
  • Cognitive Complexity · onboarding._generate_aaak_bootstrap (cognitive 27) mempalace/onboarding.py
  • Cognitive Complexity · chroma._matches_where (cognitive 26) REDACTED
  • Cognitive Complexity · chroma.sqlite_list_id_metadata (cognitive 26) REDACTED
  • Cognitive Complexity · pgvector._matches_where (cognitive 26) mempalace/backends/pgvector.py
  • Cognitive Complexity · qdrant._matches_where (cognitive 26) REDACTED
  • Cognitive Complexity · sqlite_exact._matches_where (cognitive 26) mempalace/backends/sqlite_exact.py
  • Cognitive Complexity · migrate.migrate (cognitive 25) mempalace/migrate.py
  • Cognitive Complexity · dedup.dedup_source_group (cognitive 23) mempalace/dedup.py
  • Cognitive Complexity · migrate.migrate_wing_names (cognitive 23) mempalace/migrate.py
  • Cognitive Complexity · closet_llm._call_llm (cognitive 22) mempalace/closet_llm.py
  • Cognitive Complexity · EntityRegistry.extract_people_from_query (cognitive 22) mempalace/entity_registry.py
  • Cognitive Complexity · repair.repair_max_seq_id (cognitive 22) mempalace/repair.py
  • Cognitive Complexity · PgVectorCollection._scroll_recent_local (cognitive 20) mempalace/backends/pgvector.py
  • Cognitive Complexity · pgvector._matches_where_document (cognitive 20) mempalace/backends/pgvector.py
  • Cognitive Complexity · qdrant._matches_where_document (cognitive 20) REDACTED
  • Cognitive Complexity · sqlite_exact._matches_where_document (cognitive 20) mempalace/backends/sqlite_exact.py
  • Cognitive Complexity · MilvusCollection.update (cognitive 19) mempalace/backends/milvus.py
  • Cognitive Complexity · PgVectorCollection.update (cognitive 19) mempalace/backends/pgvector.py
  • Cognitive Complexity · QdrantCollection.update (cognitive 19) REDACTED
  • Cognitive Complexity · general_extractor.extract_memories (cognitive 19) mempalace/general_extractor.py
  • Cognitive Complexity · chroma._string_equalities (cognitive 18) REDACTED
  • Cognitive Complexity · chroma._sqlite_iter_metadata (cognitive 18) REDACTED
  • Cognitive Complexity · config._atomic_write_json (cognitive 18) mempalace/config.py
  • Cognitive Complexity · corpus_origin._extract_json (cognitive 18) mempalace/corpus_origin.py
  • Cognitive Complexity · EntityRegistry.learn_from_text (cognitive 18) mempalace/entity_registry.py
  • Cognitive Complexity · tools_read.tool_get_taxonomy (cognitive 18) mempalace/mcp_server/tools_read.py
  • Cognitive Complexity · miner._publish_registry (cognitive 18) mempalace/miner.py
  • Cognitive Complexity · query._closet_boosts (cognitive 18) mempalace/searcher/query.py
  • Cognitive Complexity · chroma._validate_where (cognitive 17) REDACTED
  • Cognitive Complexity · chroma._bm25_scores (cognitive 17) REDACTED
  • Cognitive Complexity · chroma._sqlite_ready_metadata_segment (cognitive 17) REDACTED
  • Cognitive Complexity · pgvector._bm25_scores (cognitive 17) mempalace/backends/pgvector.py
  • Cognitive Complexity · pgvector._validate_where (cognitive 17) mempalace/backends/pgvector.py
  • Cognitive Complexity · qdrant._bm25_scores (cognitive 17) REDACTED
  • Cognitive Complexity · qdrant._validate_where (cognitive 17) REDACTED
  • Cognitive Complexity · sqlite_exact._bm25_scores (cognitive 17) mempalace/backends/sqlite_exact.py
  • Cognitive Complexity · sqlite_exact._validate_where (cognitive 17) mempalace/backends/sqlite_exact.py
  • Cognitive Complexity · llm_refine._parse_response (cognitive 17) mempalace/llm_refine.py
  • Cognitive Complexity · ranking._bm25_scores (cognitive 17) mempalace/searcher/ranking.py
  • Cognitive Complexity · _hub._forward_search_to_hub (cognitive 16) mempalace/cli/_hub.py
  • Cognitive Complexity · Layer1._fetch_candidates (cognitive 16) mempalace/layers.py
  • Cognitive Complexity · split_mega_files.split_file (cognitive 16) mempalace/split_mega_files.py
  • Code Duplication · Near-duplicate member family (5 members, 12 shared lines) REDACTED
  • Code Duplication · Near-duplicate member family (4 members, 18 shared lines) REDACTED
  • Code Duplication · Near-duplicate member pair (59 shared lines) mempalace/config.py
  • Code Duplication · Near-duplicate member pair (25 shared lines) mempalace/integrations/hermes/__init__.py
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) mempalace/backends/milvus.py
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) mempalace/backends/base.py
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) REDACTED
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) mempalace/backends/pgvector.py
  • Code Duplication · Duplicated block (20–54 lines × 3) REDACTED
  • Code Duplication · Duplicated block (13–28 lines × 2) mempalace/integrations/hermes/__init__.py
  • Code Duplication · Duplicated block (23–27 lines × 2) mempalace/config.py
  • Code Duplication · Duplicated block (20–26 lines × 2) mempalace/backends/sqlite_exact.py
  • Code Duplication · Duplicated block (21–26 lines × 2) mempalace/mcp_proxy.py
  • Code Duplication · Duplicated block (25 lines × 2) mempalace/config.py
  • Code Duplication · Duplicated block (22 lines × 4) REDACTED
  • Code Duplication · Duplicated block (21 lines × 3) mempalace/backends/milvus.py
  • Code Duplication · Duplicated block (21 lines × 2) mempalace/backends/pgvector.py
  • Code Duplication · Duplicated block (21 lines × 2) mempalace/knowledge_graph.py
  • Code Duplication · Duplicated block (19 lines × 3) mempalace/backends/pgvector.py
  • Code Duplication · Duplicated block (19 lines × 2) mempalace/config.py
  • Code Duplication · Duplicated block (17–19 lines × 2) mempalace/searcher/sqlite_bm25.py
  • Code Duplication · Duplicated block (18 lines × 4) REDACTED
  • Code Duplication · Duplicated block (16–18 lines × 2) mempalace/backends/pgvector.py
  • Code Duplication · Duplicated block (15–17 lines × 4) REDACTED
  • Code Duplication · Duplicated block (17 lines × 2) REDACTED
Rebuild cost: about €220,000 · Estimate
Cost to rebuild€74,000 to €370,000, for 1,240 to 3,934 hours of work, about 1.5 person-years for 1 to 3 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.9 at a score of 62. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeMedium: 84,259 lines of product code

How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
The findings name the configuration each number was taken from and, for the assertions, the files that hold them.
Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
Raises the score by about 4 points · Medium effort · Nullable reference types
2
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Raises the score by about 4 points · Medium effort · Visual & motion safety
3
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.
Raises the score by about 3 points · Medium effort · A11y enforcement

Diagnosis: what the measurements show together

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

Where the investment is most exposed · Value at risk
This code would cost about €220,000 to build again, about 1.5 person-years of work. Its weakest lens is Accessibility, at 55 (Adequate). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Of all the actions in this report, it raises the score most for the work it takes: about 4 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.8 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 6% to 13% on every change. The history of the code shows how much it changes: about 198,210 lines over the last 90 days, which is about 803,852 lines a year. At that pace, the extra work comes to an estimated 113 to 678.1 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph has none.

arch mempalace mempalace mempalace-cli mempalace-cli mempalace-core mempalace-core mempalace-cli->mempalace-core mempalace-py mempalace-py mempalace-py->mempalace-core

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

94 modules, with 48 dependencies between them. Every module uses only modules listed above it, so there are no loops.

The table shows the 40 modules with the most connections; 54 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 benchmarks.model_eval.metrics2 benchmarks.search_benchmark3 benchmarks.test_ollama_high_sensitivity4 benchmarks.test_ollama_medical_private_palace5 lean_mempalace_rust6 mempalace.backends._inproc_sqlite7 mempalace.backends.base8 mempalace.closet_llm9 mempalace.corpus_origin10 mempalace.daemon11 mempalace.embedding12 mempalace.format_miner13 mempalace.hooks_cli14 mempalace.llm_client15 mempalace.llm_refine16 mempalace.mcp_proxy17 mempalace.media18 mempalace.onnx_graph19 mempalace.repair20 mempalace.rooms21 mempalace.sources.base22 mempalace.write_routing23 benchmarks24 benchmarks.model_eval.runner25 mempalace.backends26 mempalace.backends._remote_common27 mempalace.backends.chroma28 mempalace.backends.embedding_wrapper29 mempalace.backends.sqlite_exact30 mempalace.cli_write_routing31 mempalace.config32 mempalace.sources33 mempalace.sources.context34 mempalace_core35 benchmarks.model_eval36 mempalace37 mempalace.backends.milvus38 mempalace.backends.pgvector39 mempalace.backends.qdrant40 mempalace.backends.rust_exact
1 benchmarks.model_eval.metrics
2 benchmarks.search_benchmark
3 benchmarks.test_ollama_high_sensitivity
4 benchmarks.test_ollama_medical_private_palace
5 lean_mempalace_rust
6 mempalace.backends._inproc_sqlite
7 mempalace.backends.base
8 mempalace.closet_llm
9 mempalace.corpus_origin
10 mempalace.daemon
11 mempalace.embedding
12 mempalace.format_miner
13 mempalace.hooks_cli
14 mempalace.llm_client
15 mempalace.llm_refine
16 mempalace.mcp_proxy
17 mempalace.media
18 mempalace.onnx_graph
19 mempalace.repair
20 mempalace.rooms
21 mempalace.sources.base
22 mempalace.write_routing
23 benchmarks253
24 benchmarks.model_eval.runner2
25 mempalace.backends31
26 mempalace.backends._remote_common1
27 mempalace.backends.chroma6
28 mempalace.backends.embedding_wrapper2
29 mempalace.backends.sqlite_exact7
30 mempalace.cli_write_routing1
31 mempalace.config2
32 mempalace.sources2
33 mempalace.sources.context1
34 mempalace_core1
35 benchmarks.model_eval32
36 mempalace11211121112134115
37 mempalace.backends.milvus101
38 mempalace.backends.pgvector81
39 mempalace.backends.qdrant91
40 mempalace.backends.rust_exact12
Uses a module listed above itPart of a loopThe module itself
1 benchmarks.model_eval.metrics2 benchmarks.search_benchmark3 benchmarks.test_ollama_high_sensitivity4 benchmarks.test_ollama_medical_private_palace5 lean_mempalace_rust6 mempalace.backends._inproc_sqlite7 mempalace.backends.base8 mempalace.closet_llm9 mempalace.corpus_origin10 mempalace.daemon11 mempalace.embedding12 mempalace.format_miner13 mempalace.hooks_cli14 mempalace.llm_client15 mempalace.llm_refine16 mempalace.mcp_proxy17 mempalace.media18 mempalace.onnx_graph19 mempalace.repair20 mempalace.rooms21 mempalace.sources.base22 mempalace.write_routing23 benchmarks24 benchmarks.model_eval.runner25 mempalace.backends26 mempalace.backends._remote_common27 mempalace.backends.chroma28 mempalace.backends.embedding_wrapper29 mempalace.backends.sqlite_exact30 mempalace.cli_write_routing31 mempalace.config32 mempalace.sources33 mempalace.sources.context34 mempalace_core35 benchmarks.model_eval36 mempalace37 mempalace.backends.milvus38 mempalace.backends.pgvector39 mempalace.backends.qdrant40 mempalace.backends.rust_exactbenchmarks.model_eval.metrics1benchmarks.search_benchmark2benchmarks.test_ollama_high_sensitivity3benchmarks.test_ollama_medical_private_palace4lean_mempalace_rust5mempalace.backends._inproc_sqlite6mempalace.backends.base7mempalace.closet_llm8mempalace.corpus_origin9mempalace.daemon10mempalace.embedding11mempalace.format_miner12mempalace.hooks_cli13mempalace.llm_client14mempalace.llm_refine15mempalace.mcp_proxy16mempalace.media17mempalace.onnx_graph18mempalace.repair19mempalace.rooms20mempalace.sources.base21mempalace.write_routing22benchmarks23benchmarks.model_eval.runner24mempalace.backends25mempalace.backends._remote_common26mempalace.backends.chroma27mempalace.backends.embedding_wrapper28mempalace.backends.sqlite_exact29mempalace.cli_write_routing30mempalace.config31mempalace.sources32mempalace.sources.context33mempalace_core34benchmarks.model_eval35mempalace36mempalace.backends.milvus37mempalace.backends.pgvector38mempalace.backends.qdrant39mempalace.backends.rust_exact402532311627122113211211121112134115101819112+54 more modules (most-connected shown)

At a glance — Code Health · 56% · Adequate · gated by D1, D2, X5 ·

At a glance — Architecture · 91% · Exemplary ·

At a glance — Maturity · 80% · Strong ·

At a glance — Readiness · 81% · Strong ·

At a glance — Security · 76% · Adequate · gated by D29, D30 ·

At a glance — Accessibility · 55% · Adequate · gated by AC6 ·

At a glance — Performance · 89% · Strong ·

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A05:2025 — Injection34High / Critical
A03:2025 — Software Supply Chain Failures20High / Critical
A02:2025 — Security Misconfiguration6High / Critical

Roadmap

First, enable strict null checking in the base TypeScript configuration and resolve existing assertions to prevent runtime errors. Second, improve visual and motion safety by maintaining visible focus styles, respecting reduced motion preferences, and ensuring sufficient color contrast. Third, enforce accessibility standards by adding automated checks to the test suite and gating them in CI to block regressions. Fourth, correct page structure by adding required semantic elements like language attributes, titles, and main landmarks. Finally, reduce cyclomatic complexity in the three most complex query parser functions to improve maintainability and code clarity.

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

Do thisHelpsEffortDimension
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).+4.5 ptsMediumNullable reference types
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.+4.4 ptsMediumVisual & motion safety
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.+3.0 ptsMediumA11y enforcement
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.+2.1 ptsMediumPage structure
Bring the 3 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with query_parser.parse_coordinate_input (cyclomatic 231), query_parser.parse_exec_input (cyclomatic 175), query_parser.parse_query_input (cyclomatic 156).+1.6 ptsHighCyclomatic Complexity
Swallowed exception (caught, then discarded)+1.3 ptsMediumException handling
Resolve the 31 FileTooLong finding(s) in God Classes — start with repair.py, REDACTED, miner.py.+1.0 ptsHighGod Classes
Resolve the 4 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (4).+0.4 ptsLowDependency Vulnerabilities

File quality

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

FileScoreBandWorst signal
REDACTED0.3SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
mempalace/miner.py5.5MixedCyclomatic Complexity: miner.scan_project (cyclomatic 32)
mempalace/backends/base.py5.7MixedCyclomatic Complexity: BaseCollection.get_recent (cyclomatic 16)
REDACTED5.8MixedIaC & Container Security: High IaC: REDACTED
mempalace/searcher/query.py5.9MixedCyclomatic Complexity: query.search_memories (cyclomatic 28)
mempalace/mcp_server/tools_diary.py6.0MixedExplicit Debt: TodoComment
REDACTED6.3MixedCyclomatic Complexity: QdrantCollection.query (cyclomatic 18)
REDACTED6.5MixedCyclomatic Complexity: llm_client._json_candidates (cyclomatic 16)
REDACTED6.9MixedIaC & Container Security: Medium IaC: REDACTED
REDACTED6.9MixedIaC & Container Security: Medium IaC: REDACTED
mempalace/query_parser.py7.0MixedCyclomatic Complexity: query_parser.parse_coordinate_input (cyclomatic 231)
mempalace/dialect.py7.0MixedCyclomatic Complexity: Dialect.generate_layer1 (cyclomatic 31)
mempalace/mcp_server/tools_write.py7.0MixedCyclomatic Complexity: tools_write.tool_update_drawer (cyclomatic 31)
mempalace/backends/sqlite_exact.py7.0MixedCyclomatic Complexity: SQLiteExactCollection._rows (cyclomatic 27)
mempalace/convo_miner.py7.0MixedCyclomatic Complexity: convo_miner._mine_convos_impl (cyclomatic 27)
mempalace/normalize.py7.0MixedCyclomatic Complexity: normalize._try_claude_code_jsonl (cyclomatic 26)
mempalace/mcp_light_server.py7.0MixedCyclomatic Complexity: mcp_light_server._alias_args_for_handler (cyclomatic 24)
mempalace/palace_graph.py7.0MixedCyclomatic Complexity: palace_graph.entity_tunnel_candidates (cyclomatic 24)

How the grades work

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

Critical — 18

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 712

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 110

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

Could not be resolved — 8

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 69 of 75 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 6 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.

What we checked — 75 dimensions across the health lenses
D1D2D3D4D5D6D7D9D11D13D14D15D16D17D19D20D21D22D25D26D28D29D30D31D34D35D36D37D43D44AC1AC2AC3AC5AC6AC7AX10AX3AX4AX9M1M2M3M4P1P10P2P3P4P5P6PF1PF3X1X12X13X14X15X16X17X18X19X21X22X23X24X25X26X27X28X29X3X30X4X5

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 828 of 840 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

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

Every finding is locatable in findings.md. Run 01a170ee-4821-7337-a228-85fced856d19.

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

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: this repository's production source spans .mts, .ts, .py, and our analyzer cannot run the .py test suite(s) — so no coverage was collected for the repository as a whole. The JavaScript/TypeScript half did build and run, and its own line coverage came back at 98.2% — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero. In the meantime, produce a coverage report in a standard format (lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`, or `coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures and real coverage will be read. You can widen what we reach: optional: produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then both halves are read on the next scan.
  • D12 Dependency Hygiene — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 0 direct Go requirement(s) out of 10 in 1 go.mod were read for PINNING discipline and checksum coverage (0 defect(s) reported), but the outdated/deprecated signal needs the Go module proxy, which had no direct requirement to be asked about, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
  • D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Python pyproject.toml/requirements.txt (pip/uv/Poetry), but the licence verdict published here was taken over its crate dependencies. Nothing was read about its Python dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (docker-compose.yml). compose up failed (exit 17 — an image could not be built) — mcp Pulling mcp Warning Get "https://registry-1.docker.io/v2/": Forbidden failed to solve: failed to resolve source metadata for docker.io/docker/dockerfile:1.7: failed to do request: Head "https://registry-1.docker.io/v2/docker/dockerfile/manifests/1.7": Forbidden; runtime evidence skipped.
  • C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Python, Rust, Vue components is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Python, Rust, Vue components is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X3 Exception handling — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 34 further occurrence(s) are not listed individually; the score already reflects all 74.

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

Limitations & what we did not check

Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D11 Test Reliability: Flakiness is inferred from history/markers — Watchdog runs the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
  • 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").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
  • D25 ADR Conformance: ADR conformance is the LLM-scored fraction of sampled code that follows recorded decisions — it checks the decisions that were written down and the slices it sampled, not unrecorded rules or the whole tree.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • 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 (6): D19, D20, D21, D22, D25, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic Complexity2.0 / 10Critical✓ Tool-verified

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

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

149 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was query_parser.parse_coordinate_input at 231.

query_parser.parse_coordinate_input (cyclomatic 231)mempalace/query_parser.py:1287
query_parser.parse_exec_input (cyclomatic 175)mempalace/query_parser.py:786
query_parser.parse_query_input (cyclomatic 156)mempalace/query_parser.py:399
media_search.search_with_media (cyclomatic 39)mempalace/searcher/media_search.py:17
cmd_serve.cmd_serve (cyclomatic 36)mempalace/cli/cmd_serve.py:72

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

What to do

  1. Bring the 3 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with query_parser.parse_coordinate_input (cyclomatic 231), query_parser.parse_exec_input (cyclomatic 175), query_parser.parse_query_input (cyclomatic 156). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 3 together lifts Cyclomatic Complexity from 2.0 to about 4.6/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D2 · Cognitive Complexity2.0 / 10Critical✓ Tool-verified

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

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

265 method(s) exceeded the cognitive complexity threshold of 15; the worst was query_parser.parse_coordinate_input at 372.

query_parser.parse_coordinate_input (cognitive 372)mempalace/query_parser.py:1287
query_parser.parse_exec_input (cognitive 323)mempalace/query_parser.py:786
query_parser.parse_query_input (cognitive 201)mempalace/query_parser.py:399
_session._get_collection (cognitive 67)mempalace/mcp_server/_session.py:195
miner.scan_project (cognitive 66)mempalace/miner.py:1760

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

What to do

  1. Bring the 8 bodies over 60 down to 60 or less in Cognitive Complexity — start with query_parser.parse_coordinate_input (cognitive 372), query_parser.parse_exec_input (cognitive 323), query_parser.parse_query_input (cognitive 201). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 8 together lifts Cognitive Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D3 · God Classes8.2 / 10Strong✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

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

34 god class(es) detected.

FileTooLong: mempalace/repair.py · ×31mempalace/repair.py
TooManyMethods: MempalaceProvider · ×3mempalace/integrations/hermes/__init__.py:610

What to do

  1. Resolve the 31 FileTooLong finding(s) in God Classes — start with repair.py, REDACTED, miner.py. — One of this dimension's main actionable groups (31 warning-level).
  2. Resolve the 3 TooManyMethods finding(s) in God Classes — start with REDACTED, embeddinggemma2.py, sqlite_exact.py. — One of this dimension's main actionable groups (3 warning-level).
  3. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D4 · Code Duplication9.5 / 10Stronggated by 89 serious findings✓ Tool-verified

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

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

86 duplicated block group(s) detected. A further 3 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.

Duplicated block (7 lines × 2) · ×8mempalace/backends/rust_exact.py:152
Duplicated block (11 lines × 2) · ×6mempalace/backends/embedding_wrapper.py:356
Duplicated block (5 lines × 2) · ×6mempalace/backends/pgvector.py:1111
Duplicated block (9 lines × 2) · ×4mempalace/backends/milvus.py:541
Duplicated block (13 lines × 3) · ×3mempalace/backends/milvus.py:983

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

What to do

  1. Resolve the 8 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with query_parser.py (3), rust_exact.py, cmd_sync.py. — One of this dimension's main actionable groups (8 warning-level).
  2. Resolve the 6 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with embedding_wrapper.py, milvus.py, rust_exact.py. — One of this dimension's main actionable groups (6 warning-level).
  3. Resolve the 6 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with pgvector.py, REDACTED, milvus.py. — One of this dimension's main actionable groups (6 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D5 · Coupling8.0 / 10Strong✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

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

4 production modules (Cargo+Python), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 1 module(s) off the main sequence.

Off the main sequence: mempalace-core

What to do

  1. Resolve the 1 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
  2. Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

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

2 of 48 classes have LCOM4 above 3.

Low cohesion: MedicalPalaceEnvironment (LCOM4 4) · ×2benchmarks/test_ollama_medical_private_palace.py:186

What to do

  1. Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with test_ollama_medical_private_palace.py, base.py. — One of this dimension's main actionable groups (2 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

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

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

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

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

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

What to do

  1. Enforce Architectural Integrity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d7_recommendation.md.

D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.

Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.

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

6355 test methods: 6240 unit, 115 integration, 0 BDD, 0 e2e. The Rust suite contributes 9 `#[test]` function(s) across 2 file(s) declaring at least one; its unit/integration split is Cargo's own — 1 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test. The Python suite contributes 6346 test function(s) across 279 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the tests pass reliably, with no flakiness.

Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.

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

0 flaky across 2 measured tier(s). JavaScript/TypeScript (node:test via `npm install --ignore-scripts` (no lockfile) in .dsh-plugin/ (44 tests)): measured (0 flaky); Python (repository root, 283 test files): measured (0 flaky).

✓ On the Gold path — maintain.

Detailed fixes: d11_recommendation.md.

D13 · Secret Scanning10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

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

0 of 69 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. This repository publishes itself under MIT, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares a Python pyproject.toml/requirements.txt (pip/uv/Poetry) and package.json, and the licences of those dependency graphs were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

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

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

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

Top hotspots: mempalace/query_parser.py (14×231=3234); mempalace/miner.py (38×32=1216); REDACTED (41×26=1066) Repeated repair below the complexity floor: mempalace/mcp_server/http.py (17 of 23 changes were fixes); REDACTED (16 of 27 changes were fixes); REDACTED (11 of 17 changes were fixes)

Hotspot: mempalace/query_parser.py · ×64mempalace/query_parser.py:1287
Repeated repair: mempalace/mcp_server/http.py · ×18mempalace/mcp_server/http.py:416

What to do

  1. Resolve the 64 Hotspot finding(s) in Churn × Complexity Hotspots — start with query_parser.py, miner.py, REDACTED. — One of this dimension's main actionable groups (64 warning-level).
  2. Resolve the 18 Repeated repair finding(s) in Churn × Complexity Hotspots — start with REDACTED (2), http.py, server_registry.py. — One of this dimension's main actionable groups (18 warning-level).

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

D16 · Bus Factor7.1 / 10Strong✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

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

48 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is mempalace/logstream.py. Counted over 170 of the 201 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)

What to do

  1. Resolve the 1 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

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

1 deducted task-comment markers across 84259 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

TodoCommentmempalace/mcp_server/tools_diary.py:58

What to do

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

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

D19 · Documentation QualityExemplary◐ Sampled · advisory

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

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

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

The MemPalace documentation is clear, complete, and well-structured: the READMEs for each directory (hooks/, mempalace/, benchmarks/, examples/) document their own directories rather than the repository root, with focused headings covering what the files do, installation, usage, and contribution guidance. The architecture/design docs are also present and well organized. All visible documents meet or exceed the quality threshold. This MemPalace repository is well documented across READMEs, architecture/Docs markdown, and a history file. The benchmarks/model_eval directories each have an overview (MemPalace Small-Model Benchmark Datasets), tasks table, fictional personas, and distribution stats; the reports directory documents its role as hand-written analysis output; cursor rules document install, which file to use, and how recall is delivered; Closets explains what it is, when it is created, what a closet line looks like, and limits; History records post-launch corrections with links; Releasing MemPalace covers pre-release checks, MCP entry-point alignment, and the DeepSeek harness bundle; and Authored dates and search-result provenance defines authored_at semantics. All visible documents are complete and well-structured. (8 of 25 sampled documents could not be assessed: 1 of 3 evaluation groups failed.)

Documentation: contradicts the code · ×2benchmarks/model_eval/README.md

✓ On the Gold path — maintain.

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

D20 · ADR QualityStrong◐ Sampled · advisory

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.

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

Evaluated 5 ADR(s) individually; mean quality 8.6/10 (consistently complete and clear). 0 flagged with a specific gap.

ADR lacks an enforcement field · ×4docs/rfcs/001-storage-backend-plugin-spec.md:1detected by adr-integrity
ADR has no Decision and Consequences section · ×3docs/rfcs/001-storage-backend-plugin-spec.md:1detected by adr-integrity
ADR has no Consequences sectiondocs/rfcs/005-agent-identity-routing.md:1detected by adr-integrity

What to do

  1. Resolve the 4 ADR lacks an enforcement field finding(s) in ADR Quality — start with 001-storage-backend-plugin-spec.md, 003-agent-logstream-coordination.md, 004-replicated-palace.md. — One of this dimension's main actionable groups (4 recommendation-level).
  2. Resolve the 3 ADR has no Decision and Consequences section finding(s) in ADR Quality — start with 001-storage-backend-plugin-spec.md, 002-source-adapter-plugin-spec.md, 003-agent-logstream-coordination.md. — One of this dimension's main actionable groups (3 recommendation-level).
  3. Resolve the 1 ADR has no Consequences section finding(s) in ADR Quality — start with 005-agent-identity-routing.md. — One of this dimension's main actionable groups (1 recommendation-level).

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

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.

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

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D22 · Internal API ConsistencyStronggated by 3 serious findings◐ Sampled · advisory

What it measures: Whether the internal API surface is consistent and coherent.

Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.

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

3 API inconsistencies across a 400-member sample of 329 exposed types.

Semantic ambiguity between add and upsert. In many vector DB APIs, 'add' implies strict insertion (fail if ID exists) while 'upsert' implies insert-or-update. However, the signatures are identical, and the presence of a separate 'update' method suggests 'upsert' might be an alias for 'update' or 'add'. Without documentation, it is unclear if 'add' and 'upsert' are distinct operations or if one is redundant.
Potential redundancy in counting methods. 'count' and 'estimated_count' often imply exact vs approximate counts. However, if the underlying backend does not support exact counts efficiently, 'count' might just call 'estimated_count', making the distinction confusing. Conversely, if both are exact, one is redundant.
Overlap in retrieval scope. 'get_all_metadata' retrieves only metadata, while 'get_all_rows' retrieves a full result set (IDs, documents, metadatas, embeddings). If a user only wants metadata, 'get_all_rows' with include=['metadatas'] achieves the same. 'get_all_metadata' is a convenience method, but its existence alongside 'get_all_rows' might confuse users about which to use for partial data retrieval.

What to do

  1. Resolve the 1 Semantic ambiguity between add and upsert. In many vector DB APIs, 'add'… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 Potential redundancy in counting methods. 'count' and 'estimated_count'… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Overlap in retrieval scope. 'get_all_metadata' retrieves only metadata,… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).

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

D25 · ADR ConformanceExemplary◐ Sampled · advisory

What it measures: Whether the code actually follows the decisions recorded in the project's ADRs.

Method: Judged by language model at low temperature against ADRs plus a deterministic structural code summary; findings linked to repo-rooted ADR paths for traceability. Advisory.

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

1 conform / 0 violate across 5 ADRs.

✓ On the Gold path — maintain.

Detailed fixes: d25_recommendation.md.

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

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

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

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

1 of 5 build units (Cargo, npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

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

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

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

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

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)1.9 / 10Critical✓ Tool-verified

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

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

37 finding(s): 0 critical, 6 high, 5 medium, 26 low. semgrep hit a parse error in 3 file(s) — `.codex-plugin/hooks/mempal-hook.sh` (line 6), `hooks/antigravity/lib/common.sh` (line 185), `hooks/antigravity/mempal_wake_hook_antigravity.sh` (line 118) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

D30 · Dependency Vulnerabilities0.1 / 10Critical✓ Tool-verified

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.

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

16 finding(s): 4 critical, 6 high, 6 medium, 0 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 4 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (4). — One of this dimension's main actionable groups (4 issue-level).
  2. Resolve the 3 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
  3. Resolve the 2 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).

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

D31 · IaC & Container Security8.9 / 10Adequategated by 2 critical findings✓ Tool-verified

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

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

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

6 finding(s): 0 critical, 2 high, 4 medium, 0 low.

REDACTED
REDACTED

What to do

  1. Resolve the 2 High IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 4 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (4 warning-level).

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

D34 · Knowledge Freshness9.9 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

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

1 of 170 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is scripts/backfill_authored_at.py. Counted over 170 of the 201 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned files with no living knowledge
Orphaned filescripts/backfill_authored_at.py:1

✓ On the Gold path — maintain.

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

D35 · Change Coupling9.8 / 10Stronggated by 2 serious findings✓ Tool-verified

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

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

Strongest change-coupling: query.py↔sqlite_bm25.py 80%; miner.py↔sweeper.py 60%

Change coupling: query.py ↔ sqlite_bm25.py · ×2mempalace/searcher/query.py:1

What to do

  1. Resolve the 2 Change coupling finding(s) in Change Coupling — start with query.py, miner.py. — One of this dimension's main actionable groups (2 warning-level).

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

D36 · Supply-chain Provenance & Signing10.0 / 10Stronggated by 3 serious findings✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

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

Build pipeline generates provenance, signs artifacts and produces an SBOM.

REDACTED
REDACTED

What to do

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

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

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

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

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

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 4 platform declaration(s) and 7 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AC1 · Text alternatives10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.

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, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.

Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AC3 · Page structure5.6 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.

Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — REDACTED:2
  • Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. — REDACTED:1713

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.
AC5 · ARIA correctness10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.

Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AC6 · Visual & motion safety2.2 / 10Critical✓ Tool-verified

Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.

Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.

Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • `.mempalace-landing .waitlist-pulse` moves (`animation: mpl-breathe 2.2s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — website/.vitepress/theme/landing/landing.css:299
  • `.mempalace-landing .waitlist-submit` moves (`transition: background 0.25s, color 0.25s, box-shadow 0.25s, transform 0.25s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — website/.vitepress/theme/landing/landing.css:351
  • `.mempalace-landing .btn` moves (`transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — website/.vitepress/theme/landing/landing.css:444
  • `.mempalace-landing .palace-stage .halo` moves (`animation: mpl-haloPulse 7s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — website/.vitepress/theme/landing/landing.css:514
  • `.mempalace-landing .palace-stage .stars i` moves (`animation: mpl-twinkle var(--t, 5s) ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — website/.vitepress/theme/landing/landing.css:547
  • `.mempalace-landing .msg` moves (`animation: mpl-msg-in 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — website/.vitepress/theme/landing/landing.css:687
  • `.mempalace-landing .chat .divider-time` moves (`animation: mpl-msg-in 0.5s ease 0.05s forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — website/.vitepress/theme/landing/landing.css:736
  • `.mempalace-landing .chat .retrieval` moves (`animation: mpl-msg-in 0.5s ease forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — website/.vitepress/theme/landing/landing.css:762
  • `.mempalace-landing .chat .stamp` moves (`animation: mpl-msg-in 0.6s ease forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — website/.vitepress/theme/landing/landing.css:775
  • `.mempalace-landing .stratum` moves (`transition: border-color 0.4s ease, transform 0.4s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — website/.vitepress/theme/landing/landing.css:834
  • `.mempalace-landing .stratum:nth-child(3) .diagram svg .closet` moves (`animation: mpl-closet-wave 3.6s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — website/.vitepress/theme/landing/landing.css:1218
  • `.mempalace-landing .stratum:nth-child(4) .diagram svg rect` moves (`animation: mpl-drawer-slide 4.2s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — website/.vitepress/theme/landing/landing.css:1232
  • `.mempalace-landing .stratum:nth-child(4) .diagram svg circle` moves (`animation: mpl-dot-pulse 2.2s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — website/.vitepress/theme/landing/landing.css:1242
  • `.mempalace-landing .mech:nth-child(2) .icon svg .mech-ring` moves (`animation: mpl-ring-breathe 4s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — website/.vitepress/theme/landing/landing.css:1269
  • `.mempalace-landing .mech:nth-child(3) .icon svg .mech-gear` moves (`animation: mpl-gear-spin 12s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — website/.vitepress/theme/landing/landing.css:1288
  • `.mempalace-landing .mech:nth-child(4) .icon svg .mech-nodes circle` moves (`animation: mpl-graph-node 3.2s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — website/.vitepress/theme/landing/landing.css:1302

What to do

  • Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified

Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.

Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.

Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.

  • No accessibility enforcement found — no 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 was searched, so you can tell an absence from a miss: the 1 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.

What to do

  • Enforce accessibility in the 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.
AX10 · Code composition9.7 / 10Exemplary✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

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

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

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

Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.

Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.

Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.

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

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 6 of 7 project(s) that lack one — worth up to 1.7 pts.
M2 · Architecture documentation7.0 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

What to do

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

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

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

M4 · Documentation accuracy9.2 / 10Exemplary◐ Sampled · advisory

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.

  • .dsh-plugin/README.md runs `node --test test/*.test.mjs`, but `test/*.test.mjs` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — .dsh-plugin/README.md:168
  • docs/format-coverage.md names `mempalace/cli.py`, but no file or folder `mempalace/cli.py` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/format-coverage.md:5
  • docs/virtual-line-numbering.md names `mempalace/searcher.py`, but no file or folder `mempalace/searcher.py` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/virtual-line-numbering.md:4
  • docs/recovery/index-metadata-recovery.md names `docs/recovery/chromadb-metadata-dict-patch.md`, but no file or folder `docs/recovery/chromadb-metadata-dict-patch.md` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/recovery/index-metadata-recovery.md:194
  • docs/recovery/index-metadata-recovery.md names `tests/test_chromadb_metadata_recovery.py`, but no file or folder `tests/test_chromadb_metadata_recovery.py` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/recovery/index-metadata-recovery.md:197
  • benchmarks/model_eval/datasets/README.md names `skills/latex`, but no file or folder `skills/latex` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — benchmarks/model_eval/datasets/README.md:27
  • benchmarks/model_eval/datasets/README.md names `skills/python`, but no file or folder `skills/python` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — benchmarks/model_eval/datasets/README.md:27
  • benchmarks/model_eval/datasets/README.md names `skills/statistical-tests`, but no file or folder `skills/statistical-tests` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — benchmarks/model_eval/datasets/README.md:27
  • benchmarks/model_eval/datasets/README.md names `skills/rust`, but no file or folder `skills/rust` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — benchmarks/model_eval/datasets/README.md:33
  • benchmarks/model_eval/datasets/README.md names `skills/ocaml`, but no file or folder `skills/ocaml` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — benchmarks/model_eval/datasets/README.md:33
  • benchmarks/model_eval/datasets/README.md names `skills/llvm`, but no file or folder `skills/llvm` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — benchmarks/model_eval/datasets/README.md:33
  • benchmarks/model_eval/datasets/README.md names `skills/narrative-design`, but no file or folder `skills/narrative-design` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — benchmarks/model_eval/datasets/README.md:39
  • benchmarks/model_eval/datasets/README.md names `skills/etymology`, but no file or folder `skills/etymology` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — benchmarks/model_eval/datasets/README.md:39
  • benchmarks/model_eval/datasets/README.md names `skills/mythology`, but no file or folder `skills/mythology` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — benchmarks/model_eval/datasets/README.md:39
  • benchmarks/model_eval/datasets/README.md names `skills/phenology`, but no file or folder `skills/phenology` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — benchmarks/model_eval/datasets/README.md:45
  • benchmarks/model_eval/datasets/README.md names `skills/plant-pathology`, but no file or folder `skills/plant-pathology` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — benchmarks/model_eval/datasets/README.md:45
  • benchmarks/model_eval/datasets/README.md names `skills/propagation`, but no file or folder `skills/propagation` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — benchmarks/model_eval/datasets/README.md:45
  • benchmarks/model_eval/datasets/README.md names `skills/double-entry`, but no file or folder `skills/double-entry` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — benchmarks/model_eval/datasets/README.md:51
  • benchmarks/model_eval/datasets/README.md names `skills/depreciation-rules`, but no file or folder `skills/depreciation-rules` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — benchmarks/model_eval/datasets/README.md:51
  • benchmarks/model_eval/datasets/README.md names `skills/ifrs`, but no file or folder `skills/ifrs` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — benchmarks/model_eval/datasets/README.md:51
  • benchmarks/model_eval/reports/README.md documents the environment variable `MODEL_TIERS`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — benchmarks/model_eval/reports/README.md:3

What to do

  • Reconcile the README with reality: .dsh-plugin/README.md runs `node --test test/*.test.mjs`, but `test/*.test.mjs` does not exist; docs/format-coverage.md names `mempalace/cli.py`, but no file or folder `mempalace/cli.py` exists; docs/virtual-line-numbering.md names `mempalace/searcher.py`, but no file or folder `mempalace/searcher.py` exists; docs/recovery/index-metadata-recovery.md names `docs/recovery/chromadb-metadata-dict-patch.md`, but no file or folder `docs/recovery/chromadb-metadata-dict-patch.md` exists; docs/recovery/index-metadata-recovery.md names `tests/test_chromadb_metadata_recovery.py`, but no file or folder `tests/test_chromadb_metadata_recovery.py` exists.
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

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

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

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

P2 · Observability8.5 / 10Strong✓ Tool-verified

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

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

  • Only 1/2 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `crates/mempalace-cli`.

What to do

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

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

What to do

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

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

What to do

  • The pipeline declares a deployment environment, but whether required reviewers / protection rules are attached to it lives in repository settings we cannot read — confirm the gate is enforced before production promotion.
P5 · DR & Backup7.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.

Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.

What to do

  • Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

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

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

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

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

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

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

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

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

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

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

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

X17 · Uncapped recursion over a caller-supplied document2.5 / 10Weak✓ Tool-verified

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

  • `parse_query_input` is public and takes `input_data: Any` from its caller, and it calls itself at line 437 (`parse_query_input`) with a piece of `input_data` (and at line 500) — and nowhere in `parse_query_input` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `parse_query_input` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — mempalace/query_parser.py:437
  • `parse_coordinate_input` is public and takes `input_data: Any` from its caller, and it calls itself at line 1312 (`parse_coordinate_input`) with a piece of `input_data` (and at line 1476) — and nowhere in `parse_coordinate_input` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `parse_coordinate_input` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — mempalace/query_parser.py:1312
  • `add_entity` is public, takes a document from its caller (line 436) and hands it to `_drop_none`, which calls itself at line 228 (`_drop_none`) with a piece of `props` — and nowhere in `_drop_none` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_drop_none` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — mempalace/knowledge_graph.py:228
  • `facet_counts` is public, takes a document from its caller (line 1400) and hands it to `_equality_where_sql`, which calls itself at line 186 (`_equality_where_sql`) with a piece of `where` — and nowhere in `_equality_where_sql` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_equality_where_sql` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — mempalace/backends/sqlite_exact.py:186
  • `get_all_metadata` is public, takes a document from its caller (line 840) and hands it to `_qdrant_filter`, which calls itself at line 463 (`_qdrant_filter`) with a piece of `where` — and nowhere in `_qdrant_filter` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_qdrant_filter` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — REDACTED:463
  • `matches_where` is public and takes `where: Optional[dict]` from its caller, and it calls itself at line 89 (`matches_where`) with a piece of `where` (and at line 93) — and nowhere in `matches_where` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `matches_where` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — mempalace/backends/_filters.py:89
  • `matches_where_document` is public and takes `where_document: Optional[dict]` from its caller, and it calls itself at line 120 (`matches_where_document`) with a piece of `where_document` (and at line 124) — and nowhere in `matches_where_document` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `matches_where_document` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — mempalace/backends/_filters.py:120

What to do

  • Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.

Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

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

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

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

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.

Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.

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

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

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

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

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

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

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

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

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

X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.

Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

X3 · Exception handling6.4 / 10Adequate✓ Tool-verified

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

  • `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×29) — mempalace/search_util.py:206, mempalace/repair.py:154, mempalace/repair.py:270, …
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×11) — mempalace/repair.py:542, mempalace/repair.py:551, mempalace/repair.py:623, …

What to do

  • Swallowed exception (caught, then discarded)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

X4 · Structured logging7.7 / 10Strong✓ Tool-verified

Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.

Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.

  • `error` at line 110 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.error("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.error("order moved", order_id=order_id, status=status)` with structlog. — mempalace/wal.py:110
  • `error` at line 140 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.error("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.error("order moved", order_id=order_id, status=status)` with structlog. — mempalace/wal.py:140

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types2.0 / 10Critical✓ Tool-verified

Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • This repository commits no tsconfig, so whatever type-checks it uses tsc's own defaults, in which `strict` and `strictNullChecks` are OFF: `string` admits `null` and `undefined`, and a value that is null is compiled through to the property access that throws. If the build passes `--strict` on a command line instead, put it in a committed tsconfig — this check reads configuration, and configuration is all it can read.

What to do

  • The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).

WCAG coverage — what static analysis assessed

Statically assessed 13 of 55 WCAG 2.2 Level A/AA success criteria (24%; ≈26% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 42 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only
AC7 · A11y enforcementenforcement — no page criterionEnforcement posture (process)

Not statically assessed — these 42 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.2.1, 1.2.3, 1.2.4, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.1, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.2, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.6, 3.3.1, 3.3.3, 3.3.4, 3.3.7, 3.3.8, 4.1.3.

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health56%Adequate — gated by D1, D2, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture91%ExemplaryStrongest area.
Maturity80%StrongSolid.
Readiness81%StrongSolid.
Security76%Adequate — gated by D29, D30Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility55%Adequate — gated by AC6Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance89%StrongSolid.
Unscored — 2 check(s) recorded observations but carry no score

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

  • X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 21 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 44 check(s) not relevant to this codebase

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

  • AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
  • AX1 Captive dependencies — Not applicable: this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No Go request handler (a net/http, Gin, Echo, Fiber or fasthttp handler, or a gRPC service method) is declared as a method or function, and no handler function literal writes a value captured from outside it, so no state is shared between request goroutines. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — no exported interface declares behaviour
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — compose up failed (exit 17 — an image could not be built) — mcp Pulling mcp Warning Get "https://registry-1.docker.io/v2/": Forbidden failed to solve: failed to resolve source metadata for docker.io/docker/dockerfile:1.7: failed to do request: Head "https://registry-1.docker.io/v2/docker/dockerfile/manifests/1.7": Forbidden; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — No access-control surface detected in the analyzed source — this repository registers no route and starts no server another machine can reach (no Flask/FastAPI/Starlette route, Django urlpatterns or class-based view, Tornado handler). Access control is therefore N/A here — a library or command-line tool is authorized by the application that serves it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or MongoEngine model, a migration or a SQL schema — and no database or data-store client (Django ORM, SQLAlchemy, psycopg, PyMongo, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D10 Test Quality — ~115696 lines of test source are present (.py, .rs) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D12 Dependency Hygiene — Not scored — 0 direct Go requirement(s) out of 10 in 1 go.mod were read for PINNING discipline and checksum coverage (0 defect(s) reported), but the outdated/deprecated signal needs the Go module proxy, which had no direct requirement to be asked about, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.py), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D8 Code Coverage — Coverage not measured — polyglot repository, one half has no runner
  • DM1 Domain Modelling — applicable but not scored (1 of 2 signals for this style — below the bar we score at): 44 value object(s)
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript, Python, Rust source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage data present for 9 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • PF2 Allocation hygiene — Not applicable: Python runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
  • 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.
  • X2 Cancellation propagation — no C# was loaded; this repository's Python and Rust were read, and no request in it can be cancelled by a caller — a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation; a Rust request takes no token: a future is cancelled by dropping it, from outside the call (select!, a timeout, an aborted task), and reqwest, hyper and tonic take none
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 18 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High vulnerability · ×2
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Critical vulnerability · ×1
  • REDACTED
Serious — 712 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×64
  • Hotspot: mempalace/query_parser.py mempalace/query_parser.py:1287 — mempalace/query_parser.py changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 231 in query_parser.parse_coordinate_input at line 1287. 10 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/query_parser.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/miner.py mempalace/miner.py:1760 — mempalace/miner.py changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in miner.scan_project at line 1760. 25 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/miner.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:2081 — REDACTED changed 41 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in ChromaCollection.query at line 2081. 25 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/convo_miner.py mempalace/convo_miner.py:952 — mempalace/convo_miner.py changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in convo_miner._mine_convos_impl at line 952. 27 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/convo_miner.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/backends/sqlite_exact.py mempalace/backends/sqlite_exact.py:850 — mempalace/backends/sqlite_exact.py changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in SQLiteExactCollection._rows at line 850. 22 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/backends/sqlite_exact.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/mcp_server/tools_write.py mempalace/mcp_server/tools_write.py:1421 — mempalace/mcp_server/tools_write.py changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in tools_write.tool_update_drawer at line 1421. 20 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/mcp_server/tools_write.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/config.py mempalace/config.py:81 — mempalace/config.py changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in config.wing_aliases at line 81. 26 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/config.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/repair.py mempalace/repair.py:1353 — mempalace/repair.py changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in repair.maybe_autoheal_fts5_index at line 1353. 28 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/repair.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/mcp_server/tools_read.py mempalace/mcp_server/tools_read.py:608 — mempalace/mcp_server/tools_read.py changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in tools_read.tool_search at line 608. 19 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/mcp_server/tools_read.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/service.py mempalace/service.py:122 — mempalace/service.py changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in service.run_mine at line 122. 11 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/service.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/mcp_light_server.py mempalace/mcp_light_server.py:845 — mempalace/mcp_light_server.py changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in mcp_light_server._alias_args_for_handler at line 845. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/mcp_light_server.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/searcher/sqlite_bm25.py mempalace/searcher/sqlite_bm25.py:114 — mempalace/searcher/sqlite_bm25.py changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in sqlite_bm25._bm25_only_via_sqlite at line 114. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/searcher/sqlite_bm25.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/searcher/query.py mempalace/searcher/query.py:189 — mempalace/searcher/query.py changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in query.search_memories at line 189. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/searcher/query.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/format_miner.py mempalace/format_miner.py:767 — mempalace/format_miner.py changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in format_miner._mine_formats_impl at line 767. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/format_miner.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/hallways.py mempalace/hallways.py:642 — mempalace/hallways.py changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in hallways.compute_hallways_for_wing at line 642. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/hallways.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/hooks_cli.py mempalace/hooks_cli.py:1482 — mempalace/hooks_cli.py changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in hooks_cli.hook_stop at line 1482. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/hooks_cli.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/mcp_server/protocol.py mempalace/mcp_server/protocol.py:905 — mempalace/mcp_server/protocol.py changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in protocol.call_tool at line 905. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/mcp_server/protocol.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/palace_graph.py mempalace/palace_graph.py:240 — mempalace/palace_graph.py changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in palace_graph.build_graph at line 240. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/palace_graph.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/layers.py mempalace/layers.py:355 — mempalace/layers.py changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in Layer1.generate at line 355. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/layers.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/normalize.py mempalace/normalize.py:324 — mempalace/normalize.py changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in normalize._try_claude_code_jsonl at line 324. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/normalize.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/diary_ingest.py mempalace/diary_ingest.py:94 — mempalace/diary_ingest.py changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in diary_ingest.ingest_diaries at line 94. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/diary_ingest.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/sync.py mempalace/sync.py:703 — mempalace/sync.py changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in sync.sync_palace at line 703. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/sync.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/logstream.py mempalace/logstream.py:961 — mempalace/logstream.py changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in Logstream.list_events at line 961. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/logstream.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/cli/cmd_serve.py mempalace/cli/cmd_serve.py:72 — mempalace/cli/cmd_serve.py changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in cmd_serve.cmd_serve at line 72. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/cli/cmd_serve.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: mempalace/backends/pgvector.py mempalace/backends/pgvector.py:1075 — mempalace/backends/pgvector.py changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in PgVectorCollection.query at line 1075. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/backends/pgvector.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 39 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×31
  • FileTooLong: mempalace/repair.py mempalace/repair.py — FileTooLong — 1721 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1221 over it, 3.44× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1682 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1182 over it, 3.36× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: mempalace/miner.py mempalace/miner.py — FileTooLong — 1373 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 873 over it, 2.75× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: mempalace/query_parser.py mempalace/query_parser.py — FileTooLong — 1351 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 851 over it, 2.70× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backends/pgvector.py mempalace/backends/pgvector.py — FileTooLong — 1148 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 648 over it, 2.30× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: hermes/__init__.py mempalace/integrations/hermes/__init__.py — FileTooLong — 1090 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 590 over it, 2.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: mcp_server/tools_write.py mempalace/mcp_server/tools_write.py — FileTooLong — 1060 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 560 over it, 2.12× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: mempalace/hooks_cli.py mempalace/hooks_cli.py — FileTooLong — 1047 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 547 over it, 2.09× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backends/milvus.py mempalace/backends/milvus.py — FileTooLong — 1017 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 517 over it, 2.03× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: backends/sqlite_exact.py mempalace/backends/sqlite_exact.py — FileTooLong — 1014 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 514 over it, 2.03× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1003 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 503 over it, 2.01× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: mcp_server/http.py mempalace/mcp_server/http.py — FileTooLong — 1000 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 500 over it, 2.00× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: cli/parser.py mempalace/cli/parser.py — FileTooLong — 917 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 417 over it, 1.83× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: mempalace/config.py mempalace/config.py — FileTooLong — 849 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 349 over it, 1.70× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: mempalace/mcp_light_server.py mempalace/mcp_light_server.py — FileTooLong — 824 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 324 over it, 1.65× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: mempalace/embedding.py mempalace/embedding.py — FileTooLong — 775 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 275 over it, 1.55× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: mempalace/normalize.py mempalace/normalize.py — FileTooLong — 755 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 255 over it, 1.51× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: mempalace/knowledge_graph.py mempalace/knowledge_graph.py — FileTooLong — 737 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 237 over it, 1.47× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: mcp_server/tools_read.py mempalace/mcp_server/tools_read.py — FileTooLong — 726 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 226 over it, 1.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: mcp_server/protocol.py mempalace/mcp_server/protocol.py — FileTooLong — 719 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 219 over it, 1.44× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: mempalace/palace_graph.py mempalace/palace_graph.py — FileTooLong — 718 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 218 over it, 1.44× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: mempalace/convo_miner.py mempalace/convo_miner.py — FileTooLong — 714 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 214 over it, 1.43× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: mempalace/dialect.py mempalace/dialect.py — FileTooLong — 674 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 174 over it, 1.35× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: mcp_server/_guards.py mempalace/mcp_server/_guards.py — FileTooLong — 625 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 125 over it, 1.25× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: mempalace/logstream.py mempalace/logstream.py — FileTooLong — 601 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 101 over it, 1.20× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • + 6 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×29
  • Swallowed exception (caught, then discarded) mempalace/search_util.py:206 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/repair.py:154 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/repair.py:270 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/repair.py:763 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/repair.py:1560 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/palace_audit.py:162 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/palace_audit.py:189 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/miner.py:310 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/miner.py:1286 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/miner.py:1307 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/miner.py:1382 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/miner.py:2393 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/migrate.py:228 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/migrate.py:287 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/migrate.py:505 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/migrate.py:526 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/migrate.py:589 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/mcp_light_server.py:702 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/mcp_light_server.py:709 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/mcp_light_server.py:716 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/layers.py:591 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/hooks_cli.py:549 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/hooks_cli.py:1241 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/hooks_cli.py:1545 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) mempalace/hooks_cli.py:1691 — `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • + 4 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×18
  • Repeated repair: mempalace/mcp_server/http.py mempalace/mcp_server/http.py:416 — mempalace/mcp_server/http.py changed 23 times in last 90 days and 17 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is http._http_request_rejected at line 416), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(serve): refuse --no-token on a proxied hub, and widen the tokenless hub's browser and proxy checks”; “fix(http): a tokenless hub refuses proxied and cross-origin requests, and /mcp takes only JSON”; “fix(serve): keep a local-only loopback hub tokenless; require a token once it is reachable”; “fix(mcp): show stray bytes to clients as U+FFFD and keep them exact elsewhere”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/mcp_server/http.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: REDACTED REDACTED:197 — REDACTED changed 27 times in last 90 days and 16 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is mcp_server._exec_fragment at line 197), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(recency): order newest-first reads by instant across naive-local and UTC values”; “fix: old wing spellings reach every wing-scoped read”; “fix: name bookkeeping rows by ingest_mode and fill pages past them”; “fix: keep registry rows and sentinels out of every user-facing reader”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: REDACTED REDACTED:91 — REDACTED changed 17 times in last 90 days and 11 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is searcher._exec_fragment at line 91), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(date_window): compare filed_at as instants across naive-local and UTC values”; “fix: old wing spellings reach every wing-scoped read”; “fix: keep registry rows and sentinels out of every user-facing reader”; “fix(compress): store AAAK summaries in their own collection, not the closets”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mempalace/server_registry.py mempalace/server_registry.py:223 — mempalace/server_registry.py changed 17 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is server_registry.read_live_serverinfo at line 223), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(fsio): replace links where the old writers did, and retry reads that race a Windows rename”; “fix(mcp): close the review gaps in argument checks, tool errors and token creation”; “fix(proc): one pid_alive with daemon semantics”; “fix(hub): retry stale bearer token on 401”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/server_registry.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mempalace/fsio.py mempalace/fsio.py:268 — mempalace/fsio.py changed 12 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is fsio.atomic_publish at line 268), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(fsio): replace links where the old writers did, and retry reads that race a Windows rename”; “fix(fsio): create every temporary file exclusively and never write an unfollowed link in place”; “fix(update): retry a read that races a publish of the release cache”; “fix(fsio): retry renames a Windows reader blocks, and fail fast on a lasting lock-file denial”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/fsio.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mempalace/mcp_server/_guards.py mempalace/mcp_server/_guards.py:740 — mempalace/mcp_server/_guards.py changed 15 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is _guards._sqlite_integrity_payload at line 740), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(kg): keep each palace on the graph that holds its facts; reads never create one”; “fix(mcp-http): keep mesh routes off the write queue and read whole integrity verdicts”; “fix(mcp-http): lock node profile and publish one integrity verdict”; “fix(mcp): release palace lock if writer setup fails after acquire (#2618) (#2632)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/mcp_server/_guards.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mempalace/mcp_server/runtime.py mempalace/mcp_server/runtime.py:133 — mempalace/mcp_server/runtime.py changed 11 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is runtime._run_stdio_loop at line 133), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mcp): show stray bytes to clients as U+FFFD and keep them exact elsewhere”; “fix(mine): carry stray bytes through every wire, export and LLM request”; “fix(mcp): keep the stdio servers up on a line json.loads rejects (#2556) (#2557)”; “fix(mcp): answer the requests the stdio proxy cannot serve (#2554) (#2555)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/mcp_server/runtime.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mempalace/searcher/candidates.py mempalace/searcher/candidates.py:123 — mempalace/searcher/candidates.py changed 7 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is candidates._enrich_closet_hits at line 123), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(search): keep the closet boost through the hybrid rank and on the cosine scale”; “fix(search): follow Chroma's l2/ip distances, gate union hits once, and make min_similarity 1.0 exact”; “fix(search): treat a non-positive max_distance as no cutoff, and note the change”; “fix(search): no default distance cutoff, one cosine scale, and keep unscored BM25 hits”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/searcher/candidates.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mempalace/revisions.py mempalace/revisions.py:133 — mempalace/revisions.py changed 7 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is revisions._purge_locked at line 133), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: preserve revisions and report graph imports accurately”; “fix(fsio): retry renames a Windows reader blocks, and fail fast on a lasting lock-file denial”; “fix(mcp): show stray bytes to clients as U+FFFD and keep them exact elsewhere”; “fix(mcp): serialize revision appends and purges under one file lock”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/revisions.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mempalace/stored_text.py mempalace/stored_text.py:179 — mempalace/stored_text.py changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is stored_text.prepare_stored_write at line 179), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(chroma): log an unreadable status fallback and encode tuple filter operands”; “fix: honest graph errors, a sanitizer that says what it changed, typed bookkeeping metadata”; “fix(mcp): show stray bytes to clients as U+FFFD and keep them exact elsewhere”; “fix(mine): carry stray bytes through every wire, export and LLM request”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/stored_text.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mempalace/palace/writes.py mempalace/palace/writes.py:62 — mempalace/palace/writes.py changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is writes._split_unchanged at line 62), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mine): read stored vectors only for unchanged drawers, and re-embed if the read fails”; “fix(mine): a collision is another source's drawer, not the same source's moved chunk”; “fix(mine): keep closets and AAAK summaries of unchanged drawers on a re-file”; “fix(compress): delete a drawer's AAAK summary with it and clean old palaces on rebuild”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/palace/writes.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mempalace/sweeper.py mempalace/sweeper.py:91 — mempalace/sweeper.py changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is sweeper.parse_claude_jsonl at line 91), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mine): decode source files without turning bytes into U+FFFD”; “fix(sync): record which directory a source was mined from (#2367) (#2368)”; “fix(ingest): finish the non-regular-file guards left out of 3.7.1 (#2221)”; “fix(ingest): never block on a non-regular file (#2221)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/sweeper.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/mempalace-core/src/lib.rs crates/mempalace-core/src/lib.rs:162 — crates/mempalace-core/src/lib.rs changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is VectorIndex::load_from_sqlite at line 162), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(rust): clear the clippy warnings and declare the 1.88 minimum”; “fix: complete Rust search cache and reader lifecycle integration”; “fix(native): retry concurrent snapshots and support legacy CLI reads”; “fix(search): infer migrated dimensions and open closets read-only”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- crates/mempalace-core/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mempalace/backends/_sidecar.py mempalace/backends/_sidecar.py:53 — mempalace/backends/_sidecar.py changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is _sidecar.write_embedder_sidecar at line 53), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(embedding): keep a recorded dimension when the probe fails for the same model”; “fix: keep the corrupt-state guard to state files and tidy it”; “fix: refuse to overwrite a state file that did not parse”; “fix(embedding): keep the MiniLM fallback for unknown embedding_model; refuse near misses; read legacy palaces; check and record the embedder identity everywhere; run EmbeddingGemma 2 on CUDA (#2717)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/backends/_sidecar.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: REDACTED REDACTED:189 — REDACTED changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is HubClient.discover at line 189), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(proxy): keep a search local when this session chose its own settings”; “fix(mcp): show stray bytes to clients as U+FFFD and keep them exact elsewhere”; “fix(mine): carry stray bytes through every wire, export and LLM request”; “fix(hub): derive search forwarding and the hub fingerprint from one settings table”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mempalace/general_extractor.py mempalace/general_extractor.py:453 — mempalace/general_extractor.py changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is general_extractor._split_into_segments at line 453), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mine): decode source files without turning bytes into U+FFFD”; “fix(general_extractor): re-mine general-mode files filed by the old extractor”; “fix(general_extractor): keep paragraphs that match no keyword”; “fix(extractor): ignore markdown emphasis as emotion”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/general_extractor.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mempalace/palace/mine_lock.py mempalace/palace/mine_lock.py:161 — mempalace/palace/mine_lock.py changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is mine_lock._cleanup_mine_lock_file at line 161), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(fsio): retry renames a Windows reader blocks, and fail fast on a lasting lock-file denial”; “fix(lock): ride out Windows delete-pending opens and wait past LK_LOCK's ten tries”; “fix(hub): keep mempalace_reconnect out of a running mine; count failed files as errors”; “fix: keep status, search and wake-up responsive on large palaces (#2593)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/palace/mine_lock.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: mempalace/metadata_types.py mempalace/metadata_types.py:43 — mempalace/metadata_types.py changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is metadata_types._as_int at line 43), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: name bookkeeping rows by ingest_mode and fill pages past them”; “fix: keep registry rows and sentinels out of every user-facing reader”; “fix: make graph reads write nothing of ours, and sanitize every search path”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 20:16:07 -03:00' --until='2026-10-20 20:16:07 -03:00' --full-history --no-merges -- mempalace/metadata_types.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×16
  • Animation without a prefers-reduced-motion guard website/.vitepress/theme/landing/landing.css:299 — `.mempalace-landing .waitlist-pulse` moves (`animation: mpl-breathe 2.2s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard website/.vitepress/theme/landing/landing.css:351 — `.mempalace-landing .waitlist-submit` moves (`transition: background 0.25s, color 0.25s, box-shadow 0.25s, transform 0.25s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard website/.vitepress/theme/landing/landing.css:444 — `.mempalace-landing .btn` moves (`transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard website/.vitepress/theme/landing/landing.css:514 — `.mempalace-landing .palace-stage .halo` moves (`animation: mpl-haloPulse 7s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard website/.vitepress/theme/landing/landing.css:547 — `.mempalace-landing .palace-stage .stars i` moves (`animation: mpl-twinkle var(--t, 5s) ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard website/.vitepress/theme/landing/landing.css:687 — `.mempalace-landing .msg` moves (`animation: mpl-msg-in 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard website/.vitepress/theme/landing/landing.css:736 — `.mempalace-landing .chat .divider-time` moves (`animation: mpl-msg-in 0.5s ease 0.05s forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard website/.vitepress/theme/landing/landing.css:762 — `.mempalace-landing .chat .retrieval` moves (`animation: mpl-msg-in 0.5s ease forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard website/.vitepress/theme/landing/landing.css:775 — `.mempalace-landing .chat .stamp` moves (`animation: mpl-msg-in 0.6s ease forwards`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard website/.vitepress/theme/landing/landing.css:834 — `.mempalace-landing .stratum` moves (`transition: border-color 0.4s ease, transform 0.4s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard website/.vitepress/theme/landing/landing.css:1218 — `.mempalace-landing .stratum:nth-child(3) .diagram svg .closet` moves (`animation: mpl-closet-wave 3.6s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard website/.vitepress/theme/landing/landing.css:1232 — `.mempalace-landing .stratum:nth-child(4) .diagram svg rect` moves (`animation: mpl-drawer-slide 4.2s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard website/.vitepress/theme/landing/landing.css:1242 — `.mempalace-landing .stratum:nth-child(4) .diagram svg circle` moves (`animation: mpl-dot-pulse 2.2s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard website/.vitepress/theme/landing/landing.css:1269 — `.mempalace-landing .mech:nth-child(2) .icon svg .mech-ring` moves (`animation: mpl-ring-breathe 4s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard website/.vitepress/theme/landing/landing.css:1288 — `.mempalace-landing .mech:nth-child(3) .icon svg .mech-gear` moves (`animation: mpl-gear-spin 12s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard website/.vitepress/theme/landing/landing.css:1302 — `.mempalace-landing .mech:nth-child(4) .icon svg .mech-nodes circle` moves (`animation: mpl-graph-node 3.2s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
X3 · Exception handling · Swallowed exception (empty catch) · ×11
  • Swallowed exception (empty catch) mempalace/repair.py:542 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) mempalace/repair.py:551 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) mempalace/repair.py:623 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) mempalace/repair.py:2872 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) mempalace/query_parser.py:322 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) mempalace/query_parser.py:501 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) mempalace/query_parser.py:907 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) mempalace/query_parser.py:1477 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) mempalace/mcp_light_server.py:149 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) mempalace/mcp_light_server.py:235 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:312 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×8
  • Duplicated block (7 lines × 2) mempalace/backends/rust_exact.py:152 — mempalace/backends/rust_exact.py:152-158 | mempalace/backends/sqlite_exact.py:1042-1050 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `mempalace/backends/sqlite_exact.py:1042` 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) mempalace/cli/cmd_sync.py:96 — mempalace/cli/cmd_sync.py:96-102 | mempalace/service.py:479-485 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) mempalace/integrations/hermes/__init__.py:152 — mempalace/integrations/hermes/__init__.py:152-158 | mempalace/layers.py:421-429 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) mempalace/mcp_server/protocol.py:955 — mempalace/mcp_server/protocol.py:955-961 | mempalace/mcp_server/protocol.py:1003-1009 — both copies are in the same file, so extract the 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 (7 lines × 2) mempalace/query_parser.py:438 — mempalace/query_parser.py:438-444 | mempalace/query_parser.py:817-823 — both copies are in the same file, so extract the 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 (7 lines × 2) mempalace/query_parser.py:541 — mempalace/query_parser.py:541-547 | mempalace/query_parser.py:689-695 — both copies are in the same file, so extract the 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mempalace/query_parser.py:697` calls `upper` and `mempalace/query_parser.py:549` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) mempalace/query_parser.py:1415 — mempalace/query_parser.py:1415-1421 | mempalace/query_parser.py:1650-1656 — both copies are in the same file, so extract the block into 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) mempalace/embedding.py:1165 — mempalace/embedding.py:1165-1171 | mempalace/spellcheck.py:144-150 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×7
  • Recursive walk over a caller-supplied document has no depth cap mempalace/query_parser.py:437 — `parse_query_input` is public and takes `input_data: Any` from its caller, and it calls itself at line 437 (`parse_query_input`) with a piece of `input_data` (and at line 500) — and nowhere in `parse_query_input` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `parse_query_input` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap mempalace/query_parser.py:1312 — `parse_coordinate_input` is public and takes `input_data: Any` from its caller, and it calls itself at line 1312 (`parse_coordinate_input`) with a piece of `input_data` (and at line 1476) — and nowhere in `parse_coordinate_input` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `parse_coordinate_input` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap mempalace/knowledge_graph.py:228 — `add_entity` is public, takes a document from its caller (line 436) and hands it to `_drop_none`, which calls itself at line 228 (`_drop_none`) with a piece of `props` — and nowhere in `_drop_none` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_drop_none` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap mempalace/backends/sqlite_exact.py:186 — `facet_counts` is public, takes a document from its caller (line 1400) and hands it to `_equality_where_sql`, which calls itself at line 186 (`_equality_where_sql`) with a piece of `where` — and nowhere in `_equality_where_sql` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_equality_where_sql` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap REDACTED:463 — `get_all_metadata` is public, takes a document from its caller (line 840) and hands it to `_qdrant_filter`, which calls itself at line 463 (`_qdrant_filter`) with a piece of `where` — and nowhere in `_qdrant_filter` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_qdrant_filter` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap mempalace/backends/_filters.py:89 — `matches_where` is public and takes `where: Optional[dict]` from its caller, and it calls itself at line 89 (`matches_where`) with a piece of `where` (and at line 93) — and nowhere in `matches_where` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `matches_where` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap mempalace/backends/_filters.py:120 — `matches_where_document` is public and takes `where_document: Optional[dict]` from its caller, and it calls itself at line 120 (`matches_where_document`) with a piece of `where_document` (and at line 124) — and nowhere in `matches_where_document` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `matches_where_document` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
D30 · Dependency Vulnerabilities · Medium CVE · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×6
  • Duplicated block (11 lines × 2) mempalace/backends/embedding_wrapper.py:356 — mempalace/backends/embedding_wrapper.py:356-366 | mempalace/backends/embedding_wrapper.py:391-401 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) mempalace/backends/milvus.py:557 — mempalace/backends/milvus.py:557-567 | REDACTED:772-782 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) mempalace/backends/rust_exact.py:176 — mempalace/backends/rust_exact.py:176-186 | mempalace/backends/sqlite_exact.py:1077-1087 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) mempalace/config.py:125 — mempalace/config.py:125-135 | mempalace/config.py:153-168 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `field_name` to `str = "name"` in one and `str = "value"` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mempalace/config.py:139` calls `ValueError` and `mempalace/config.py:170` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) mempalace/convo_miner.py:984 — mempalace/convo_miner.py:984-994 | mempalace/format_miner.py:835-845 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) mempalace/query_parser.py:732 — mempalace/query_parser.py:732-742 | mempalace/query_parser.py:965-975 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×6
  • Duplicated block (5 lines × 2) mempalace/backends/pgvector.py:1111 — mempalace/backends/pgvector.py:1111-1115 | mempalace/backends/sqlite_exact.py:1027-1031 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) mempalace/integrations/hermes/__init__.py:1423 — mempalace/integrations/hermes/__init__.py:1423-1428 | mempalace/integrations/hermes/__init__.py:1448-1452 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mempalace/integrations/hermes/__init__.py:1422` calls `count` and `mempalace/integrations/hermes/__init__.py:1447` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) mempalace/backends/milvus.py:882 — mempalace/backends/milvus.py:882-886 | REDACTED:1020-1024 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `_MilvusConfig` in one and `_QdrantConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (5 lines × 2) mempalace/convo_miner.py:194 — mempalace/convo_miner.py:194-198 | mempalace/miner.py:73-77 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) mempalace/knowledge_graph.py:395 — mempalace/knowledge_graph.py:395-399 | mempalace/logstream.py:595-599 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (5 lines × 2) crates/mempalace-cli/src/main.rs:153 — crates/mempalace-cli/src/main.rs:153-157 | crates/mempalace-cli/src/main.rs:169-173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D31 · IaC & Container Security · Medium IaC · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×4
  • Duplicated block (9 lines × 2) mempalace/backends/milvus.py:541 — mempalace/backends/milvus.py:541-549 | REDACTED:758-767 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `mempalace/backends/milvus.py:541` 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) mempalace/query_parser.py:577 — mempalace/query_parser.py:577-585 | mempalace/query_parser.py:663-671 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) mempalace/wal.py:96 — mempalace/wal.py:96-107 | mempalace/wal.py:129-137 — both copies are in the same file, so extract the 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 first that the copies are not typed on the same thing: the declarations holding them bind `result` to `dict = None` in one and `dict` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) mempalace/backends/pgvector.py:869 — mempalace/backends/pgvector.py:869-877 | REDACTED:511-519 — before extracting anything, compare `mempalace/backends/pgvector.py` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 233 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.
D3 · God Classes · TooManyMethods · ×3
  • TooManyMethods: MempalaceProvider mempalace/integrations/hermes/__init__.py:610 — TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: EmbeddingGemma2EmbeddingFunction mempalace/embeddinggemma2.py:127 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SQLiteExactCollection mempalace/backends/sqlite_exact.py:459 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×3
  • Duplicated block (13 lines × 3) mempalace/backends/milvus.py:983 — mempalace/backends/milvus.py:983-995 | mempalace/backends/pgvector.py:1668-1680 | REDACTED:1131-1143 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 3) mempalace/backends/pgvector.py:1404 — mempalace/backends/pgvector.py:1404-1416 | REDACTED:963-975 | mempalace/backends/sqlite_exact.py:1438-1450 — before extracting anything, compare `mempalace/backends/pgvector.py` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 3) mempalace/query_parser.py:411 — mempalace/query_parser.py:411-423 | mempalace/query_parser.py:798-810 | mempalace/query_parser.py:1298-1310 — 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 `mempalace/query_parser.py:411` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×3
  • Duplicated block (10 lines × 2) mempalace/backends/pgvector.py:1064 — mempalace/backends/pgvector.py:1064-1073 | REDACTED:722-731 — before extracting anything, compare `mempalace/backends/pgvector.py` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 233 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) mempalace/cli/cmd_mine.py:471 — mempalace/cli/cmd_mine.py:471-480 | mempalace/service.py:336-345 — 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 `mempalace/cli/cmd_mine.py: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.
  • Duplicated block (10 lines × 2) mempalace/query_parser.py:1050 — mempalace/query_parser.py:1050-1059 | mempalace/query_parser.py:1085-1094 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×3
  • Duplicated block (8 lines × 2) mempalace/query_parser.py:1668 — mempalace/query_parser.py:1668-1675 | mempalace/query_parser.py:1697-1704 — both copies are in the same file, so extract the 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 2) mempalace/backends/registry.py:186 — mempalace/backends/registry.py:186-193 | mempalace/sources/registry.py:142-149 — 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) mempalace/backends/milvus.py:810 — mempalace/backends/milvus.py:810-817 | mempalace/backends/pgvector.py:1422-1429 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×3
  • Duplicated block (6 lines × 2) mempalace/backends/pgvector.py:166 — mempalace/backends/pgvector.py:166-171 | REDACTED:110-115 — before extracting anything, compare `mempalace/backends/pgvector.py` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 233 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 (6 lines × 2) mempalace/backends/pgvector.py:201 — mempalace/backends/pgvector.py:201-206 | REDACTED:83-88 — before extracting anything, compare `mempalace/backends/pgvector.py` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) mempalace/backends/pgvector.py:1372 — mempalace/backends/pgvector.py:1372-1377 | REDACTED:935-940 — before extracting anything, compare `mempalace/backends/pgvector.py` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 233 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change coupling · ×2
  • Change coupling: query.py ↔ sqlite_bm25.py mempalace/searcher/query.py:1 — `mempalace/searcher/query.py` and `mempalace/searcher/sqlite_bm25.py` change together 80% of the time (8 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `25f6f373` fix(date_window): compare filed_at as instants across naive-local and…; `759e876b` refactor: one wing slug for every producer, and diary and ingest shar…; `a778964f` fix: keep registry rows and sentinels out of every user-facing reader — run `git show` on any of them.
  • Change coupling: miner.py ↔ sweeper.py mempalace/miner.py:1 — `mempalace/miner.py` and `mempalace/sweeper.py` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `e622f564` chore(mine): say what the miners' comments guard, not which PR added …; `52077e9c` fix(mine): decode source files without turning bytes into U+FFFD; `f8b9ed15` fix(sync): record which directory a source was mined from (#2367) (#2… — run `git show` on any of them.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×2
  • Duplicated block (21–22 lines × 2) mempalace/backends/registry.py:86 — mempalace/backends/registry.py:86-107 | mempalace/sources/registry.py:73-93 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mempalace/sources/registry.py:72` calls `_register_builtins` and `mempalace/backends/registry.py:85` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (21–22 lines × 2) mempalace/repair.py:490 — mempalace/repair.py:490-510 | mempalace/repair.py:515-536 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×2
  • Duplicated block (16 lines × 2) mempalace/mcp_server/tools_read.py:723 — mempalace/mcp_server/tools_read.py:723-738 | mempalace/mcp_server/tools_read.py:745-760 — both copies are in the same file, so extract the block into 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) mempalace/query_parser.py:412 — mempalace/query_parser.py:412-427 | mempalace/query_parser.py:799-814 — both copies are in the same file, so extract the 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 `mempalace/query_parser.py: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.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×2
  • Duplicated block (15 lines × 2) mempalace/mcp_server/tools_coord.py:35 — mempalace/mcp_server/tools_coord.py:35-49 | mempalace/mcp_server/tools_coord.py:291-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 `mempalace/mcp_server/tools_coord.py: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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (15 lines × 2) mempalace/query_parser.py:1436 — mempalace/query_parser.py:1436-1450 | mempalace/query_parser.py:1599-1613 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mempalace/query_parser.py:1596` calls `QueryParseError` and `mempalace/query_parser.py:1435` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×2
  • Duplicated block (14 lines × 2) REDACTED:1969 — REDACTED:1969-1982 | REDACTED:2004-2017 — both copies are in the same file, so extract the block into 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) mempalace/cli/cmd_sync.py:104 — mempalace/cli/cmd_sync.py:104-117 | mempalace/service.py:487-500 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×2
  • Duplicated block (13 lines × 2) mempalace/backends/milvus.py:1115 — mempalace/backends/milvus.py:1115-1127 | mempalace/backends/pgvector.py:1719-1731 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (13 lines × 2) mempalace/backends/pgvector.py:1001 — mempalace/backends/pgvector.py:1001-1013 | REDACTED:647-659 — before extracting anything, compare `mempalace/backends/pgvector.py` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×2
  • Duplicated block (12 lines × 2) mempalace/backends/sqlite_exact.py:647 — mempalace/backends/sqlite_exact.py:647-658 | mempalace/backends/sqlite_exact.py:691-702 — both copies are in the same file, so extract the block into 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) mempalace/cli/cmd_rooms.py:92 — mempalace/cli/cmd_rooms.py:92-103 | mempalace/cli/cmd_tunnels.py:26-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `mempalace/cli/cmd_rooms.py:92` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×2
  • Duplicated block (9–10 lines × 2) mempalace/cli/parser.py:1019 — mempalace/cli/parser.py:1019-1028 | mempalace/cli/parser.py:1097-1105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mempalace/cli/parser.py:1019` 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 (9–10 lines × 2) mempalace/room_detector_local.py:130 — mempalace/room_detector_local.py:130-138 | mempalace/room_detector_local.py:164-173 — both copies are in the same file, so extract the 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 `mempalace/room_detector_local.py:164` 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×2
  • Low cohesion: MedicalPalaceEnvironment (LCOM4 4) benchmarks/test_ollama_medical_private_palace.py:186 — MedicalPalaceEnvironment's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: BaseCollection (LCOM4 4) mempalace/backends/base.py:477 — BaseCollection's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
AC3 · Page structure · Page without a main landmark · ×1
  • Page without a main landmark REDACTED:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
AC3 · Page structure · Heading level jumps from h2 to h4 · ×1
  • Heading level jumps from h2 to h4 REDACTED:1713 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC7 · A11y enforcement · Accessibility enforcement below the top rung · ×1
  • Accessibility enforcement below the top rung — 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 was searched, so you can tell an absence from a miss: the 1 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
D1 · Cyclomatic Complexity · query_parser.parse_coordinate_input (cyclomatic 231) · ×1
  • query_parser.parse_coordinate_input (cyclomatic 231) mempalace/query_parser.py:1287 — query_parser.parse_coordinate_input has cyclomatic complexity 231 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: mempalace/query_parser.py holds 5 of the 149 methods over the threshold — including the worst — and 536 of the 1489 points over it (36%), 11.4× the next-largest file (mempalace/miner.py at 47). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · query_parser.parse_exec_input (cyclomatic 175) · ×1
  • query_parser.parse_exec_input (cyclomatic 175) mempalace/query_parser.py:786 — query_parser.parse_exec_input has cyclomatic complexity 175 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: mempalace/query_parser.py holds 5 of the 149 methods over the threshold — including the worst — and 536 of the 1489 points over it (36%), 11.4× the next-largest file (mempalace/miner.py at 47). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · query_parser.parse_query_input (cyclomatic 156) · ×1
  • query_parser.parse_query_input (cyclomatic 156) mempalace/query_parser.py:399 — query_parser.parse_query_input has cyclomatic complexity 156 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: mempalace/query_parser.py holds 5 of the 149 methods over the threshold — including the worst — and 536 of the 1489 points over it (36%), 11.4× the next-largest file (mempalace/miner.py at 47). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · media_search.search_with_media (cyclomatic 39) · ×1
  • media_search.search_with_media (cyclomatic 39) mempalace/searcher/media_search.py:17 — media_search.search_with_media has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cmd_serve.cmd_serve (cyclomatic 36) · ×1
  • cmd_serve.cmd_serve (cyclomatic 36) mempalace/cli/cmd_serve.py:72 — cmd_serve.cmd_serve has cyclomatic complexity 36 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _session._get_collection (cyclomatic 36) · ×1
  • _session._get_collection (cyclomatic 36) mempalace/mcp_server/_session.py:195 — _session._get_collection has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sqlite_bm25._bm25_only_via_sqlite (cyclomatic 36) · ×1
  • sqlite_bm25._bm25_only_via_sqlite (cyclomatic 36) mempalace/searcher/sqlite_bm25.py:114 — sqlite_bm25._bm25_only_via_sqlite has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cmd_coord._logstream_watch (cyclomatic 32) · ×1
  • cmd_coord._logstream_watch (cyclomatic 32) mempalace/cli/cmd_coord.py:189 — cmd_coord._logstream_watch has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · miner.scan_project (cyclomatic 32) · ×1
  • miner.scan_project (cyclomatic 32) mempalace/miner.py:1760 — miner.scan_project has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · service.run_mine (cyclomatic 32) · ×1
  • service.run_mine (cyclomatic 32) mempalace/service.py:122 — service.run_mine has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Dialect.generate_layer1 (cyclomatic 31) · ×1
  • Dialect.generate_layer1 (cyclomatic 31) mempalace/dialect.py:808 — Dialect.generate_layer1 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.
D1 · Cyclomatic Complexity · format_miner._mine_formats_impl (cyclomatic 31) · ×1
  • format_miner._mine_formats_impl (cyclomatic 31) mempalace/format_miner.py:767 — format_miner._mine_formats_impl 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.
D1 · Cyclomatic Complexity · tools_write.tool_update_drawer (cyclomatic 31) · ×1
  • tools_write.tool_update_drawer (cyclomatic 31) mempalace/mcp_server/tools_write.py:1421 — tools_write.tool_update_drawer 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.
D1 · Cyclomatic Complexity · miner._mine_impl (cyclomatic 31) · ×1
  • miner._mine_impl (cyclomatic 31) mempalace/miner.py:1945 — miner._mine_impl 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.
D1 · Cyclomatic Complexity · project_scanner.scan (cyclomatic 31) · ×1
  • project_scanner.scan (cyclomatic 31) REDACTED:528 — project_scanner.scan 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.
D1 · Cyclomatic Complexity · cli_search.search (cyclomatic 31) · ×1
  • cli_search.search (cyclomatic 31) mempalace/searcher/cli_search.py:179 — cli_search.search 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.
D1 · Cyclomatic Complexity · diary_ingest.ingest_diaries (cyclomatic 30) · ×1
  • diary_ingest.ingest_diaries (cyclomatic 30) mempalace/diary_ingest.py:94 — diary_ingest.ingest_diaries has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sqlite_bm25._merge_bm25_union_candidates (cyclomatic 30) · ×1
  • sqlite_bm25._merge_bm25_union_candidates (cyclomatic 30) mempalace/searcher/sqlite_bm25.py:316 — sqlite_bm25._merge_bm25_union_candidates has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sync.sync_palace (cyclomatic 30) · ×1
  • sync.sync_palace (cyclomatic 30) mempalace/sync.py:703 — sync.sync_palace has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cmd_coord.cmd_logstream (cyclomatic 29) · ×1
  • cmd_coord.cmd_logstream (cyclomatic 29) mempalace/cli/cmd_coord.py:368 — cmd_coord.cmd_logstream has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cmd_repair.cmd_repair (cyclomatic 29) · ×1
  • cmd_repair.cmd_repair (cyclomatic 29) mempalace/cli/cmd_repair.py:201 — cmd_repair.cmd_repair has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · cmd_sync.cmd_sync (cyclomatic 29) · ×1
  • cmd_sync.cmd_sync (cyclomatic 29) mempalace/cli/cmd_sync.py:6 — cmd_sync.cmd_sync has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · hallways.compute_hallways_for_wing (cyclomatic 29) · ×1
  • hallways.compute_hallways_for_wing (cyclomatic 29) mempalace/hallways.py:642 — hallways.compute_hallways_for_wing has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cmd_init.cmd_init (cyclomatic 28) · ×1
  • cmd_init.cmd_init (cyclomatic 28) mempalace/cli/cmd_init.py:6 — cmd_init.cmd_init 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.
D1 · Cyclomatic Complexity · cmd_rooms.cmd_rooms (cyclomatic 28) · ×1
  • cmd_rooms.cmd_rooms (cyclomatic 28) mempalace/cli/cmd_rooms.py:72 — cmd_rooms.cmd_rooms has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · tools_read.tool_search (cyclomatic 28) · ×1
  • tools_read.tool_search (cyclomatic 28) mempalace/mcp_server/tools_read.py:608 — tools_read.tool_search 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.
D1 · Cyclomatic Complexity · query_parser.tokenize_dsl (cyclomatic 28) · ×1
  • query_parser.tokenize_dsl (cyclomatic 28) mempalace/query_parser.py:131 — query_parser.tokenize_dsl 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. This file is where this pass's cyclomatic complexity CONCENTRATES: mempalace/query_parser.py holds 5 of the 149 methods over the threshold — including the worst — and 536 of the 1489 points over it (36%), 11.4× the next-largest file (mempalace/miner.py at 47). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · query.search_memories (cyclomatic 28) · ×1
  • query.search_memories (cyclomatic 28) mempalace/searcher/query.py:189 — query.search_memories 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.
D1 · Cyclomatic Complexity · SQLiteExactCollection._rows (cyclomatic 27) · ×1
  • SQLiteExactCollection._rows (cyclomatic 27) mempalace/backends/sqlite_exact.py:850 — SQLiteExactCollection._rows 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.
D1 · Cyclomatic Complexity · cmd_serve.cmd_compress (cyclomatic 27) · ×1
  • cmd_serve.cmd_compress (cyclomatic 27) mempalace/cli/cmd_serve.py:198 — cmd_serve.cmd_compress 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.
D1 · Cyclomatic Complexity · convo_miner._mine_convos_impl (cyclomatic 27) · ×1
  • convo_miner._mine_convos_impl (cyclomatic 27) mempalace/convo_miner.py:952 — convo_miner._mine_convos_impl 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.
D1 · Cyclomatic Complexity · protocol.call_tool (cyclomatic 27) · ×1
  • protocol.call_tool (cyclomatic 27) mempalace/mcp_server/protocol.py:905 — protocol.call_tool 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.
D1 · Cyclomatic Complexity · service.run_sync (cyclomatic 27) · ×1
  • service.run_sync (cyclomatic 27) mempalace/service.py:397 — service.run_sync 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.
D1 · Cyclomatic Complexity · tunnels_tool.propose_tunnels (cyclomatic 27) · ×1
  • tunnels_tool.propose_tunnels (cyclomatic 27) mempalace/tunnels_tool.py:216 — tunnels_tool.propose_tunnels 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.
D1 · Cyclomatic Complexity · ChromaCollection.query (cyclomatic 26) · ×1
  • ChromaCollection.query (cyclomatic 26) REDACTED:2081 — ChromaCollection.query 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.
D1 · Cyclomatic Complexity · EmbeddingCollection.update (cyclomatic 26) · ×1
  • EmbeddingCollection.update (cyclomatic 26) mempalace/backends/embedding_wrapper.py:347 — EmbeddingCollection.update 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.
D1 · Cyclomatic Complexity · cmd_mine.cmd_mine (cyclomatic 26) · ×1
  • cmd_mine.cmd_mine (cyclomatic 26) mempalace/cli/cmd_mine.py:8 — cmd_mine.cmd_mine has cyclomatic complexity 26 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · entity_detector.confirm_entities (cyclomatic 26) · ×1
  • entity_detector.confirm_entities (cyclomatic 26) mempalace/entity_detector.py:767 — entity_detector.confirm_entities 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.
D1 · Cyclomatic Complexity · normalize._try_claude_code_jsonl (cyclomatic 26) · ×1
  • normalize._try_claude_code_jsonl (cyclomatic 26) mempalace/normalize.py:324 — normalize._try_claude_code_jsonl 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.
D1 · Cyclomatic Complexity · chroma.quarantine_invalid_hnsw_metadata (cyclomatic 25) · ×1
  • chroma.quarantine_invalid_hnsw_metadata (cyclomatic 25) REDACTED:1491 — chroma.quarantine_invalid_hnsw_metadata has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cmd_coord.cmd_task (cyclomatic 25) · ×1
  • cmd_coord.cmd_task (cyclomatic 25) mempalace/cli/cmd_coord.py:548 — cmd_coord.cmd_task has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SQLiteExactBackend._connect (cyclomatic 24) · ×1
  • SQLiteExactBackend._connect (cyclomatic 24) mempalace/backends/sqlite_exact.py:1705 — SQLiteExactBackend._connect has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · mcp_light_server._alias_args_for_handler (cyclomatic 24) · ×1
  • mcp_light_server._alias_args_for_handler (cyclomatic 24) mempalace/mcp_light_server.py:845 — mcp_light_server._alias_args_for_handler has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · tools_write.tool_mine (cyclomatic 24) · ×1
  • tools_write.tool_mine (cyclomatic 24) mempalace/mcp_server/tools_write.py:824 — tools_write.tool_mine has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · palace_graph.entity_tunnel_candidates (cyclomatic 24) · ×1
  • palace_graph.entity_tunnel_candidates (cyclomatic 24) mempalace/palace_graph.py:1188 — palace_graph.entity_tunnel_candidates 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.
D1 · Cyclomatic Complexity · cmd_sync.cmd_daemon (cyclomatic 23) · ×1
  • cmd_sync.cmd_daemon (cyclomatic 23) mempalace/cli/cmd_sync.py:200 — cmd_sync.cmd_daemon has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cmd_tunnels.cmd_tunnels (cyclomatic 23) · ×1
  • cmd_tunnels.cmd_tunnels (cyclomatic 23) mempalace/cli/cmd_tunnels.py:15 — cmd_tunnels.cmd_tunnels has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · encoding_repair.repair_collection (cyclomatic 23) · ×1
  • encoding_repair.repair_collection (cyclomatic 23) mempalace/encoding_repair.py:416 — encoding_repair.repair_collection has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mcp_light_server.handle_light_request (cyclomatic 23) · ×1
  • mcp_light_server.handle_light_request (cyclomatic 23) mempalace/mcp_light_server.py:733 — mcp_light_server.handle_light_request has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tools_diary._tool_reconnect_locked (cyclomatic 23) · ×1
  • tools_diary._tool_reconnect_locked (cyclomatic 23) mempalace/mcp_server/tools_diary.py:409 — tools_diary._tool_reconnect_locked has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tools_write._fetch_drawer_rows (cyclomatic 23) · ×1
  • tools_write._fetch_drawer_rows (cyclomatic 23) mempalace/mcp_server/tools_write.py:287 — tools_write._fetch_drawer_rows has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MediaAsset.__post_init__ (cyclomatic 23) · ×1
  • MediaAsset.__post_init__ (cyclomatic 23) mempalace/media.py:53 — MediaAsset.__post_init__ has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · palace_graph.build_graph (cyclomatic 23) · ×1
  • palace_graph.build_graph (cyclomatic 23) mempalace/palace_graph.py:240 — palace_graph.build_graph has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · room_detector_local.detect_rooms_from_folders (cyclomatic 23) · ×1
  • room_detector_local.detect_rooms_from_folders (cyclomatic 23) mempalace/room_detector_local.py:104 — room_detector_local.detect_rooms_from_folders has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChromaBackend.get_collection (cyclomatic 22) · ×1
  • ChromaBackend.get_collection (cyclomatic 22) REDACTED:2873 — ChromaBackend.get_collection has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · hooks_cli.hook_stop (cyclomatic 22) · ×1
  • hooks_cli.hook_stop (cyclomatic 22) mempalace/hooks_cli.py:1482 — hooks_cli.hook_stop has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mcp_light_server._enrich_search_results (cyclomatic 22) · ×1
  • mcp_light_server._enrich_search_results (cyclomatic 22) mempalace/mcp_light_server.py:171 — mcp_light_server._enrich_search_results has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · normalize._try_gemini_json (cyclomatic 22) · ×1
  • normalize._try_gemini_json (cyclomatic 22) mempalace/normalize.py:570 — normalize._try_gemini_json has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · chroma_sqlite.sqlite_list_id_metadata (cyclomatic 21) · ×1
  • chroma_sqlite.sqlite_list_id_metadata (cyclomatic 21) mempalace/backends/chroma_sqlite.py:1007 — chroma_sqlite.sqlite_list_id_metadata 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.
D1 · Cyclomatic Complexity · SQLiteExactCollection.update (cyclomatic 21) · ×1
  • SQLiteExactCollection.update (cyclomatic 21) mempalace/backends/sqlite_exact.py:765 — SQLiteExactCollection.update 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.
D1 · Cyclomatic Complexity · format_miner.extract_text (cyclomatic 21) · ×1
  • format_miner.extract_text (cyclomatic 21) mempalace/format_miner.py:293 — format_miner.extract_text 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.
D1 · Cyclomatic Complexity · tools_diary.tool_checkpoint (cyclomatic 21) · ×1
  • tools_diary.tool_checkpoint (cyclomatic 21) mempalace/mcp_server/tools_diary.py:550 — tools_diary.tool_checkpoint 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.
D1 · Cyclomatic Complexity · migrate._migrate_wing_names_locked (cyclomatic 21) · ×1
  • migrate._migrate_wing_names_locked (cyclomatic 21) mempalace/migrate.py:569 — migrate._migrate_wing_names_locked has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · miner.add_to_known_entities (cyclomatic 21) · ×1
  • miner.add_to_known_entities (cyclomatic 21) mempalace/miner.py:925 — miner.add_to_known_entities 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.
D1 · Cyclomatic Complexity · collection._enforce_embedder_identity (cyclomatic 21) · ×1
  • collection._enforce_embedder_identity (cyclomatic 21) mempalace/palace/collection.py:101 — collection._enforce_embedder_identity 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.
D1 · Cyclomatic Complexity · query_parser._parse_key_value_tokens (cyclomatic 21) · ×1
  • query_parser._parse_key_value_tokens (cyclomatic 21) mempalace/query_parser.py:217 — query_parser._parse_key_value_tokens has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: mempalace/query_parser.py holds 5 of the 149 methods over the threshold — including the worst — and 536 of the 1489 points over it (36%), 11.4× the next-largest file (mempalace/miner.py at 47). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
D1 · Cyclomatic Complexity · query_sanitizer.sanitize_query (cyclomatic 21) · ×1
  • query_sanitizer.sanitize_query (cyclomatic 21) mempalace/query_sanitizer.py:77 — query_sanitizer.sanitize_query 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.
D1 · Cyclomatic Complexity · apply (cyclomatic 21) · ×1
  • apply (cyclomatic 21) .dsh-plugin/lib/autosave.js:30 — apply has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to 12 function items inside it that branch (runHook, a function literal at line 106, a function literal at line 122, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · ChromaCollection.get (cyclomatic 20) · ×1
  • ChromaCollection.get (cyclomatic 20) REDACTED:2165 — ChromaCollection.get 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.
D1 · Cyclomatic Complexity · MilvusCollection.query (cyclomatic 20) · ×1
  • MilvusCollection.query (cyclomatic 20) mempalace/backends/milvus.py:523 — MilvusCollection.query has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SQLiteExactCollection._query_once (cyclomatic 20) · ×1
  • SQLiteExactCollection._query_once (cyclomatic 20) mempalace/backends/sqlite_exact.py:1008 — SQLiteExactCollection._query_once has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cmd_mine.mine_source_adapter (cyclomatic 20) · ×1
  • cmd_mine.mine_source_adapter (cyclomatic 20) mempalace/cli/cmd_mine.py:291 — cmd_mine.mine_source_adapter has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · corpus_origin.detect_origin_heuristic (cyclomatic 20) · ×1
  • corpus_origin.detect_origin_heuristic (cyclomatic 20) mempalace/corpus_origin.py:166 — corpus_origin.detect_origin_heuristic 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.
D1 · Cyclomatic Complexity · daemon.start_daemon (cyclomatic 20) · ×1
  • daemon.start_daemon (cyclomatic 20) mempalace/daemon.py:1428 — daemon.start_daemon has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EmbeddingGemma2EmbeddingFunction._load_audio (cyclomatic 20) · ×1
  • EmbeddingGemma2EmbeddingFunction._load_audio (cyclomatic 20) mempalace/embeddinggemma2.py:657 — EmbeddingGemma2EmbeddingFunction._load_audio has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · hooks_cli._apply_diary_checkpoint (cyclomatic 20) · ×1
  • hooks_cli._apply_diary_checkpoint (cyclomatic 20) mempalace/hooks_cli.py:1050 — hooks_cli._apply_diary_checkpoint has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · Layer1.generate (cyclomatic 20) · ×1
  • Layer1.generate (cyclomatic 20) mempalace/layers.py:355 — Layer1.generate has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · llm_refine.refine_entities (cyclomatic 20) · ×1
  • llm_refine.refine_entities (cyclomatic 20) mempalace/llm_refine.py:283 — llm_refine.refine_entities has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tools_read.tool_list_rooms (cyclomatic 20) · ×1
  • tools_read.tool_list_rooms (cyclomatic 20) mempalace/mcp_server/tools_read.py:500 — tools_read.tool_list_rooms has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · miner.chunk_text (cyclomatic 20) · ×1
  • miner.chunk_text (cyclomatic 20) mempalace/miner.py:610 — miner.chunk_text has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · normalize._try_continue_json (cyclomatic 20) · ×1
  • normalize._try_continue_json (cyclomatic 20) mempalace/normalize.py:917 — normalize._try_continue_json has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · collection.get_collection (cyclomatic 20) · ×1
  • collection.get_collection (cyclomatic 20) mempalace/palace/collection.py:290 — collection.get_collection has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mined.file_already_mined (cyclomatic 20) · ×1
  • mined.file_already_mined (cyclomatic 20) mempalace/palace/mined.py:153 — mined.file_already_mined has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · palace_graph.follow_tunnels (cyclomatic 20) · ×1
  • palace_graph.follow_tunnels (cyclomatic 20) mempalace/palace_graph.py:925 — palace_graph.follow_tunnels has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MediaAdapter.ingest (cyclomatic 20) · ×1
  • MediaAdapter.ingest (cyclomatic 20) mempalace/sources/media.py:125 — MediaAdapter.ingest has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · chroma.quarantine_stale_hnsw (cyclomatic 19) · ×1
  • chroma.quarantine_stale_hnsw (cyclomatic 19) REDACTED:631 — chroma.quarantine_stale_hnsw has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · chroma._hnsw_capacity_status_uncached (cyclomatic 19) · ×1
  • chroma._hnsw_capacity_status_uncached (cyclomatic 19) REDACTED:1228 — chroma._hnsw_capacity_status_uncached has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PgVectorCollection.query (cyclomatic 19) · ×1
  • PgVectorCollection.query (cyclomatic 19) mempalace/backends/pgvector.py:1075 — PgVectorCollection.query has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sqlite_exact._equality_where_sql (cyclomatic 19) · ×1
  • sqlite_exact._equality_where_sql (cyclomatic 19) mempalace/backends/sqlite_exact.py:170 — sqlite_exact._equality_where_sql has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · closet_llm._regenerate_closets_owned (cyclomatic 19) · ×1
  • closet_llm._regenerate_closets_owned (cyclomatic 19) mempalace/closet_llm.py:268 — closet_llm._regenerate_closets_owned has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · entity_detector.score_entity (cyclomatic 19) · ×1
  • entity_detector.score_entity (cyclomatic 19) mempalace/entity_detector.py:421 — entity_detector.score_entity has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · entity_detector.classify_entity (cyclomatic 19) · ×1
  • entity_detector.classify_entity (cyclomatic 19) mempalace/entity_detector.py:507 — entity_detector.classify_entity has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · exporter.export_palace (cyclomatic 19) · ×1
  • exporter.export_palace (cyclomatic 19) mempalace/exporter.py:72 — exporter.export_palace has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · hooks_cli._count_human_messages (cyclomatic 19) · ×1
  • hooks_cli._count_human_messages (cyclomatic 19) mempalace/hooks_cli.py:193 — hooks_cli._count_human_messages has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · hooks_cli._extract_recent_messages (cyclomatic 19) · ×1
  • hooks_cli._extract_recent_messages (cyclomatic 19) mempalace/hooks_cli.py:911 — hooks_cli._extract_recent_messages has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · hermes._l1_story_from_collection (cyclomatic 19) · ×1
  • hermes._l1_story_from_collection (cyclomatic 19) mempalace/integrations/hermes/__init__.py:106 — hermes._l1_story_from_collection has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mcp_proxy._run_proxy_loop (cyclomatic 19) · ×1
  • mcp_proxy._run_proxy_loop (cyclomatic 19) mempalace/mcp_proxy.py:337 — mcp_proxy._run_proxy_loop has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · rooms.load_pending_apply (cyclomatic 19) · ×1
  • rooms.load_pending_apply (cyclomatic 19) mempalace/rooms.py:789 — rooms.load_pending_apply has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MilvusCollection._collect_by_filter (cyclomatic 18) · ×1
  • MilvusCollection._collect_by_filter (cyclomatic 18) mempalace/backends/milvus.py:601 — MilvusCollection._collect_by_filter has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _PgVectorClient.scroll_rows (cyclomatic 18) · ×1
  • _PgVectorClient.scroll_rows (cyclomatic 18) mempalace/backends/pgvector.py:671 — _PgVectorClient.scroll_rows has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · QdrantCollection.query (cyclomatic 18) · ×1
  • QdrantCollection.query (cyclomatic 18) REDACTED:733 — QdrantCollection.query has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SQLiteExactCollection.get (cyclomatic 18) · ×1
  • SQLiteExactCollection.get (cyclomatic 18) mempalace/backends/sqlite_exact.py:1215 — SQLiteExactCollection.get has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _hub._print_hub_search_result (cyclomatic 18) · ×1
  • _hub._print_hub_search_result (cyclomatic 18) mempalace/cli/_hub.py:53 — _hub._print_hub_search_result has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _hub._forward_mine_to_hub (cyclomatic 18) · ×1
  • _hub._forward_mine_to_hub (cyclomatic 18) mempalace/cli/_hub.py:213 — _hub._forward_mine_to_hub has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · knowledge_graph.import_graph_rows (cyclomatic 18) · ×1
  • knowledge_graph.import_graph_rows (cyclomatic 18) mempalace/knowledge_graph.py:94 — knowledge_graph.import_graph_rows has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Logstream.list_events (cyclomatic 18) · ×1
  • Logstream.list_events (cyclomatic 18) mempalace/logstream.py:961 — Logstream.list_events has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · normalize._try_gemini_jsonl (cyclomatic 18) · ×1
  • normalize._try_gemini_jsonl (cyclomatic 18) mempalace/normalize.py:448 — normalize._try_gemini_jsonl has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · collection.set_palace_embedder_identity (cyclomatic 18) · ×1
  • collection.set_palace_embedder_identity (cyclomatic 18) mempalace/palace/collection.py:423 — collection.set_palace_embedder_identity has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · RoomSet.from_dict (cyclomatic 18) · ×1
  • RoomSet.from_dict (cyclomatic 18) mempalace/rooms.py:103 — RoomSet.from_dict has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · render_jsonl.main (cyclomatic 18) · ×1
  • render_jsonl.main (cyclomatic 18) tools/render_jsonl.py:34 — render_jsonl.main has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · chroma_sqlite._decoded_rows (cyclomatic 17) · ×1
  • chroma_sqlite._decoded_rows (cyclomatic 17) mempalace/backends/chroma_sqlite.py:166 — chroma_sqlite._decoded_rows has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SQLiteExactBackend._normalize_args (cyclomatic 17) · ×1
  • SQLiteExactBackend._normalize_args (cyclomatic 17) mempalace/backends/sqlite_exact.py:1997 — SQLiteExactBackend._normalize_args has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parser.main (cyclomatic 17) · ×1
  • parser.main (cyclomatic 17) mempalace/cli/parser.py:22 — parser.main has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · config.wing_aliases (cyclomatic 17) · ×1
  • config.wing_aliases (cyclomatic 17) mempalace/config.py:81 — config.wing_aliases has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · convo_miner.scan_convos (cyclomatic 17) · ×1
  • convo_miner.scan_convos (cyclomatic 17) mempalace/convo_miner.py:510 — convo_miner.scan_convos has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · fact_checker._kg_issues (cyclomatic 17) · ×1
  • fact_checker._kg_issues (cyclomatic 17) mempalace/fact_checker.py:219 — fact_checker._kg_issues has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MempalaceProvider.handle_tool_call (cyclomatic 17) · ×1
  • MempalaceProvider.handle_tool_call (cyclomatic 17) mempalace/integrations/hermes/__init__.py:967 — MempalaceProvider.handle_tool_call has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · logsync.sync_with_peer (cyclomatic 17) · ×1
  • logsync.sync_with_peer (cyclomatic 17) mempalace/logsync.py:51 — logsync.sync_with_peer has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mcp_light_server._postprocess_light_response (cyclomatic 17) · ×1
  • mcp_light_server._postprocess_light_response (cyclomatic 17) mempalace/mcp_light_server.py:932 — mcp_light_server._postprocess_light_response has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · miner.process_file (cyclomatic 17) · ×1
  • miner.process_file (cyclomatic 17) mempalace/miner.py:1571 — miner.process_file has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · normalize._try_codex_jsonl (cyclomatic 17) · ×1
  • normalize._try_codex_jsonl (cyclomatic 17) mempalace/normalize.py:390 — normalize._try_codex_jsonl has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · normalize._try_pi_jsonl (cyclomatic 17) · ×1
  • normalize._try_pi_jsonl (cyclomatic 17) mempalace/normalize.py:519 — normalize._try_pi_jsonl has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · backend._open_collection_or_explain (cyclomatic 17) · ×1
  • backend._open_collection_or_explain (cyclomatic 17) mempalace/palace/backend.py:107 — backend._open_collection_or_explain has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repair.maybe_autoheal_fts5_index (cyclomatic 17) · ×1
  • repair.maybe_autoheal_fts5_index (cyclomatic 17) mempalace/repair.py:1353 — repair.maybe_autoheal_fts5_index has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · sync._sources_holding_nothing (cyclomatic 17) · ×1
  • sync._sources_holding_nothing (cyclomatic 17) mempalace/sync.py:571 — sync._sources_holding_nothing has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · wing_split.resolve_target (cyclomatic 17) · ×1
  • wing_split.resolve_target (cyclomatic 17) mempalace/wing_split.py:99 — wing_split.resolve_target has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · apply (cyclomatic 17) · ×1
  • apply (cyclomatic 17) .dsh-plugin/lib/recall.js:107 — apply has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 10 function items inside it that branch (a function literal at line 131, a function literal at line 160, a function literal at line 186, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · BaseCollection.get_recent (cyclomatic 16) · ×1
  • BaseCollection.get_recent (cyclomatic 16) mempalace/backends/base.py:673 — BaseCollection.get_recent has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChromaBackend._client_locked (cyclomatic 16) · ×1
  • ChromaBackend._client_locked (cyclomatic 16) REDACTED:2650 — ChromaBackend._client_locked has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · milvus._translate_field (cyclomatic 16) · ×1
  • milvus._translate_field (cyclomatic 16) mempalace/backends/milvus.py:108 — milvus._translate_field has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cmd_query.cmd_hallways (cyclomatic 16) · ×1
  • cmd_query.cmd_hallways (cyclomatic 16) mempalace/cli/cmd_query.py:107 — cmd_query.cmd_hallways has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Dialect.compress (cyclomatic 16) · ×1
  • Dialect.compress (cyclomatic 16) mempalace/dialect.py:563 — Dialect.compress has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · embedding._resolve_providers (cyclomatic 16) · ×1
  • embedding._resolve_providers (cyclomatic 16) mempalace/embedding.py:178 — embedding._resolve_providers has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Layer2.retrieve (cyclomatic 16) · ×1
  • Layer2.retrieve (cyclomatic 16) mempalace/layers.py:467 — Layer2.retrieve has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · llm_client._json_candidates (cyclomatic 16) · ×1
  • llm_client._json_candidates (cyclomatic 16) REDACTED:351 — llm_client._json_candidates has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mcp_light_server._rewrite_tools_call_for_hub (cyclomatic 16) · ×1
  • mcp_light_server._rewrite_tools_call_for_hub (cyclomatic 16) mempalace/mcp_light_server.py:879 — mcp_light_server._rewrite_tools_call_for_hub has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _session._get_client (cyclomatic 16) · ×1
  • _session._get_client (cyclomatic 16) mempalace/mcp_server/_session.py:92 — _session._get_client has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · tools_diary.tool_diary_read (cyclomatic 16) · ×1
  • tools_diary.tool_diary_read (cyclomatic 16) mempalace/mcp_server/tools_diary.py:205 — tools_diary.tool_diary_read has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · migrate._migrate_locked (cyclomatic 16) · ×1
  • migrate._migrate_locked (cyclomatic 16) mempalace/migrate.py:252 — migrate._migrate_locked has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · miner._refresh_known_entities_cache (cyclomatic 16) · ×1
  • miner._refresh_known_entities_cache (cyclomatic 16) mempalace/miner.py:757 — miner._refresh_known_entities_cache has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · closets.drawers_removed (cyclomatic 16) · ×1
  • closets.drawers_removed (cyclomatic 16) mempalace/palace/closets.py:274 — closets.drawers_removed has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · mined.prefetch_complete_mtimes (cyclomatic 16) · ×1
  • mined.prefetch_complete_mtimes (cyclomatic 16) mempalace/palace/mined.py:380 — mined.prefetch_complete_mtimes has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · project_scanner.discover_entities (cyclomatic 16) · ×1
  • project_scanner.discover_entities (cyclomatic 16) REDACTED:696 — project_scanner.discover_entities has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repair._paginate_ids (cyclomatic 16) · ×1
  • repair._paginate_ids (cyclomatic 16) mempalace/repair.py:212 — repair._paginate_ids has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repair.scan_palace (cyclomatic 16) · ×1
  • repair.scan_palace (cyclomatic 16) mempalace/repair.py:628 — repair.scan_palace has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repair._rebuild_one_collection (cyclomatic 16) · ×1
  • repair._rebuild_one_collection (cyclomatic 16) mempalace/repair.py:2023 — repair._rebuild_one_collection has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · repair.status (cyclomatic 16) · ×1
  • repair.status (cyclomatic 16) mempalace/repair.py:2746 — repair.status has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · room_detector_local.save_config (cyclomatic 16) · ×1
  • room_detector_local.save_config (cyclomatic 16) mempalace/room_detector_local.py:321 — room_detector_local.save_config has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mempalace_repair_encoding.main (cyclomatic 16) · ×1
  • mempalace_repair_encoding.main (cyclomatic 16) scripts/mempalace_repair_encoding.py:157 — mempalace_repair_encoding.main has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D17 · Explicit Debt · TodoComment · ×1
  • TodoComment mempalace/mcp_server/tools_diary.py:58 — # TODO: Future versions should expand AAAK before embedding to improve — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D2 · Cognitive Complexity · query_parser.parse_coordinate_input (cognitive 372) · ×1
  • query_parser.parse_coordinate_input (cognitive 372) mempalace/query_parser.py:1287 — query_parser.parse_coordinate_input has cognitive complexity 372 (threshold 15). Drivers by points: if/else 105 (275 pts), boolean chains 69, loops 8 (20 pts), ternaries 2 (6 pts), error handling 1 (2 pts) (nesting depth added 187). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · query_parser.parse_exec_input (cognitive 323) · ×1
  • query_parser.parse_exec_input (cognitive 323) mempalace/query_parser.py:786 — query_parser.parse_exec_input has cognitive complexity 323 (threshold 15). Drivers by points: if/else 104 (253 pts), boolean chains 49, loops 4 (12 pts), error handling 2 (5 pts), ternaries 1 (4 pts) (nesting depth added 163). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · query_parser.parse_query_input (cognitive 201) · ×1
  • query_parser.parse_query_input (cognitive 201) mempalace/query_parser.py:399 — query_parser.parse_query_input has cognitive complexity 201 (threshold 15). Drivers by points: if/else 68 (123 pts), boolean chains 40, loops 8 (18 pts), ternaries 7 (18 pts), error handling 1 (2 pts) (nesting depth added 77). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _session._get_collection (cognitive 67) · ×1
  • _session._get_collection (cognitive 67) mempalace/mcp_server/_session.py:195 — _session._get_collection has cognitive complexity 67 (threshold 15). Drivers by points: error handling 10 (24 pts), if/else 11 (23 pts), ternaries 3 (9 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · miner.scan_project (cognitive 66) · ×1
  • miner.scan_project (cognitive 66) mempalace/miner.py:1760 — miner.scan_project has cognitive complexity 66 (threshold 15). Drivers by points: if/else 16 (45 pts), boolean chains 11, error handling 2 (7 pts), loops 2 (3 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · media_search.search_with_media (cognitive 64) · ×1
  • media_search.search_with_media (cognitive 64) mempalace/searcher/media_search.py:17 — media_search.search_with_media has cognitive complexity 64 (threshold 15). Drivers by points: if/else 17 (35 pts), boolean chains 12, loops 4 (8 pts), ternaries 4 (6 pts), error handling 2 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · diary_ingest.ingest_diaries (cognitive 63) · ×1
  • diary_ingest.ingest_diaries (cognitive 63) mempalace/diary_ingest.py:94 — diary_ingest.ingest_diaries has cognitive complexity 63 (threshold 15). Drivers by points: if/else 15 (33 pts), ternaries 4 (13 pts), loops 4 (9 pts), boolean chains 4, error handling 2 (4 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Dialect.generate_layer1 (cognitive 62) · ×1
  • Dialect.generate_layer1 (cognitive 62) mempalace/dialect.py:808 — Dialect.generate_layer1 has cognitive complexity 62 (threshold 15). Drivers by points: if/else 15 (35 pts), loops 10 (17 pts), ternaries 2 (6 pts), boolean chains 4 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cmd_coord._logstream_watch (cognitive 53) · ×1
  • cmd_coord._logstream_watch (cognitive 53) mempalace/cli/cmd_coord.py:189 — cmd_coord._logstream_watch has cognitive complexity 53 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 8, error handling 4 (6 pts), loops 2 (5 pts), ternaries 3 (5 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalize._try_claude_code_jsonl (cognitive 53) · ×1
  • normalize._try_claude_code_jsonl (cognitive 53) mempalace/normalize.py:324 — normalize._try_claude_code_jsonl has cognitive complexity 53 (threshold 15). Drivers by points: if/else 16 (41 pts), boolean chains 6, loops 2 (4 pts), error handling 1 (2 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cli_search.search (cognitive 53) · ×1
  • cli_search.search (cognitive 53) mempalace/searcher/cli_search.py:179 — cli_search.search has cognitive complexity 53 (threshold 15). Drivers by points: if/else 19 (36 pts), boolean chains 6, loops 4 (6 pts), error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · room_detector_local.detect_rooms_from_folders (cognitive 52) · ×1
  • room_detector_local.detect_rooms_from_folders (cognitive 52) mempalace/room_detector_local.py:104 — room_detector_local.detect_rooms_from_folders has cognitive complexity 52 (threshold 15). Drivers by points: if/else 9 (31 pts), error handling 4 (11 pts), loops 4 (6 pts), boolean chains 4 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · cmd_coord.cmd_logstream (cognitive 51) · ×1
  • cmd_coord.cmd_logstream (cognitive 51) mempalace/cli/cmd_coord.py:368 — cmd_coord.cmd_logstream has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (31 pts), error handling 5 (9 pts), loops 2 (6 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · convo_miner._mine_convos_impl (cognitive 51) · ×1
  • convo_miner._mine_convos_impl (cognitive 51) mempalace/convo_miner.py:952 — convo_miner._mine_convos_impl has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (34 pts), loops 3 (7 pts), error handling 2 (4 pts), ternaries 4, boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cmd_init.cmd_init (cognitive 49) · ×1
  • cmd_init.cmd_init (cognitive 49) mempalace/cli/cmd_init.py:6 — cmd_init.cmd_init has cognitive complexity 49 (threshold 15). Drivers by points: if/else 22 (39 pts), boolean chains 7, error handling 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · hallways.compute_hallways_for_wing (cognitive 49) · ×1
  • hallways.compute_hallways_for_wing (cognitive 49) mempalace/hallways.py:642 — hallways.compute_hallways_for_wing has cognitive complexity 49 (threshold 15). Drivers by points: if/else 17 (32 pts), loops 5 (7 pts), ternaries 3 (6 pts), boolean chains 3, error handling 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · project_scanner.scan (cognitive 48) · ×1
  • project_scanner.scan (cognitive 48) REDACTED:528 — project_scanner.scan has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 9, loops 4 (7 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · format_miner._mine_formats_impl (cognitive 47) · ×1
  • format_miner._mine_formats_impl (cognitive 47) mempalace/format_miner.py:767 — format_miner._mine_formats_impl has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (28 pts), error handling 7 (11 pts), boolean chains 4, ternaries 3, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · hooks_cli.hook_stop (cognitive 47) · ×1
  • hooks_cli.hook_stop (cognitive 47) mempalace/hooks_cli.py:1482 — hooks_cli.hook_stop has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (30 pts), error handling 5 (13 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sync.sync_palace (cognitive 46) · ×1
  • sync.sync_palace (cognitive 46) mempalace/sync.py:703 — sync.sync_palace has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (32 pts), boolean chains 9, loops 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · palace_graph.entity_tunnel_candidates (cognitive 45) · ×1
  • palace_graph.entity_tunnel_candidates (cognitive 45) mempalace/palace_graph.py:1188 — palace_graph.entity_tunnel_candidates has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 8 (14 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlite_bm25._bm25_only_via_sqlite (cognitive 45) · ×1
  • sqlite_bm25._bm25_only_via_sqlite (cognitive 45) mempalace/searcher/sqlite_bm25.py:114 — sqlite_bm25._bm25_only_via_sqlite has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 10, ternaries 6 (8 pts), error handling 3 (5 pts), loops 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EmbeddingCollection.update (cognitive 44) · ×1
  • EmbeddingCollection.update (cognitive 44) mempalace/backends/embedding_wrapper.py:347 — EmbeddingCollection.update has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 11, loops 2 (6 pts), ternaries 1 (4 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · cmd_serve.cmd_compress (cognitive 44) · ×1
  • cmd_serve.cmd_compress (cognitive 44) mempalace/cli/cmd_serve.py:198 — cmd_serve.cmd_compress has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (26 pts), loops 5 (8 pts), error handling 2 (4 pts), ternaries 3 (4 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · entity_detector.confirm_entities (cognitive 44) · ×1
  • entity_detector.confirm_entities (cognitive 44) mempalace/entity_detector.py:767 — entity_detector.confirm_entities has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (34 pts), boolean chains 5, loops 2 (5 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · miner.add_to_known_entities (cognitive 44) · ×1
  • miner.add_to_known_entities (cognitive 44) mempalace/miner.py:925 — miner.add_to_known_entities has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (30 pts), loops 4 (10 pts), boolean chains 4 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · miner._mine_impl (cognitive 44) · ×1
  • miner._mine_impl (cognitive 44) mempalace/miner.py:1945 — miner._mine_impl has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (26 pts), error handling 7 (11 pts), boolean chains 4, ternaries 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · query_parser.tokenize_dsl (cognitive 44) · ×1
  • query_parser.tokenize_dsl (cognitive 44) mempalace/query_parser.py:131 — query_parser.tokenize_dsl has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 4 (8 pts), boolean chains 7 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EmbeddingGemma2EmbeddingFunction._load_audio (cognitive 43) · ×1
  • EmbeddingGemma2EmbeddingFunction._load_audio (cognitive 43) mempalace/embeddinggemma2.py:657 — EmbeddingGemma2EmbeddingFunction._load_audio has cognitive complexity 43 (threshold 15). Drivers by points: if/else 8 (17 pts), error handling 5 (13 pts), ternaries 2 (8 pts), boolean chains 5 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tools_read.tool_search (cognitive 43) · ×1
  • tools_read.tool_search (cognitive 43) mempalace/mcp_server/tools_read.py:608 — tools_read.tool_search has cognitive complexity 43 (threshold 15). Drivers by points: if/else 20 (31 pts), error handling 3 (6 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlite_bm25._merge_bm25_union_candidates (cognitive 43) · ×1
  • sqlite_bm25._merge_bm25_union_candidates (cognitive 43) mempalace/searcher/sqlite_bm25.py:316 — sqlite_bm25._merge_bm25_union_candidates has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 11, ternaries 5 (8 pts), error handling 2, loops 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tunnels_tool.propose_tunnels (cognitive 43) · ×1
  • tunnels_tool.propose_tunnels (cognitive 43) mempalace/tunnels_tool.py:216 — tunnels_tool.propose_tunnels has cognitive complexity 43 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 7 (12 pts), boolean chains 10, ternaries 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cmd_coord.cmd_task (cognitive 42) · ×1
  • cmd_coord.cmd_task (cognitive 42) mempalace/cli/cmd_coord.py:548 — cmd_coord.cmd_task has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (29 pts), error handling 4 (8 pts), boolean chains 5 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tools_write.tool_update_drawer (cognitive 42) · ×1
  • tools_write.tool_update_drawer (cognitive 42) mempalace/mcp_server/tools_write.py:1421 — tools_write.tool_update_drawer has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (22 pts), error handling 5 (9 pts), boolean chains 6, ternaries 3 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · palace_graph.build_graph (cognitive 42) · ×1
  • palace_graph.build_graph (cognitive 42) mempalace/palace_graph.py:240 — palace_graph.build_graph has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 6 (15 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cmd_rooms.cmd_rooms (cognitive 41) · ×1
  • cmd_rooms.cmd_rooms (cognitive 41) mempalace/cli/cmd_rooms.py:72 — cmd_rooms.cmd_rooms has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (21 pts), loops 3 (9 pts), error handling 4 (5 pts), boolean chains 3, ternaries 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · convo_miner.scan_convos (cognitive 41) · ×1
  • convo_miner.scan_convos (cognitive 41) mempalace/convo_miner.py:510 — convo_miner.scan_convos has cognitive complexity 41 (threshold 15). Drivers by points: if/else 7 (24 pts), error handling 2 (9 pts), boolean chains 3, loops 2 (3 pts), ternaries 2 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · logsync.sync_with_peer (cognitive 41) · ×1
  • logsync.sync_with_peer (cognitive 41) mempalace/logsync.py:51 — logsync.sync_with_peer has cognitive complexity 41 (threshold 15). Drivers by points: if/else 7 (26 pts), loops 4 (10 pts), boolean chains 5 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repair._paginate_ids (cognitive 41) · ×1
  • repair._paginate_ids (cognitive 41) mempalace/repair.py:212 — repair._paginate_ids has cognitive complexity 41 (threshold 15). Drivers by points: if/else 6 (19 pts), error handling 3 (10 pts), ternaries 2 (8 pts), boolean chains 3, loops 1 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · service.run_mine (cognitive 41) · ×1
  • service.run_mine (cognitive 41) mempalace/service.py:122 — service.run_mine has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 10, error handling 6 (8 pts), ternaries 2 (3 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chroma.quarantine_invalid_hnsw_metadata (cognitive 40) · ×1
  • chroma.quarantine_invalid_hnsw_metadata (cognitive 40) REDACTED:1491 — chroma.quarantine_invalid_hnsw_metadata has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (22 pts), error handling 5 (9 pts), boolean chains 8, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cmd_sync.cmd_sync (cognitive 40) · ×1
  • cmd_sync.cmd_sync (cognitive 40) mempalace/cli/cmd_sync.py:6 — cmd_sync.cmd_sync has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (19 pts), loops 3 (7 pts), ternaries 4 (6 pts), boolean chains 4, error handling 4 (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cmd_sync.cmd_daemon (cognitive 40) · ×1
  • cmd_sync.cmd_daemon (cognitive 40) mempalace/cli/cmd_sync.py:200 — cmd_sync.cmd_daemon has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (32 pts), boolean chains 4, loops 1 (2 pts), error handling 1, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cmd_serve.cmd_serve (cognitive 39) · ×1
  • cmd_serve.cmd_serve (cognitive 39) mempalace/cli/cmd_serve.py:72 — cmd_serve.cmd_serve has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (16 pts), ternaries 11 (13 pts), boolean chains 9, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · encoding_repair.repair_collection (cognitive 39) · ×1
  • encoding_repair.repair_collection (cognitive 39) mempalace/encoding_repair.py:416 — encoding_repair.repair_collection has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 6, loops 3 (6 pts), ternaries 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · exporter.export_palace (cognitive 39) · ×1
  • exporter.export_palace (cognitive 39) mempalace/exporter.py:72 — exporter.export_palace has cognitive complexity 39 (threshold 15). Drivers by points: loops 7 (14 pts), if/else 5 (13 pts), error handling 2 (5 pts), ternaries 1 (4 pts), boolean chains 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · query.search_memories (cognitive 39) · ×1
  • query.search_memories (cognitive 39) mempalace/searcher/query.py:189 — query.search_memories has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 7, error handling 2, ternaries 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cmd_repair.cmd_repair (cognitive 38) · ×1
  • cmd_repair.cmd_repair (cognitive 38) mempalace/cli/cmd_repair.py:201 — cmd_repair.cmd_repair has cognitive complexity 38 (threshold 15). Drivers by points: if/else 21 (27 pts), error handling 4 (6 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · knowledge_graph.import_graph_rows (cognitive 38) · ×1
  • knowledge_graph.import_graph_rows (cognitive 38) mempalace/knowledge_graph.py:94 — knowledge_graph.import_graph_rows has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (31 pts), ternaries 1 (4 pts), loops 2 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · protocol.call_tool (cognitive 38) · ×1
  • protocol.call_tool (cognitive 38) mempalace/mcp_server/protocol.py:905 — protocol.call_tool has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 8, ternaries 2 (7 pts), error handling 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · miner._refresh_known_entities_cache (cognitive 38) · ×1
  • miner._refresh_known_entities_cache (cognitive 38) mempalace/miner.py:757 — miner._refresh_known_entities_cache has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (29 pts), loops 2 (6 pts), error handling 2, boolean chains 1 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · hooks_cli._extract_recent_messages (cognitive 37) · ×1
  • hooks_cli._extract_recent_messages (cognitive 37) mempalace/hooks_cli.py:911 — hooks_cli._extract_recent_messages has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (28 pts), boolean chains 5, error handling 2 (3 pts), loops 1 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · mcp_proxy._run_proxy_loop (cognitive 37) · ×1
  • mcp_proxy._run_proxy_loop (cognitive 37) mempalace/mcp_proxy.py:337 — mcp_proxy._run_proxy_loop has cognitive complexity 37 (threshold 15). Drivers by points: error handling 9 (19 pts), if/else 6 (13 pts), ternaries 1 (3 pts), loops 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · query_parser._parse_key_value_tokens (cognitive 37) · ×1
  • query_parser._parse_key_value_tokens (cognitive 37) mempalace/query_parser.py:217 — query_parser._parse_key_value_tokens has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (28 pts), boolean chains 7, loops 1, ternaries 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalize._try_continue_json (cognitive 36) · ×1
  • normalize._try_continue_json (cognitive 36) mempalace/normalize.py:917 — normalize._try_continue_json has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (30 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · service.run_sync (cognitive 36) · ×1
  • service.run_sync (cognitive 36) mempalace/service.py:397 — service.run_sync has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 3 (7 pts), boolean chains 5, error handling 4, ternaries 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · hooks_cli._count_human_messages (cognitive 35) · ×1
  • hooks_cli._count_human_messages (cognitive 35) mempalace/hooks_cli.py:193 — hooks_cli._count_human_messages has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (28 pts), boolean chains 3, error handling 2 (3 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Layer1.generate (cognitive 35) · ×1
  • Layer1.generate (cognitive 35) mempalace/layers.py:355 — Layer1.generate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 5 (13 pts), error handling 5 (8 pts), loops 5 (7 pts), ternaries 2 (5 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tools_write._fetch_drawer_rows (cognitive 35) · ×1
  • tools_write._fetch_drawer_rows (cognitive 35) mempalace/mcp_server/tools_write.py:287 — tools_write._fetch_drawer_rows has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 4 (12 pts), boolean chains 11, if/else 4 (7 pts), loops 3 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChromaBackend.get_collection (cognitive 34) · ×1
  • ChromaBackend.get_collection (cognitive 34) REDACTED:2873 — ChromaBackend.get_collection has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (19 pts), error handling 5 (10 pts), boolean chains 5 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · miner.chunk_text (cognitive 34) · ×1
  • miner.chunk_text (cognitive 34) mempalace/miner.py:610 — miner.chunk_text has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · collection.get_collection (cognitive 34) · ×1
  • collection.get_collection (cognitive 34) mempalace/palace/collection.py:290 — collection.get_collection has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (24 pts), error handling 3 (7 pts), boolean chains 2, ternaries 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mined.file_already_mined (cognitive 34) · ×1
  • mined.file_already_mined (cognitive 34) mempalace/palace/mined.py:153 — mined.file_already_mined has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 7, error handling 2 (4 pts), loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cmd_mine.cmd_mine (cognitive 33) · ×1
  • cmd_mine.cmd_mine (cognitive 33) mempalace/cli/cmd_mine.py:8 — cmd_mine.cmd_mine has cognitive complexity 33 (threshold 15). Drivers by points: error handling 10 (15 pts), if/else 8 (9 pts), ternaries 3 (5 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fact_checker._kg_issues (cognitive 33) · ×1
  • fact_checker._kg_issues (cognitive 33) mempalace/fact_checker.py:219 — fact_checker._kg_issues has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 3 (5 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · hermes._l1_story_from_collection (cognitive 33) · ×1
  • hermes._l1_story_from_collection (cognitive 33) mempalace/integrations/hermes/__init__.py:106 — hermes._l1_story_from_collection has cognitive complexity 33 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 5 (7 pts), boolean chains 5, error handling 2 (5 pts), ternaries 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · collection._enforce_embedder_identity (cognitive 33) · ×1
  • collection._enforce_embedder_identity (cognitive 33) mempalace/palace/collection.py:101 — collection._enforce_embedder_identity has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 6 (13 pts), boolean chains 4 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SQLiteExactCollection._rows (cognitive 32) · ×1
  • SQLiteExactCollection._rows (cognitive 32) mempalace/backends/sqlite_exact.py:850 — SQLiteExactCollection._rows has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 11, loops 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SQLiteExactBackend._connect (cognitive 32) · ×1
  • SQLiteExactBackend._connect (cognitive 32) mempalace/backends/sqlite_exact.py:1705 — SQLiteExactBackend._connect has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 7, error handling 3 (6 pts), ternaries 2 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · cmd_mine.mine_source_adapter (cognitive 32) · ×1
  • cmd_mine.mine_source_adapter (cognitive 32) mempalace/cli/cmd_mine.py:291 — cmd_mine.mine_source_adapter has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (21 pts), error handling 3 (7 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cmd_tunnels.cmd_tunnels (cognitive 32) · ×1
  • cmd_tunnels.cmd_tunnels (cognitive 32) mempalace/cli/cmd_tunnels.py:15 — cmd_tunnels.cmd_tunnels has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 4, error handling 2, loops 1 (2 pts), ternaries 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mcp_light_server._enrich_search_results (cognitive 32) · ×1
  • mcp_light_server._enrich_search_results (cognitive 32) mempalace/mcp_light_server.py:171 — mcp_light_server._enrich_search_results has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 6, loops 2 (4 pts), error handling 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mcp_light_server.handle_light_request (cognitive 32) · ×1
  • mcp_light_server.handle_light_request (cognitive 32) mempalace/mcp_light_server.py:733 — mcp_light_server.handle_light_request has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 6, ternaries 2 (4 pts), error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SQLiteExactCollection._query_once (cognitive 31) · ×1
  • SQLiteExactCollection._query_once (cognitive 31) mempalace/backends/sqlite_exact.py:1008 — SQLiteExactCollection._query_once has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (20 pts), ternaries 4 (7 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tools_diary._tool_reconnect_locked (cognitive 31) · ×1
  • tools_diary._tool_reconnect_locked (cognitive 31) mempalace/mcp_server/tools_diary.py:409 — tools_diary._tool_reconnect_locked has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (17 pts), error handling 6 (10 pts), boolean chains 2, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tools_diary.tool_checkpoint (cognitive 31) · ×1
  • tools_diary.tool_checkpoint (cognitive 31) mempalace/mcp_server/tools_diary.py:550 — tools_diary.tool_checkpoint has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 6, ternaries 2 (3 pts), error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · query_sanitizer.sanitize_query (cognitive 31) · ×1
  • query_sanitizer.sanitize_query (cognitive 31) mempalace/query_sanitizer.py:77 — query_sanitizer.sanitize_query has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 4 (5 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SQLiteExactCollection.update (cognitive 30) · ×1
  • SQLiteExactCollection.update (cognitive 30) mempalace/backends/sqlite_exact.py:765 — SQLiteExactCollection.update has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 5, loops 4 (5 pts), ternaries 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · llm_refine.refine_entities (cognitive 30) · ×1
  • llm_refine.refine_entities (cognitive 30) mempalace/llm_refine.py:283 — llm_refine.refine_entities has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 5 (6 pts), error handling 2 (4 pts), boolean chains 3, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalize._try_gemini_jsonl (cognitive 30) · ×1
  • normalize._try_gemini_jsonl (cognitive 30) mempalace/normalize.py:448 — normalize._try_gemini_jsonl has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mined.prefetch_mined_set (cognitive 30) · ×1
  • mined.prefetch_mined_set (cognitive 30) mempalace/palace/mined.py:260 — mined.prefetch_mined_set has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (10 pts), boolean chains 4, error handling 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · palace_graph.compute_topic_tunnels (cognitive 30) · ×1
  • palace_graph.compute_topic_tunnels (cognitive 30) mempalace/palace_graph.py:1032 — palace_graph.compute_topic_tunnels has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 5 (9 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repair.scan_palace (cognitive 30) · ×1
  • repair.scan_palace (cognitive 30) mempalace/repair.py:628 — repair.scan_palace has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (8 pts), error handling 2 (6 pts), boolean chains 2, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chroma_sqlite.sqlite_list_id_metadata (cognitive 29) · ×1
  • chroma_sqlite.sqlite_list_id_metadata (cognitive 29) mempalace/backends/chroma_sqlite.py:1007 — chroma_sqlite.sqlite_list_id_metadata has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 5 (9 pts), loops 3, boolean chains 2, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cmd_query.cmd_hallways (cognitive 29) · ×1
  • cmd_query.cmd_hallways (cognitive 29) mempalace/cli/cmd_query.py:107 — cmd_query.cmd_hallways has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 4 (7 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · project_scanner.discover_entities (cognitive 29) · ×1
  • project_scanner.discover_entities (cognitive 29) REDACTED:696 — project_scanner.discover_entities has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MilvusCollection.query (cognitive 28) · ×1
  • MilvusCollection.query (cognitive 28) mempalace/backends/milvus.py:523 — MilvusCollection.query has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 5 (9 pts), boolean chains 4, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pgvector._requires_local_filter (cognitive 28) · ×1
  • pgvector._requires_local_filter (cognitive 28) mempalace/backends/pgvector.py:133 — pgvector._requires_local_filter has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sqlite_exact._equality_where_sql (cognitive 28) · ×1
  • sqlite_exact._equality_where_sql (cognitive 28) mempalace/backends/sqlite_exact.py:170 — sqlite_exact._equality_where_sql has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4, loops 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.wing_aliases (cognitive 28) · ×1
  • config.wing_aliases (cognitive 28) mempalace/config.py:81 — config.wing_aliases has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (5 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · daemon.start_daemon (cognitive 28) · ×1
  • daemon.start_daemon (cognitive 28) mempalace/daemon.py:1428 — daemon.start_daemon has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (14 pts), error handling 5 (10 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · palace_graph.follow_tunnels (cognitive 28) · ×1
  • palace_graph.follow_tunnels (cognitive 28) mempalace/palace_graph.py:925 — palace_graph.follow_tunnels has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 8, loops 2 (4 pts), error handling 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · backfill_authored_at.backfill_authored_at (cognitive 28) · ×1
  • backfill_authored_at.backfill_authored_at (cognitive 28) scripts/backfill_authored_at.py:56 — backfill_authored_at.backfill_authored_at has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (18 pts), ternaries 1 (4 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chroma._hnsw_capacity_status_uncached (cognitive 27) · ×1
  • chroma._hnsw_capacity_status_uncached (cognitive 27) REDACTED:1228 — chroma._hnsw_capacity_status_uncached has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 6, error handling 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pgvector._field_sql (cognitive 27) · ×1
  • pgvector._field_sql (cognitive 27) mempalace/backends/pgvector.py:329 — pgvector._field_sql has cognitive complexity 27 (threshold 15). Drivers by points: loops 3 (10 pts), ternaries 3 (10 pts), if/else 3 (5 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · closet_llm._regenerate_closets_owned (cognitive 27) · ×1
  • closet_llm._regenerate_closets_owned (cognitive 27) mempalace/closet_llm.py:268 — closet_llm._regenerate_closets_owned has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 3 (4 pts), boolean chains 3, ternaries 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Dialect.extract_key_quote (cognitive 27) · ×1
  • Dialect.extract_key_quote (cognitive 27) mempalace/dialect.py:630 — Dialect.extract_key_quote has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · entity_detector.score_entity (cognitive 27) · ×1
  • entity_detector.score_entity (cognitive 27) mempalace/entity_detector.py:421 — entity_detector.score_entity has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 5 (6 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tools_read.tool_list_rooms (cognitive 27) · ×1
  • tools_read.tool_list_rooms (cognitive 27) mempalace/mcp_server/tools_read.py:500 — tools_read.tool_list_rooms has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 2 (5 pts), error handling 4, ternaries 3 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · palace_graph._nodes_edges_from_grouped_rows (cognitive 27) · ×1
  • palace_graph._nodes_edges_from_grouped_rows (cognitive 27) mempalace/palace_graph.py:132 — palace_graph._nodes_edges_from_grouped_rows has cognitive complexity 27 (threshold 15). Drivers by points: loops 5 (14 pts), if/else 4 (8 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · tunnels_tool.prune_tunnels (cognitive 27) · ×1
  • tunnels_tool.prune_tunnels (cognitive 27) mempalace/tunnels_tool.py:377 — tunnels_tool.prune_tunnels has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _filters.matches_where (cognitive 26) · ×1
  • _filters.matches_where (cognitive 26) mempalace/backends/_filters.py:81 — _filters.matches_where has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chroma.quarantine_stale_hnsw (cognitive 26) · ×1
  • chroma.quarantine_stale_hnsw (cognitive 26) REDACTED:631 — chroma.quarantine_stale_hnsw has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 4 (6 pts), boolean chains 5, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chroma_sqlite._decoded_rows (cognitive 26) · ×1
  • chroma_sqlite._decoded_rows (cognitive 26) mempalace/backends/chroma_sqlite.py:166 — chroma_sqlite._decoded_rows has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (5 pts), ternaries 3 (5 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MilvusCollection._collect_by_filter (cognitive 26) · ×1
  • MilvusCollection._collect_by_filter (cognitive 26) mempalace/backends/milvus.py:601 — MilvusCollection._collect_by_filter has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 5, loops 2 (3 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PgVectorCollection.query (cognitive 26) · ×1
  • PgVectorCollection.query (cognitive 26) mempalace/backends/pgvector.py:1075 — PgVectorCollection.query has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 5 (9 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · format_miner.extract_text (cognitive 26) · ×1
  • format_miner.extract_text (cognitive 26) mempalace/format_miner.py:293 — format_miner.extract_text has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (16 pts), error handling 7, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalize._try_gemini_json (cognitive 26) · ×1
  • normalize._try_gemini_json (cognitive 26) mempalace/normalize.py:570 — normalize._try_gemini_json has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · wing_split.resolve_target (cognitive 26) · ×1
  • wing_split.resolve_target (cognitive 26) mempalace/wing_split.py:99 — wing_split.resolve_target has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChromaCollection.query (cognitive 25) · ×1
  • ChromaCollection.query (cognitive 25) REDACTED:2081 — ChromaCollection.query has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12, boolean chains 7, ternaries 6. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · hallways.association_groups (cognitive 25) · ×1
  • hallways.association_groups (cognitive 25) mempalace/hallways.py:890 — hallways.association_groups has cognitive complexity 25 (threshold 15). Drivers by points: loops 8 (18 pts), if/else 2 (5 pts), boolean chains 2 (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · normalize._try_codex_jsonl (cognitive 25) · ×1
  • normalize._try_codex_jsonl (cognitive 25) mempalace/normalize.py:390 — normalize._try_codex_jsonl has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (21 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QdrantCollection.query (cognitive 24) · ×1
  • QdrantCollection.query (cognitive 24) REDACTED:733 — QdrantCollection.query has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 4 (7 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RustExactCollection._query_native (cognitive 24) · ×1
  • RustExactCollection._query_native (cognitive 24) mempalace/backends/rust_exact.py:136 — RustExactCollection._query_native has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 4 (9 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.main (cognitive 24) · ×1
  • parser.main (cognitive 24) mempalace/cli/parser.py:22 — parser.main has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (23 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · entity_detector.extract_candidates (cognitive 24) · ×1
  • entity_detector.extract_candidates (cognitive 24) mempalace/entity_detector.py:307 — entity_detector.extract_candidates has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 5 (7 pts), error handling 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mcp_proxy._is_plain_stdio_invocation (cognitive 24) · ×1
  • mcp_proxy._is_plain_stdio_invocation (cognitive 24) mempalace/mcp_proxy.py:51 — mcp_proxy._is_plain_stdio_invocation has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tools_read.tool_status (cognitive 24) · ×1
  • tools_read.tool_status (cognitive 24) mempalace/mcp_server/tools_read.py:324 — tools_read.tool_status has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (12 pts), error handling 4 (7 pts), loops 2 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tools_write.tool_mine (cognitive 24) · ×1
  • tools_write.tool_mine (cognitive 24) mempalace/mcp_server/tools_write.py:824 — tools_write.tool_mine has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 7, error handling 6, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MediaAsset.__post_init__ (cognitive 24) · ×1
  • MediaAsset.__post_init__ (cognitive 24) mempalace/media.py:53 — MediaAsset.__post_init__ has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 10, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · normalize._try_pi_jsonl (cognitive 24) · ×1
  • normalize._try_pi_jsonl (cognitive 24) mempalace/normalize.py:519 — normalize._try_pi_jsonl has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 4, error handling 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalize._chatgpt_messages (cognitive 24) · ×1
  • normalize._chatgpt_messages (cognitive 24) mempalace/normalize.py:804 — normalize._chatgpt_messages has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MediaAdapter.ingest (cognitive 24) · ×1
  • MediaAdapter.ingest (cognitive 24) mempalace/sources/media.py:125 — MediaAdapter.ingest has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, ternaries 2 (4 pts), error handling 2 (3 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sync._sources_holding_nothing (cognitive 24) · ×1
  • sync._sources_holding_nothing (cognitive 24) mempalace/sync.py:571 — sync._sources_holding_nothing has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · apply (cognitive 24) · ×1
  • apply (cognitive 24) .dsh-plugin/lib/autosave.js:30 — apply has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (17 pts), other 4, ternaries 1 (2 pts), loops 1 (nesting depth added 3). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 12 function items inside it that branch (a function literal at line 46, drain, runHook, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · SQLiteExactCollection.get (cognitive 23) · ×1
  • SQLiteExactCollection.get (cognitive 23) mempalace/backends/sqlite_exact.py:1215 — SQLiteExactCollection.get has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 9 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SQLiteExactBackend._normalize_args (cognitive 23) · ×1
  • SQLiteExactBackend._normalize_args (cognitive 23) mempalace/backends/sqlite_exact.py:1997 — SQLiteExactBackend._normalize_args has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cmd_coord.cmd_artifact (cognitive 23) · ×1
  • cmd_coord.cmd_artifact (cognitive 23) mempalace/cli/cmd_coord.py:664 — cmd_coord.cmd_artifact has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 3 (5 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · hooks_cli._apply_diary_checkpoint (cognitive 23) · ×1
  • hooks_cli._apply_diary_checkpoint (cognitive 23) mempalace/hooks_cli.py:1050 — hooks_cli._apply_diary_checkpoint has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 9, error handling 2 (3 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mcp_light_server._alias_args_for_handler (cognitive 23) · ×1
  • mcp_light_server._alias_args_for_handler (cognitive 23) mempalace/mcp_light_server.py:845 — mcp_light_server._alias_args_for_handler has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12, boolean chains 10, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · runtime._run_stdio_loop (cognitive 23) · ×1
  • runtime._run_stdio_loop (cognitive 23) mempalace/mcp_server/runtime.py:133 — runtime._run_stdio_loop has cognitive complexity 23 (threshold 15). Drivers by points: error handling 6 (13 pts), if/else 4 (8 pts), loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · migrate._migrate_wing_names_locked (cognitive 23) · ×1
  • migrate._migrate_wing_names_locked (cognitive 23) mempalace/migrate.py:569 — migrate._migrate_wing_names_locked has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, error handling 3 (4 pts), loops 3, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · room_detector_local.save_config (cognitive 23) · ×1
  • room_detector_local.save_config (cognitive 23) mempalace/room_detector_local.py:321 — room_detector_local.save_config has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 3 (7 pts), boolean chains 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rooms.load_pending_apply (cognitive 23) · ×1
  • rooms.load_pending_apply (cognitive 23) mempalace/rooms.py:789 — rooms.load_pending_apply has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5, ternaries 2 (3 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BaseCollection.get_all_rows (cognitive 22) · ×1
  • BaseCollection.get_all_rows (cognitive 22) mempalace/backends/base.py:625 — BaseCollection.get_all_rows has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 4 (9 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chroma._normalize_get_collection_args (cognitive 22) · ×1
  • chroma._normalize_get_collection_args (cognitive 22) REDACTED:3063 — chroma._normalize_get_collection_args has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (19 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chroma_sqlite.sqlite_documents_for_ids (cognitive 22) · ×1
  • chroma_sqlite.sqlite_documents_for_ids (cognitive 22) mempalace/backends/chroma_sqlite.py:1116 — chroma_sqlite.sqlite_documents_for_ids has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (5 pts), boolean chains 1, error handling 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _hub._print_hub_search_result (cognitive 22) · ×1
  • _hub._print_hub_search_result (cognitive 22) mempalace/cli/_hub.py:53 — _hub._print_hub_search_result has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (15 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · tools_diary.tool_diary_read (cognitive 22) · ×1
  • tools_diary.tool_diary_read (cognitive 22) mempalace/mcp_server/tools_diary.py:205 — tools_diary.tool_diary_read has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 2 (6 pts), boolean chains 3, loops 2 (3 pts), error handling 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · miner._try_content_body_date (cognitive 22) · ×1
  • miner._try_content_body_date (cognitive 22) mempalace/miner.py:1312 — miner._try_content_body_date has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), error handling 3 (4 pts), ternaries 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mined.prefetch_complete_mtimes (cognitive 22) · ×1
  • mined.prefetch_complete_mtimes (cognitive 22) mempalace/palace/mined.py:380 — mined.prefetch_complete_mtimes has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, error handling 2, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repair.status (cognitive 22) · ×1
  • repair.status (cognitive 22) mempalace/repair.py:2746 — repair.status has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RoomSet.from_dict (cognitive 22) · ×1
  • RoomSet.from_dict (cognitive 22) mempalace/rooms.py:103 — RoomSet.from_dict has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (9 pts), loops 2, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sweeper.parse_claude_jsonl (cognitive 22) · ×1
  • sweeper.parse_claude_jsonl (cognitive 22) mempalace/sweeper.py:91 — sweeper.parse_claude_jsonl has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · check_versions.main (cognitive 22) · ×1
  • check_versions.main (cognitive 22) scripts/check_versions.py:259 — check_versions.main has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (4 pts), boolean chains 3, ternaries 2 (3 pts), error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · render_jsonl.main (cognitive 22) · ×1
  • render_jsonl.main (cognitive 22) tools/render_jsonl.py:34 — render_jsonl.main has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, ternaries 3, error handling 1 (2 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · milvus._translate_clause (cognitive 21) · ×1
  • milvus._translate_clause (cognitive 21) mempalace/backends/milvus.py:143 — milvus._translate_clause has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · milvus.translate_where_document (cognitive 21) · ×1
  • milvus.translate_where_document (cognitive 21) mempalace/backends/milvus.py:174 — milvus.translate_where_document has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _PgVectorClient.scroll_rows (cognitive 21) · ×1
  • _PgVectorClient.scroll_rows (cognitive 21) mempalace/backends/pgvector.py:671 — _PgVectorClient.scroll_rows has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, ternaries 3 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · qdrant._requires_local_filter (cognitive 21) · ×1
  • qdrant._requires_local_filter (cognitive 21) REDACTED:432 — qdrant._requires_local_filter has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · qdrant._qdrant_filter (cognitive 21) · ×1
  • qdrant._qdrant_filter (cognitive 21) REDACTED:454 — qdrant._qdrant_filter has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SQLiteExactCollection._rows_by_ids (cognitive 21) · ×1
  • SQLiteExactCollection._rows_by_ids (cognitive 21) mempalace/backends/sqlite_exact.py:928 — SQLiteExactCollection._rows_by_ids has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _common._run_pass_zero (cognitive 21) · ×1
  • _common._run_pass_zero (cognitive 21) mempalace/cli/_common.py:111 — _common._run_pass_zero has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (6 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · corpus_origin.detect_origin_heuristic (cognitive 21) · ×1
  • corpus_origin.detect_origin_heuristic (cognitive 21) mempalace/corpus_origin.py:166 — corpus_origin.detect_origin_heuristic has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, loops 3, ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · embedding._resolve_providers (cognitive 21) · ×1
  • embedding._resolve_providers (cognitive 21) mempalace/embedding.py:178 — embedding._resolve_providers has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, loops 1 (2 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · embedding.get_embedding_function (cognitive 21) · ×1
  • embedding.get_embedding_function (cognitive 21) mempalace/embedding.py:1289 — embedding.get_embedding_function has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · llm_client._json_candidates (cognitive 21) · ×1
  • llm_client._json_candidates (cognitive 21) REDACTED:351 — llm_client._json_candidates has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (4 pts), ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mcp_light_server.dispatch_light_stdio_request (cognitive 21) · ×1
  • mcp_light_server.dispatch_light_stdio_request (cognitive 21) mempalace/mcp_light_server.py:961 — mcp_light_server.dispatch_light_stdio_request has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, error handling 1 (3 pts), ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tools_kg.tool_kg_query (cognitive 21) · ×1
  • tools_kg.tool_kg_query (cognitive 21) mempalace/mcp_server/tools_kg.py:28 — tools_kg.tool_kg_query has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (2 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tools_write._bulk_drawer_records (cognitive 21) · ×1
  • tools_write._bulk_drawer_records (cognitive 21) mempalace/mcp_server/tools_write.py:209 — tools_write._bulk_drawer_records has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 5 (7 pts), boolean chains 1, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalize._chatgpt_root_path (cognitive 21) · ×1
  • normalize._chatgpt_root_path (cognitive 21) mempalace/normalize.py:776 — normalize._chatgpt_root_path has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 2 (4 pts), boolean chains 3, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalize._try_slack_json (cognitive 21) · ×1
  • normalize._try_slack_json (cognitive 21) mempalace/normalize.py:867 — normalize._try_slack_json has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalize._extract_content (cognitive 21) · ×1
  • normalize._extract_content (cognitive 21) mempalace/normalize.py:979 — normalize._extract_content has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · backend._open_collection_or_explain (cognitive 21) · ×1
  • backend._open_collection_or_explain (cognitive 21) mempalace/palace/backend.py:107 — backend._open_collection_or_explain has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 7, ternaries 3 (4 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repair._rebuild_one_collection (cognitive 21) · ×1
  • repair._rebuild_one_collection (cognitive 21) mempalace/repair.py:2023 — repair._rebuild_one_collection has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · query._query_drawers_with_filter_fallback (cognitive 21) · ×1
  • query._query_drawers_with_filter_fallback (cognitive 21) mempalace/searcher/query.py:41 — query._query_drawers_with_filter_fallback has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (11 pts), boolean chains 5, loops 1 (2 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · split_mega_files.main (cognitive 21) · ×1
  • split_mega_files.main (cognitive 21) mempalace/split_mega_files.py:326 — split_mega_files.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, loops 2, ternaries 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _filters.matches_where_document (cognitive 20) · ×1
  • _filters.matches_where_document (cognitive 20) mempalace/backends/_filters.py:108 — _filters.matches_where_document has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MilvusBackend._normalize_args (cognitive 20) · ×1
  • MilvusBackend._normalize_args (cognitive 20) mempalace/backends/milvus.py:982 — MilvusBackend._normalize_args has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PgVectorBackend._normalize_args (cognitive 20) · ×1
  • PgVectorBackend._normalize_args (cognitive 20) mempalace/backends/pgvector.py:1667 — PgVectorBackend._normalize_args has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QdrantBackend._normalize_args (cognitive 20) · ×1
  • QdrantBackend._normalize_args (cognitive 20) REDACTED:1130 — QdrantBackend._normalize_args has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fact_checker._check_entity_confusion (cognitive 20) · ×1
  • fact_checker._check_entity_confusion (cognitive 20) mempalace/fact_checker.py:97 — fact_checker._check_entity_confusion has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · hermes._normalize_content (cognitive 20) · ×1
  • hermes._normalize_content (cognitive 20) mempalace/integrations/hermes/__init__.py:241 — hermes._normalize_content has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Layer2.retrieve (cognitive 20) · ×1
  • Layer2.retrieve (cognitive 20) mempalace/layers.py:467 — Layer2.retrieve has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 4 (7 pts), boolean chains 2, error handling 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Logstream.list_events (cognitive 20) · ×1
  • Logstream.list_events (cognitive 20) mempalace/logstream.py:961 — Logstream.list_events has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · mcp_light_server.main (cognitive 20) · ×1
  • mcp_light_server.main (cognitive 20) mempalace/mcp_light_server.py:1004 — mcp_light_server.main has cognitive complexity 20 (threshold 15). Drivers by points: error handling 4 (9 pts), if/else 5 (9 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tools_read._drop_bookkeeping_facets (cognitive 20) · ×1
  • tools_read._drop_bookkeeping_facets (cognitive 20) mempalace/mcp_server/tools_read.py:282 — tools_read._drop_bookkeeping_facets has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · palace_graph.topic_tunnels_for_wing (cognitive 20) · ×1
  • palace_graph.topic_tunnels_for_wing (cognitive 20) mempalace/palace_graph.py:1120 — palace_graph.topic_tunnels_for_wing has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repair.maybe_autoheal_fts5_index (cognitive 20) · ×1
  • repair.maybe_autoheal_fts5_index (cognitive 20) mempalace/repair.py:1353 — repair.maybe_autoheal_fts5_index has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), error handling 3, boolean chains 2, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · apply (cognitive 20) · ×1
  • apply (cognitive 20) .dsh-plugin/lib/recall.js:107 — apply has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (6 pts), error handling 2 (4 pts), loops 2 (3 pts), ternaries 2 (3 pts), boolean chains 2, other 2 (nesting depth added 5). None of this is in the body itself: all 20 points belong to 10 function items inside it that branch (a function literal at line 131, a function literal at line 186, a function literal at line 160, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · quotedScalar (cognitive 20) · ×1
  • quotedScalar (cognitive 20) .dsh-plugin/lib/palace.js:204 — quotedScalar has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChromaCollection.get (cognitive 19) · ×1
  • ChromaCollection.get (cognitive 19) REDACTED:2165 — ChromaCollection.get has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, boolean chains 6, ternaries 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · EmbeddingCollection.upsert (cognitive 19) · ×1
  • EmbeddingCollection.upsert (cognitive 19) mempalace/backends/embedding_wrapper.py:202 — EmbeddingCollection.upsert has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 1 (4 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PgVectorCollection._query_local_exact (cognitive 19) · ×1
  • PgVectorCollection._query_local_exact (cognitive 19) mempalace/backends/pgvector.py:1035 — PgVectorCollection._query_local_exact has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 3 (6 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PgVectorCollection.get (cognitive 19) · ×1
  • PgVectorCollection.get (cognitive 19) mempalace/backends/pgvector.py:1151 — PgVectorCollection.get has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, ternaries 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QdrantCollection._query_local_exact (cognitive 19) · ×1
  • QdrantCollection._query_local_exact (cognitive 19) REDACTED:687 — QdrantCollection._query_local_exact has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 3 (6 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · convo_miner._file_chunks_locked (cognitive 19) · ×1
  • convo_miner._file_chunks_locked (cognitive 19) mempalace/convo_miner.py:631 — convo_miner._file_chunks_locked has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 2 (4 pts), error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EntityRegistry.lookup (cognitive 19) · ×1
  • EntityRegistry.lookup (cognitive 19) mempalace/entity_registry.py:291 — EntityRegistry.lookup has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 3, loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · hooks_cli._save_diary_direct (cognitive 19) · ×1
  • hooks_cli._save_diary_direct (cognitive 19) mempalace/hooks_cli.py:1098 — hooks_cli._save_diary_direct has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 3 (6 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · protocol._read_installed_dist_versions (cognitive 19) · ×1
  • protocol._read_installed_dist_versions (cognitive 19) mempalace/mcp_server/protocol.py:308 — protocol._read_installed_dist_versions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 2 (3 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · migrate._migrate_locked (cognitive 19) · ×1
  • migrate._migrate_locked (cognitive 19) mempalace/migrate.py:252 — migrate._migrate_locked has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), error handling 5 (6 pts), loops 4 (5 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalize._format_tool_result (cognitive 19) · ×1
  • normalize._format_tool_result (cognitive 19) mempalace/normalize.py:1085 — normalize._format_tool_result has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · closets.drawers_removed (cognitive 19) · ×1
  • closets.drawers_removed (cognitive 19) mempalace/palace/closets.py:274 — closets.drawers_removed has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, error handling 3 (5 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mine_lock._lock_mine_lock_file (cognitive 19) · ×1
  • mine_lock._lock_mine_lock_file (cognitive 19) mempalace/palace/mine_lock.py:71 — mine_lock._lock_mine_lock_file has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 3 (7 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repair._rebuild_collection_via_temp (cognitive 19) · ×1
  • repair._rebuild_collection_via_temp (cognitive 19) mempalace/repair.py:463 — repair._rebuild_collection_via_temp has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 3 (5 pts), loops 2, boolean chains 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repair.prune_corrupt (cognitive 19) · ×1
  • repair.prune_corrupt (cognitive 19) mempalace/repair.py:718 — repair.prune_corrupt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (7 pts), error handling 2 (6 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · room_detector_local.get_user_approval (cognitive 19) · ×1
  • room_detector_local.get_user_approval (cognitive 19) mempalace/room_detector_local.py:249 — room_detector_local.get_user_approval has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _inproc_sqlite._guard (cognitive 18) · ×1
  • _inproc_sqlite._guard (cognitive 18) mempalace/backends/_inproc_sqlite.py:347 — _inproc_sqlite._guard has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · BaseCollection.get_recent (cognitive 18) · ×1
  • BaseCollection.get_recent (cognitive 18) mempalace/backends/base.py:673 — BaseCollection.get_recent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 6, ternaries 4, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chroma_sqlite._sqlite_iter_metadata (cognitive 18) · ×1
  • chroma_sqlite._sqlite_iter_metadata (cognitive 18) mempalace/backends/chroma_sqlite.py:812 — chroma_sqlite._sqlite_iter_metadata has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2, boolean chains 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · backups.prune_backups (cognitive 18) · ×1
  • backups.prune_backups (cognitive 18) mempalace/backups.py:229 — backups.prune_backups has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (4 pts), boolean chains 2, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _hub._forward_mine_to_hub (cognitive 18) · ×1
  • _hub._forward_mine_to_hub (cognitive 18) mempalace/cli/_hub.py:213 — _hub._forward_mine_to_hub has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 5, error handling 3, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · cmd_init._maybe_run_mine_after_init (cognitive 18) · ×1
  • cmd_init._maybe_run_mine_after_init (cognitive 18) mempalace/cli/cmd_init.py:271 — cmd_init._maybe_run_mine_after_init has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 5 (7 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Dialect._detect_entities_in_text (cognitive 18) · ×1
  • Dialect._detect_entities_in_text (cognitive 18) mempalace/dialect.py:534 — Dialect._detect_entities_in_text has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MempalaceProvider._file_turn (cognitive 18) · ×1
  • MempalaceProvider._file_turn (cognitive 18) mempalace/integrations/hermes/__init__.py:1265 — MempalaceProvider._file_turn has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 6, error handling 2 (4 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · layers.fetch_recent_window (cognitive 18) · ×1
  • layers.fetch_recent_window (cognitive 18) mempalace/layers.py:164 — layers.fetch_recent_window has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 6, error handling 2 (3 pts), loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · http._http_request_rejected (cognitive 18) · ×1
  • http._http_request_rejected (cognitive 18) mempalace/mcp_server/http.py:416 — http._http_request_rejected has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tools_write.tool_list_drawers (cognitive 18) · ×1
  • tools_write.tool_list_drawers (cognitive 18) mempalace/mcp_server/tools_write.py:1323 — tools_write.tool_list_drawers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, error handling 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · miner.status (cognitive 18) · ×1
  • miner.status (cognitive 18) mempalace/miner.py:2319 — miner.status has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalize._format_tool_use (cognitive 18) · ×1
  • normalize._format_tool_use (cognitive 18) mempalace/normalize.py:1016 — normalize._format_tool_use has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 1 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · closets.move_aaak_out_of_closets (cognitive 18) · ×1
  • closets.move_aaak_out_of_closets (cognitive 18) mempalace/palace/closets.py:352 — closets.move_aaak_out_of_closets has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 4 (5 pts), boolean chains 4, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mine_lock._cleanup_mine_lock_file (cognitive 18) · ×1
  • mine_lock._cleanup_mine_lock_file (cognitive 18) mempalace/palace/mine_lock.py:161 — mine_lock._cleanup_mine_lock_file has cognitive complexity 18 (threshold 15). Drivers by points: error handling 8 (12 pts), if/else 5 (6 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · room_detector_local.detect_rooms_from_files (cognitive 18) · ×1
  • room_detector_local.detect_rooms_from_files (cognitive 18) mempalace/room_detector_local.py:199 — room_detector_local.detect_rooms_from_files has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EmbeddingRoomDecider.__init__ (cognitive 18) · ×1
  • EmbeddingRoomDecider.__init__ (cognitive 18) mempalace/rooms.py:443 — EmbeddingRoomDecider.__init__ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (5 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · write_routing.parse_write_routing_policy (cognitive 18) · ×1
  • write_routing.parse_write_routing_policy (cognitive 18) mempalace/write_routing.py:79 — write_routing.parse_write_routing_policy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · check_versions._frontmatter_version (cognitive 18) · ×1
  • check_versions._frontmatter_version (cognitive 18) scripts/check_versions.py:141 — check_versions._frontmatter_version has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _filters.validate_where (cognitive 17) · ×1
  • _filters.validate_where (cognitive 17) mempalace/backends/_filters.py:27 — _filters.validate_where has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChromaBackend._client_locked (cognitive 17) · ×1
  • ChromaBackend._client_locked (cognitive 17) REDACTED:2650 — ChromaBackend._client_locked has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (8 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · chroma_sqlite._sqlite_ready_metadata_segment (cognitive 17) · ×1
  • chroma_sqlite._sqlite_ready_metadata_segment (cognitive 17) mempalace/backends/chroma_sqlite.py:914 — chroma_sqlite._sqlite_ready_metadata_segment has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MilvusCollection.get (cognitive 17) · ×1
  • MilvusCollection.get (cognitive 17) mempalace/backends/milvus.py:657 — MilvusCollection.get has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, ternaries 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · milvus._translate_field (cognitive 17) · ×1
  • milvus._translate_field (cognitive 17) mempalace/backends/milvus.py:108 — milvus._translate_field has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cmd_kg.cmd_kg (cognitive 17) · ×1
  • cmd_kg.cmd_kg (cognitive 17) mempalace/cli/cmd_kg.py:5 — cmd_kg.cmd_kg has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 3 (4 pts), loops 1 (2 pts), ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · hooks_cli._mine_already_running (cognitive 17) · ×1
  • hooks_cli._mine_already_running (cognitive 17) mempalace/hooks_cli.py:378 — hooks_cli._mine_already_running has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 3 (7 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · hooks_cli._mine_sync (cognitive 17) · ×1
  • hooks_cli._mine_sync (cognitive 17) mempalace/hooks_cli.py:792 — hooks_cli._mine_sync has cognitive complexity 17 (threshold 15). Drivers by points: error handling 3 (7 pts), if/else 4 (7 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · hooks_cli._cwd_from_jsonl (cognitive 17) · ×1
  • hooks_cli._cwd_from_jsonl (cognitive 17) mempalace/hooks_cli.py:1334 — hooks_cli._cwd_from_jsonl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lexical.bm25_scores (cognitive 17) · ×1
  • lexical.bm25_scores (cognitive 17) mempalace/lexical.py:26 — lexical.bm25_scores has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (8 pts), if/else 4 (7 pts), boolean chains 2 (nesting depth added 6). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · tools_read.tool_check_duplicate (cognitive 17) · ×1
  • tools_read.tool_check_duplicate (cognitive 17) mempalace/mcp_server/tools_read.py:776 — tools_read.tool_check_duplicate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 1 (4 pts), boolean chains 2, loops 1 (2 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · migrate._apply_topics_by_wing_renames (cognitive 17) · ×1
  • migrate._apply_topics_by_wing_renames (cognitive 17) mempalace/migrate.py:518 — migrate._apply_topics_by_wing_renames has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (4 pts), boolean chains 1, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · miner.process_file (cognitive 17) · ×1
  • miner.process_file (cognitive 17) mempalace/miner.py:1571 — miner.process_file has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, error handling 1, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · normalize._try_normalize_json_split (cognitive 17) · ×1
  • normalize._try_normalize_json_split (cognitive 17) mempalace/normalize.py:263 — normalize._try_normalize_json_split has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 2 (3 pts), loops 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · normalize._try_claude_ai_json_split (cognitive 17) · ×1
  • normalize._try_claude_ai_json_split (cognitive 17) mempalace/normalize.py:668 — normalize._try_claude_ai_json_split has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalize._messages_to_transcript (cognitive 17) · ×1
  • normalize._messages_to_transcript (cognitive 17) mempalace/normalize.py:1189 — normalize._messages_to_transcript has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · collection.set_palace_embedder_identity (cognitive 17) · ×1
  • collection.set_palace_embedder_identity (cognitive 17) mempalace/palace/collection.py:423 — collection.set_palace_embedder_identity has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 7, error handling 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · rooms._iter_wing_rows (cognitive 17) · ×1
  • rooms._iter_wing_rows (cognitive 17) mempalace/rooms.py:172 — rooms._iter_wing_rows has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), boolean chains 5, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rooms._record_exemplars (cognitive 17) · ×1
  • rooms._record_exemplars (cognitive 17) mempalace/rooms.py:287 — rooms._record_exemplars has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (2 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rooms.rekey_closets_by_ids (cognitive 17) · ×1
  • rooms.rekey_closets_by_ids (cognitive 17) mempalace/rooms.py:665 — rooms.rekey_closets_by_ids has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MediaAdapter._iter_media_paths (cognitive 17) · ×1
  • MediaAdapter._iter_media_paths (cognitive 17) mempalace/sources/media.py:178 — MediaAdapter._iter_media_paths has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · stored_text.prepare_stored_write (cognitive 17) · ×1
  • stored_text.prepare_stored_write (cognitive 17) mempalace/stored_text.py:179 — stored_text.prepare_stored_write has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 5 (7 pts), loops 2, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mempalace_repair_encoding.main (cognitive 17) · ×1
  • mempalace_repair_encoding.main (cognitive 17) scripts/mempalace_repair_encoding.py:157 — mempalace_repair_encoding.main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 4, ternaries 2 (3 pts), error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · mempalace_cli · ×1
  • mempalace_cli::main (cognitive 17) crates/mempalace-cli/src/main.rs:84 — mempalace_cli::main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · BaseCollection.update (cognitive 16) · ×1
  • BaseCollection.update (cognitive 16) mempalace/backends/base.py:806 — BaseCollection.update has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 3 (5 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QdrantCollection._remote_dimension (cognitive 16) · ×1
  • QdrantCollection._remote_dimension (cognitive 16) REDACTED:539 — QdrantCollection._remote_dimension has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 6, loops 1 (2 pts), error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · qdrant._condition (cognitive 16) · ×1
  • qdrant._condition (cognitive 16) REDACTED:402 — qdrant._condition has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SQLiteExactCollection._rank_vectors (cognitive 16) · ×1
  • SQLiteExactCollection._rank_vectors (cognitive 16) mempalace/backends/sqlite_exact.py:1103 — SQLiteExactCollection._rank_vectors has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SQLiteExactCollection._lexical_search_fts (cognitive 16) · ×1
  • SQLiteExactCollection._lexical_search_fts (cognitive 16) mempalace/backends/sqlite_exact.py:1452 — SQLiteExactCollection._lexical_search_fts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 2, boolean chains 1, error handling 1, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DaemonRuntime._worker_loop (cognitive 16) · ×1
  • DaemonRuntime._worker_loop (cognitive 16) mempalace/daemon.py:677 — DaemonRuntime._worker_loop has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), error handling 2 (4 pts), ternaries 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Dialect._extract_topics (cognitive 16) · ×1
  • Dialect._extract_topics (cognitive 16) mempalace/dialect.py:454 — Dialect._extract_topics has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Dialect.compress (cognitive 16) · ×1
  • Dialect.compress (cognitive 16) mempalace/dialect.py:563 — Dialect.compress has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (7 pts), boolean chains 5, if/else 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Dialect.decode (cognitive 16) · ×1
  • Dialect.decode (cognitive 16) mempalace/dialect.py:930 — Dialect.decode has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · entity_detector.classify_entity (cognitive 16) · ×1
  • entity_detector.classify_entity (cognitive 16) mempalace/entity_detector.py:507 — entity_detector.classify_entity has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 6, loops 2, ternaries 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MempalaceProvider.handle_tool_call (cognitive 16) · ×1
  • MempalaceProvider.handle_tool_call (cognitive 16) mempalace/integrations/hermes/__init__.py:967 — MempalaceProvider.handle_tool_call has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · kg_normalize.plan_normalize (cognitive 16) · ×1
  • kg_normalize.plan_normalize (cognitive 16) mempalace/kg_normalize.py:100 — kg_normalize.plan_normalize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), boolean chains 5, error handling 1 (2 pts), loops 2, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kg_normalize.load_normalize_plan (cognitive 16) · ×1
  • kg_normalize.load_normalize_plan (cognitive 16) mempalace/kg_normalize.py:174 — kg_normalize.load_normalize_plan has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Layer3.search (cognitive 16) · ×1
  • Layer3.search (cognitive 16) mempalace/layers.py:526 — Layer3.search has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 3, error handling 2, ternaries 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mcp_light_server._rewrite_tools_call_for_hub (cognitive 16) · ×1
  • mcp_light_server._rewrite_tools_call_for_hub (cognitive 16) mempalace/mcp_light_server.py:879 — mcp_light_server._rewrite_tools_call_for_hub has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 5, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · mcp_proxy._annotate_forwarded_update_status (cognitive 16) · ×1
  • mcp_proxy._annotate_forwarded_update_status (cognitive 16) mempalace/mcp_proxy.py:133 — mcp_proxy._annotate_forwarded_update_status has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 3, error handling 2 (3 pts), loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _guards._sqlite_integrity_payload (cognitive 16) · ×1
  • _guards._sqlite_integrity_payload (cognitive 16) mempalace/mcp_server/_guards.py:740 — _guards._sqlite_integrity_payload has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · protocol._watched_metadata_files (cognitive 16) · ×1
  • protocol._watched_metadata_files (cognitive 16) mempalace/mcp_server/protocol.py:181 — protocol._watched_metadata_files has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (3 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tools_write._collapse_drawer_rows (cognitive 16) · ×1
  • tools_write._collapse_drawer_rows (cognitive 16) mempalace/mcp_server/tools_write.py:397 — tools_write._collapse_drawer_rows has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (6 pts), if/else 3 (5 pts), loops 3, boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · palace_lock.mine_palace_lock (cognitive 16) · ×1
  • palace_lock.mine_palace_lock (cognitive 16) mempalace/palace/palace_lock.py:263 — palace_lock.mine_palace_lock has cognitive complexity 16 (threshold 15). Drivers by points: error handling 4 (8 pts), if/else 7 (8 pts) (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · writes._split_unchanged (cognitive 16) · ×1
  • writes._split_unchanged (cognitive 16) mempalace/palace/writes.py:62 — writes._split_unchanged has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 6, loops 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · palace_graph.traverse (cognitive 16) · ×1
  • palace_graph.traverse (cognitive 16) mempalace/palace_graph.py:344 — palace_graph.traverse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · repair._rebuild_index_under_lease (cognitive 16) · ×1
  • repair._rebuild_index_under_lease (cognitive 16) mempalace/repair.py:1831 — repair._rebuild_index_under_lease has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), error handling 4 (6 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · check_versions._python_version (cognitive 16) · ×1
  • check_versions._python_version (cognitive 16) scripts/check_versions.py:45 — check_versions._python_version has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VectorIndex · ×1
  • VectorIndex::load_from_sqlite (cognitive 16) crates/mempalace-core/src/lib.rs:162 — VectorIndex::load_from_sqlite has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 2 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D22 · Internal API Consistency · Semantic ambiguity between add and upsert. In many vector DB APIs, 'add' implies strict insertion (fail if ID exists) while 'upsert' implies insert-or-update. However, the signatures are identical, and the presence of a separate 'update' method suggests 'upsert' might be an alias for 'update' or 'add'. Without documentation, it is unclear if 'add' and 'upsert' are distinct operations or if one is redundant. · ×1
  • Semantic ambiguity between add and upsert. In many vector DB APIs, 'add' implies strict insertion (fail if ID exists) while 'upsert' implies insert-or-update. However, the signatures are identical, and the presence of a separate 'update' method suggests 'upsert' might be an alias for 'update' or 'add'. Without documentation, it is unclear if 'add' and 'upsert' are distinct operations or if one is redundant. — Clarify if 'add' is strictly insert-only and 'upsert' is insert-or-update. If they are functionally identical in this library, remove one. If 'upsert' is intended to be 'update', rename to 'update' for clarity, or ensure 'add' fails on duplicate IDs. (signatures: BaseCollection.add(self, documents: list[str], ids: list[str], metadatas: Optional[list[dict]], embeddings: Optional[list[list[float]]]): None | BaseCollection.upsert(self, documents: list[str], ids: list[str], metadatas: Optional[list[dict]], embeddings: Optional[list[list[float]]]): None)
D22 · Internal API Consistency · Potential redundancy in counting methods. 'count' and 'estimated_count' often imply exact vs approximate counts. However, if the underlying backend does not support exact counts efficiently, 'count' might just call 'estimated_count', making the distinction confusing. Conversely, if both are exact, one is redundant. · ×1
  • Potential redundancy in counting methods. 'count' and 'estimated_count' often imply exact vs approximate counts. However, if the underlying backend does not support exact counts efficiently, 'count' might just call 'estimated_count', making the distinction confusing. Conversely, if both are exact, one is redundant. — Ensure 'count' is exact and 'estimated_count' is approximate/fast. If 'count' is also approximate, rename to 'count_approx' or remove 'estimated_count' if the distinction is not meaningful for the user. (signatures: BaseCollection.count(self): int | BaseCollection.estimated_count(self): int)
D22 · Internal API Consistency · Overlap in retrieval scope. 'get_all_metadata' retrieves only metadata, while 'get_all_rows' retrieves a full result set (IDs, documents, metadatas, embeddings). If a user only wants metadata, 'get_all_rows' with include=['metadatas'] achieves the same. 'get_all_metadata' is a convenience method, but its existence alongside 'get_all_rows' might confuse users about which to use for partial data retrieval. · ×1
  • Overlap in retrieval scope. 'get_all_metadata' retrieves only metadata, while 'get_all_rows' retrieves a full result set (IDs, documents, metadatas, embeddings). If a user only wants metadata, 'get_all_rows' with include=['metadatas'] achieves the same. 'get_all_metadata' is a convenience method, but its existence alongside 'get_all_rows' might confuse users about which to use for partial data retrieval. — This is a minor convenience duplication. It is acceptable, but ensure 'get_all_metadata' is documented as a shortcut for 'get_all_rows(include=["metadatas"])'. If 'get_all_rows' is the primary method, consider removing 'get_all_metadata' to reduce API surface. (signatures: BaseCollection.get_all_metadata(self, where: Optional[dict]): list[dict] | BaseCollection.get_all_rows(self, where: Optional[dict], include: Optional[list[str]]): GetResult)
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) mempalace/backends/milvus.py:533 — mempalace/backends/milvus.py:533-599 | mempalace/backends/pgvector.py:1038-1073 | mempalace/backends/pgvector.py:1085-1149 | REDACTED:696-731 | REDACTED:743-805 | mempalace/backends/sqlite_exact.py:1018-1101 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (5 members, 50+ identical tokens) REDACTED:3064 — REDACTED:3064-3118 | mempalace/backends/milvus.py:983-1024 | mempalace/backends/pgvector.py:1668-1709 | REDACTED:1131-1172 | mempalace/backends/sqlite_exact.py:1998-2042 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (4 members, 50+ identical tokens) mempalace/backends/pgvector.py:1161 — mempalace/backends/pgvector.py:1161-1201 | mempalace/backends/pgvector.py:1274-1353 | REDACTED:817-838 | REDACTED:864-881 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (40–44 lines × 2) · ×1
  • Duplicated block (40–44 lines × 2) mempalace/convo_miner.py:547 — mempalace/convo_miner.py:547-586 | mempalace/miner.py:1835-1878 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mempalace/convo_miner.py:587` calls `_is_regular_source_file` and `mempalace/miner.py:1879` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (16–31 lines × 2) · ×1
  • Duplicated block (16–31 lines × 2) mempalace/integrations/hermes/__init__.py:124 — mempalace/integrations/hermes/__init__.py:124-139 | mempalace/layers.py:372-402 — 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.
D4 · Code Duplication · Duplicated block (29 lines × 3) · ×1
  • Duplicated block (29 lines × 3) mempalace/backends/milvus.py:996 — mempalace/backends/milvus.py:996-1024 | mempalace/backends/pgvector.py:1681-1709 | REDACTED:1144-1172 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (18–29 lines × 3) · ×1
  • Duplicated block (18–29 lines × 3) mempalace/normalize.py:391 — mempalace/normalize.py:391-408 | mempalace/normalize.py:449-477 | mempalace/normalize.py:520-541 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (21–25 lines × 2) · ×1
  • Duplicated block (21–25 lines × 2) mempalace/knowledge_graph.py:565 — mempalace/knowledge_graph.py:565-585 | mempalace/knowledge_graph.py:646-670 — both copies are in the same file, so extract the 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 `mempalace/knowledge_graph.py:646` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18–22 lines × 2) · ×1
  • Duplicated block (18–22 lines × 2) mempalace/config.py:1438 — mempalace/config.py:1438-1455 | mempalace/config.py:1459-1480 — both copies are in the same file, so extract the 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.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×1
  • Duplicated block (21 lines × 2) mempalace/backends/pgvector.py:1041 — mempalace/backends/pgvector.py:1041-1061 | REDACTED:699-719 — before extracting anything, compare `mempalace/backends/pgvector.py` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 233 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (15–19 lines × 3) · ×1
  • Duplicated block (15–19 lines × 3) mempalace/backends/sqlite_exact.py:269 — mempalace/backends/sqlite_exact.py:269-284 | mempalace/backends/sqlite_exact.py:326-344 | mempalace/backends/sqlite_exact.py:374-388 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mempalace/backends/sqlite_exact.py:269` 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.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×1
  • Duplicated block (19 lines × 2) mempalace/backends/pgvector.py:1632 — mempalace/backends/pgvector.py:1632-1650 | REDACTED:1090-1109 — before extracting anything, compare `mempalace/backends/pgvector.py` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 233 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 `mempalace/backends/pgvector.py:1632` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–19 lines × 2) · ×1
  • Duplicated block (16–19 lines × 2) mempalace/query_parser.py:563 — mempalace/query_parser.py:563-581 | mempalace/query_parser.py:738-753 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×1
  • Duplicated block (16–18 lines × 2) mempalace/backends/pgvector.py:1085 — mempalace/backends/pgvector.py:1085-1102 | REDACTED:743-758 — before extracting anything, compare `mempalace/backends/pgvector.py` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 233 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.
D4 · Code Duplication · Duplicated block (9–18 lines × 2) · ×1
  • Duplicated block (9–18 lines × 2) mempalace/cli/parser.py:1007 — mempalace/cli/parser.py:1007-1024 | mempalace/cli/parser.py:1087-1095 — both copies are in the same file, so extract the 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 `mempalace/cli/parser.py:1007` 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.
D4 · Code Duplication · Duplicated block (13–17 lines × 3) · ×1
  • Duplicated block (13–17 lines × 3) mempalace/query_parser.py:1503 — mempalace/query_parser.py:1503-1515 | mempalace/query_parser.py:1524-1536 | mempalace/query_parser.py:1684-1700 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (12–17 lines × 2) · ×1
  • Duplicated block (12–17 lines × 2) mempalace/convo_miner.py:63 — mempalace/convo_miner.py:63-74 | mempalace/miner.py:1057-1073 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×1
  • Duplicated block (17 lines × 2) mempalace/query_parser.py:501 — mempalace/query_parser.py:501-517 | mempalace/query_parser.py:1477-1493 — both copies are in the same file, so extract the 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.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) mempalace/backends/milvus.py:240 — mempalace/backends/milvus.py:240-255 | REDACTED:155-169 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `mempalace/backends/milvus.py:240` 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.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×1
  • Duplicated block (13–15 lines × 2) mempalace/cli/_hub.py:171 — mempalace/cli/_hub.py:171-185 | mempalace/cli/_hub.py:286-298 — both copies are in the same file, so extract the 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 `mempalace/cli/_hub.py:171` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mempalace/cli/_hub.py:284` calls `exit`, `get` and `mempalace/cli/_hub.py:171` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) mempalace/cli/parser.py:900 — mempalace/cli/parser.py:900-912 | mempalace/cli/parser.py:986-999 — both copies are in the same file, so extract the 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 `mempalace/cli/parser.py:900` 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 4) · ×1
  • Duplicated block (12–13 lines × 4) mempalace/backends/milvus.py:1003 — mempalace/backends/milvus.py:1003-1015 | mempalace/backends/pgvector.py:1688-1700 | REDACTED:1151-1163 | mempalace/backends/sqlite_exact.py:2020-2031 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mempalace/backends/milvus.py:1002` calls `pop` and `mempalace/backends/sqlite_exact.py:2019` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×1
  • Duplicated block (10–12 lines × 2) mempalace/backends/pgvector.py:1138 — mempalace/backends/pgvector.py:1138-1149 | REDACTED:796-805 — before extracting anything, compare `mempalace/backends/pgvector.py` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 233 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 `mempalace/backends/pgvector.py:1138` 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.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×1
  • Duplicated block (11–12 lines × 2) mempalace/cli/parser.py:1021 — mempalace/cli/parser.py:1021-1031 | mempalace/cli/parser.py:1074-1085 — both copies are in the same file, so extract the 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 `mempalace/cli/parser.py:1074` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mempalace/cli/parser.py:1033` calls `add_mutually_exclusive_group`, `add_argument` and `mempalace/cli/parser.py:1087` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9–11 lines × 5) · ×1
  • Duplicated block (9–11 lines × 5) REDACTED:3080 — REDACTED:3080-3090 | mempalace/backends/milvus.py:991-999 | mempalace/backends/pgvector.py:1676-1684 | REDACTED:1139-1147 | mempalace/backends/sqlite_exact.py:2007-2015 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `mempalace/backends/sqlite_exact.py:2016` calls `pop`, `get` and `REDACTED:3091` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) mempalace/backends/milvus.py:354 — mempalace/backends/milvus.py:354-364 | mempalace/backends/pgvector.py:898-908 | REDACTED:558-568 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (2–11 lines × 4) · ×1
  • Duplicated block (2–11 lines × 4) mempalace/backends/pgvector.py:1188 — mempalace/backends/pgvector.py:1188-1198 | mempalace/backends/pgvector.py:1350-1351 | REDACTED:825-835 | REDACTED:878-879 — before extracting anything, compare `mempalace/backends/pgvector.py` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 233 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 `mempalace/backends/pgvector.py:1188` 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.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) mempalace/convo_miner.py:1141 — mempalace/convo_miner.py:1141-1149 | mempalace/format_miner.py:945-955 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mempalace/convo_miner.py:1138` calls `items` and `mempalace/format_miner.py:943` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×1
  • Duplicated block (10–11 lines × 2) mempalace/query_parser.py:1622 — mempalace/query_parser.py:1622-1632 | mempalace/query_parser.py:1644-1653 — both copies are in the same file, so extract the 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.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×1
  • Duplicated block (10 lines × 3) mempalace/query_parser.py:561 — mempalace/query_parser.py:561-570 | mempalace/query_parser.py:736-745 | mempalace/query_parser.py:969-978 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (6–10 lines × 2) · ×1
  • Duplicated block (6–10 lines × 2) mempalace/cli/parser.py:696 — mempalace/cli/parser.py:696-705 | mempalace/cli/parser.py:769-774 — both copies are in the same file, so extract the 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 `mempalace/cli/parser.py:696` 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×1
  • Duplicated block (8–9 lines × 2) mempalace/mcp_server/tools_diary.py:110 — mempalace/mcp_server/tools_diary.py:110-118 | mempalace/mcp_server/tools_write.py:605-612 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `mempalace/mcp_server/tools_diary.py:110` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `mempalace/mcp_server/tools_write.py:597` calls `_wal_result` and `mempalace/mcp_server/tools_diary.py:87` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8 lines × 6) · ×1
  • Duplicated block (8 lines × 6) mempalace/query_parser.py:1411 — mempalace/query_parser.py:1411-1418 | mempalace/query_parser.py:1505-1512 | mempalace/query_parser.py:1526-1533 | mempalace/query_parser.py:1570-1577 | mempalace/query_parser.py:1629-1636 | mempalace/query_parser.py:1686-1693 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) mempalace/query_parser.py:1355 — mempalace/query_parser.py:1355-1362 | mempalace/query_parser.py:1446-1453 | mempalace/query_parser.py:1609-1616 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) mempalace/dialect.py:823 — mempalace/dialect.py:823-830 | mempalace/dialect.py:846-852 — both copies are in the same file, so extract the 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.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×1
  • Duplicated block (6 lines × 5) mempalace/backends/milvus.py:555 — mempalace/backends/milvus.py:555-560 | mempalace/backends/pgvector.py:1048-1053 | mempalace/backends/pgvector.py:1113-1118 | REDACTED:706-711 | REDACTED:770-775 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:768` calls `_qdrant_filter` and `mempalace/backends/pgvector.py:1111` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) mempalace/query_parser.py:1414 — mempalace/query_parser.py:1414-1419 | mempalace/query_parser.py:1573-1578 | mempalace/query_parser.py:1632-1637 | mempalace/query_parser.py:1649-1654 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (3–6 lines × 3) · ×1
  • Duplicated block (3–6 lines × 3) mempalace/entity_detector.py:836 — mempalace/entity_detector.py:836-841 | mempalace/entity_detector.py:845-850 | mempalace/room_detector_local.py:267-269 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×1
  • Duplicated block (5 lines × 3) mempalace/backends/milvus.py:1108 — mempalace/backends/milvus.py:1108-1112 | mempalace/backends/pgvector.py:1712-1716 | REDACTED:1175-1179 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: mempalace-core — mempalace-core: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Minor — 110 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate mempalace/mcp_server/_session.py:592 — `_is_chroma_backend() and _config.palace_path` appears character-identically in 2 files — mempalace/mcp_server/_session.py, mempalace/mcp_server/tools_write.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/rooms.py:180 — `batch.get("metadatas") or [None] * len(ids)` appears character-identically in 2 files — mempalace/rooms.py, mempalace/wing_split.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/layers.py:186 — `build_where_filter(wing, col=col) or None` appears character-identically in 2 files — mempalace/layers.py, mempalace/sync.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/backends/base.py:824 — `documents is None and metadatas is None and embeddings is None` appears character-identically in 3 files — mempalace/backends/base.py, REDACTED, mempalace/backends/sqlite_exact.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/fsio.py:524 — `exc.errno != errno.EAGAIN or not stat.S_ISREG(os.lstat(path).st_mode)` appears character-identically in 2 files — mempalace/fsio.py, mempalace/repair.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/backends/rust_exact.py:154 — `expected_dim is not None and int(q.size) != expected_dim` appears character-identically in 2 files — mempalace/backends/rust_exact.py, mempalace/backends/sqlite_exact.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/cli/cmd_init.py:49 — `getattr(args, "llm_model", "gemma4:e4b") or "gemma4:e4b"` appears character-identically in 2 files — mempalace/cli/cmd_init.py, mempalace/cli/cmd_rooms.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/cli/cmd_init.py:48 — `getattr(args, "llm_provider", "ollama") or "ollama"` appears character-identically in 2 files — mempalace/cli/cmd_init.py, mempalace/cli/cmd_rooms.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/cli/_hub.py:204 — `getattr(args, "mode", None) or "projects"` appears character-identically in 2 files — mempalace/cli/_hub.py, mempalace/cli/cmd_mine.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/backends/pgvector.py:1364 — `ids is None and where is not None and not _requires_local_filter(where)` appears character-identically in 2 files — mempalace/backends/pgvector.py, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/backends/embedding_wrapper.py:132 — `isinstance(source_file, str) and source_file.strip()` appears character-identically in 2 files — mempalace/backends/embedding_wrapper.py, mempalace/embeddinggemma2.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/backends/embedding_wrapper.py:135 — `isinstance(source_path, str) and source_path.strip()` appears character-identically in 2 files — mempalace/backends/embedding_wrapper.py, mempalace/embeddinggemma2.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/backends/embedding_wrapper.py:129 — `isinstance(title, str) and title.strip()` appears character-identically in 2 files — mempalace/backends/embedding_wrapper.py, mempalace/embeddinggemma2.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/mcp_server/protocol.py:760 — `isinstance(value, str) and _INT_TEXT.fullmatch(value.strip())` appears character-identically in 2 files — mempalace/mcp_server/protocol.py, mempalace/metadata_types.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/backends/pgvector.py:996 — `matches_where(row["metadata"], where) and matches_where_document(row["document"], where_document)` appears character-identically in 2 files — mempalace/backends/pgvector.py, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/cli/cmd_tunnels.py:109 — `normalize_wing_name(row["wing_a"]) or row["wing_a"]` appears character-identically in 2 files — mempalace/cli/cmd_tunnels.py, mempalace/tunnels_tool.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/cli/cmd_tunnels.py:110 — `normalize_wing_name(row["wing_b"]) or row["wing_b"]` appears character-identically in 2 files — mempalace/cli/cmd_tunnels.py, mempalace/tunnels_tool.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:2898 — `not create and not os.path.isdir(palace_path)` appears character-identically in 2 files — REDACTED, mempalace/backends/sqlite_exact.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/backends/sqlite_exact.py:1711 — `not create and not os.path.isfile(db_path)` appears character-identically in 2 files — mempalace/backends/sqlite_exact.py, mempalace/mcp_server/_session.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/backends/milvus.py:456 — `not isinstance(doc_id, str) or not doc_id` appears character-identically in 2 files — mempalace/backends/milvus.py, mempalace/stored_text.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/mcp_light_server.py:786 — `not isinstance(params, dict) or "name" not in params` appears character-identically in 2 files — mempalace/mcp_light_server.py, mempalace/mcp_server/protocol.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/config.py:129 — `not isinstance(value, str) or not value.strip()` appears character-identically in 6 files — mempalace/config.py, mempalace/logstream.py, mempalace/media.py, mempalace/palace_graph.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/miner.py:1044 — `not isinstance(wing, str) or not wing.strip()` appears character-identically in 2 files — mempalace/miner.py, mempalace/palace_graph.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/format_miner.py:704 — `not mine_yield_point() or collection is None` appears character-identically in 2 files — mempalace/format_miner.py, mempalace/miner.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate mempalace/config.py:1520 — `os.environ.get("MEMPALACE_LANG") or os.environ.get("MEMPAL_LANG")` appears character-identically in 2 files — mempalace/config.py, mempalace/searcher/ranking.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
M4 · Documentation accuracy · README/code drift · ×21
  • README/code drift .dsh-plugin/README.md:168 — .dsh-plugin/README.md runs `node --test test/*.test.mjs`, but `test/*.test.mjs` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/format-coverage.md:5 — docs/format-coverage.md names `mempalace/cli.py`, but no file or folder `mempalace/cli.py` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/virtual-line-numbering.md:4 — docs/virtual-line-numbering.md names `mempalace/searcher.py`, but no file or folder `mempalace/searcher.py` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/recovery/index-metadata-recovery.md:194 — docs/recovery/index-metadata-recovery.md names `docs/recovery/chromadb-metadata-dict-patch.md`, but no file or folder `docs/recovery/chromadb-metadata-dict-patch.md` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift docs/recovery/index-metadata-recovery.md:197 — docs/recovery/index-metadata-recovery.md names `tests/test_chromadb_metadata_recovery.py`, but no file or folder `tests/test_chromadb_metadata_recovery.py` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift benchmarks/model_eval/datasets/README.md:27 — benchmarks/model_eval/datasets/README.md names `skills/latex`, but no file or folder `skills/latex` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift benchmarks/model_eval/datasets/README.md:27 — benchmarks/model_eval/datasets/README.md names `skills/python`, but no file or folder `skills/python` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift benchmarks/model_eval/datasets/README.md:27 — benchmarks/model_eval/datasets/README.md names `skills/statistical-tests`, but no file or folder `skills/statistical-tests` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift benchmarks/model_eval/datasets/README.md:33 — benchmarks/model_eval/datasets/README.md names `skills/rust`, but no file or folder `skills/rust` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift benchmarks/model_eval/datasets/README.md:33 — benchmarks/model_eval/datasets/README.md names `skills/ocaml`, but no file or folder `skills/ocaml` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift benchmarks/model_eval/datasets/README.md:33 — benchmarks/model_eval/datasets/README.md names `skills/llvm`, but no file or folder `skills/llvm` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift benchmarks/model_eval/datasets/README.md:39 — benchmarks/model_eval/datasets/README.md names `skills/narrative-design`, but no file or folder `skills/narrative-design` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift benchmarks/model_eval/datasets/README.md:39 — benchmarks/model_eval/datasets/README.md names `skills/etymology`, but no file or folder `skills/etymology` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift benchmarks/model_eval/datasets/README.md:39 — benchmarks/model_eval/datasets/README.md names `skills/mythology`, but no file or folder `skills/mythology` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift benchmarks/model_eval/datasets/README.md:45 — benchmarks/model_eval/datasets/README.md names `skills/phenology`, but no file or folder `skills/phenology` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift benchmarks/model_eval/datasets/README.md:45 — benchmarks/model_eval/datasets/README.md names `skills/plant-pathology`, but no file or folder `skills/plant-pathology` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift benchmarks/model_eval/datasets/README.md:45 — benchmarks/model_eval/datasets/README.md names `skills/propagation`, but no file or folder `skills/propagation` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift benchmarks/model_eval/datasets/README.md:51 — benchmarks/model_eval/datasets/README.md names `skills/double-entry`, but no file or folder `skills/double-entry` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift benchmarks/model_eval/datasets/README.md:51 — benchmarks/model_eval/datasets/README.md names `skills/depreciation-rules`, but no file or folder `skills/depreciation-rules` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift benchmarks/model_eval/datasets/README.md:51 — benchmarks/model_eval/datasets/README.md names `skills/ifrs`, but no file or folder `skills/ifrs` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift benchmarks/model_eval/reports/README.md:3 — benchmarks/model_eval/reports/README.md documents the environment variable `MODEL_TIERS`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
D29 · Static Analysis (SAST) · REDACTED · ×14
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×14
  • Silent fallback default on parse failure benchmarks/model_eval/orchestrator.py:83 — `load_candidates` returns `[]` when `(ValueError, IndexError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure benchmarks/model_eval/tasks/entity_extraction/score.py:19 — `_parse` returns `[]` when `json.JSONDecodeError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure benchmarks/model_eval/tasks/memory_extraction/score.py:19 — `_parse` returns `[]` when `json.JSONDecodeError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure REDACTED:123 — `_qdrant_score_to_distance` returns `1.0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure mempalace/backends/sqlite_exact.py:86 — `_json_loads` returns `{}` when `json.JSONDecodeError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure mempalace/entity_detector.py:77 — `_get_coca_filter` returns `frozenset()` when `(OSError, json.JSONDecodeError, AttributeError, TypeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure mempalace/i18n/__init__.py:119 — `get_stopwords` returns `set()` when `(json.JSONDecodeError, OSError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure mempalace/i18n/__init__.py:137 — `_load_entity_section` returns `{}` when `(json.JSONDecodeError, OSError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure mempalace/llm_refine.py:115 — `_parse_response` returns `{}` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure mempalace/mcp_server/tools_write.py:20 — `_chunk_index` returns `0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure mempalace/server_registry.py:72 — `_read_server_token_file` returns `''` when `(OSError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure mempalace/sync.py:351 — `_classify_drawer` returns `'unresolved'` when `(OSError, RuntimeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure mempalace/timeutil.py:116 — `recency_floor` returns `''` when `OverflowError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure mempalace/update_awareness.py:45 — `_read_json` returns `{}` when `(FileNotFoundError, OSError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
D29 · Static Analysis (SAST) · REDACTED · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X7 · Silent fallback defaults · Silent fallback default in catch · ×7
  • Silent fallback default in catch mempalace/backends/registry.py:41 — `_config_file_hint` swallows every exception into `return 'config.json in the MemPalace config directory'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch mempalace/fact_checker.py:210 — `_check_kg_contradictions` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch mempalace/mcp_light_server.py:702 — `_classify_underlying_tool` swallows every exception into `return 'mempalace_add_drawer'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch mempalace/mcp_server/_session.py:596 — `_palace_known_wings` swallows every exception into `return frozenset()` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch mempalace/mcp_server/protocol.py:1107 — `_describe_device_safe` swallows every exception into `return 'unknown'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch mempalace/migrate.py:505 — `_plan_topics_by_wing_renames` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch mempalace/search_util.py:206 — `_metric_for_collection` swallows every exception into `return 'cosine'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
D20 · ADR Quality · ADR lacks an enforcement field · ×4
  • ADR lacks an enforcement field docs/rfcs/001-storage-backend-plugin-spec.md:1 — Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
  • ADR lacks an enforcement field docs/rfcs/003-agent-logstream-coordination.md:1 — Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
  • ADR lacks an enforcement field docs/rfcs/004-replicated-palace.md:1 — Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
  • ADR lacks an enforcement field docs/rfcs/005-agent-identity-routing.md:1 — Add an `enforcement:` frontmatter field or a plain `Enforcement:` header line (prose/test/analyzer/not-applicable) to make the rung explicit — the other ADRs in this repo already declare one.
D20 · ADR Quality · ADR has no Decision and Consequences section · ×3
  • ADR has no Decision and Consequences section docs/rfcs/001-storage-backend-plugin-spec.md:1 — docs/rfcs/001-storage-backend-plugin-spec.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
  • ADR has no Decision and Consequences section docs/rfcs/002-source-adapter-plugin-spec.md:1 — docs/rfcs/002-source-adapter-plugin-spec.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
  • ADR has no Decision and Consequences section docs/rfcs/003-agent-logstream-coordination.md:1 — docs/rfcs/003-agent-logstream-coordination.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
D19 · Documentation Quality · Documentation · ×2
  • Documentation: contradicts the code benchmarks/model_eval/README.md — The model-evaluation harness claims to run on an RTX 3090 but the benchmark snapshot uses a different GPU. Update the GPU and VRAM requirements to match the current hardware.
  • Documentation: written for insiders docs/authored-at.md — The document defines metadata fields like `authored_at_source` but never explains what a reader sees when inspecting the provenance of an authored drawer (e.g. who wrote it, whether it is re-imported). Add a short 'What does this mean for searchers?' section that maps each provenance field to its observable value.
X4 · Structured logging · Interpolated log message defeats structured logging · ×2
  • Interpolated log message defeats structured logging mempalace/wal.py:110 — `error` at line 110 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.error("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.error("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging mempalace/wal.py:140 — `error` at line 140 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.error("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.error("order moved", order_id=order_id, status=status)` with structlog.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 44 significant file(s) lose their only recent owner: mempalace/logstream.py, benchmarks/search_benchmark.py, mempalace/rooms.py, mempalace/mcp_server/_session.py, mempalace/cli/cmd_coord.py, crates/mempalace-core/src/lib.rs, mempalace/searcher/sqlite_bm25.py, mempalace/palace/palace_lock.py (+36 more). Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 4 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (48 single-owned of 170 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 170 of the 201 production source files in this repository met that bar). They are anonymized user #2 (1 file(s)), anonymized user #3 (1 file(s)), anonymized user #4 (1 file(s)), anonymized user #5 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: mempalace/entities.py, benchmarks/model_eval/translate_datasets.py, mempalace/write_routing.py, mempalace/_stdio.py.
D20 · ADR Quality · ADR has no Consequences section · ×1
  • ADR has no Consequences section docs/rfcs/005-agent-identity-routing.md:1 — docs/rfcs/005-agent-identity-routing.md has no Consequences section (a heading such as `## Consequences`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 1 of 5 project(s) overshoot their size bounds, lowering Project Cohesion to 6.0/10. The most over is `(repository root)` (82454 LoC, 366 module-visible types across 21 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 1 of 170 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 170 of the 201 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: scripts/backfill_authored_at.py. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D34 · Knowledge Freshness · Orphaned file · ×1
  • Orphaned file scripts/backfill_authored_at.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 1/2 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `crates/mempalace-cli`.
X5 · Nullable reference types · Strict null checking is not enabled everywhere the repository type-checks · ×1
  • Strict null checking is not enabled everywhere the repository type-checks — This repository commits no tsconfig, so whatever type-checks it uses tsc's own defaults, in which `strict` and `strictNullChecks` are OFF: `string` admits `null` and `undefined`, and a value that is null is compiled through to the property access that throws. If the build passes `--strict` on a command line instead, put it in a committed tsconfig — this check reads configuration, and configuration is all it can read.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-c175536329e54c428e5c57530112c27b/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-c175536329e54c428e5c57530112c27b/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .37artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update16artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .6artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update0artifacts/raw/trivy-fs.json

Run 01a170ee-4821-7337-a228-85fced856d19 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

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