Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.
Python aicode-complexitycode-healthcode-intelligencecode-qualitydead-codedeveloper-toolsdocumentationgit-analyticsmcpopen-sourcepythonrefactoringstatic-analysistechnical-debt
fix(mcp): count response tokens by content class, and stamp what the budget dropped (#2179)
Raghav Chamadiya3f25c291ebcf
diff --git a/docs/agent/MCP_TOOLS.md b/docs/agent/MCP_TOOLS.mdindex af2dc8b50..d81f83a06 100644--- a/docs/agent/MCP_TOOLS.md+++ b/docs/agent/MCP_TOOLS.md@@ -160,6 +160,8 @@ Resolve refs with `repowise expand <ref>` from a shell, or| `response_budget` | Always: `limit_chars` (the ceiling that applied), `tier` (`default` or `expanded`, chosen by whether the call passed an expansion argument), `serialized_chars` (the size delivered) || `scope_hint` | `get_context` and `get_answer`, when knowledge-graph layers exist that contain none of the served paths: one sentence naming up to three of them with file counts, so an agent knows which areas the answer did not touch || `complete` | When the response served whole units: how many symbol bodies (bounds verified against the live file) or whole files, and that they need not be re-opened. Sliced bodies and partial ranges are never counted |+| `completeness` | Always: `capped`, plus `shown` and `total` summed over every collection a reducing pass counted, and `reason` naming the pass that dropped the most. The sum spans unlike collections and sits inside whatever `limit` the call already applied, so it measures what survived reduction, not what share of the repository you hold. Absent `shown`/`total` means no pass counted rows |+| `floor` | Only when the response carries a count derived by walking the indexed graph: names those fields, whose values are lower bounds because an edge the index failed to resolve is uncounted rather than proven absent || `state` | Only when something fired: `degraded` plus `degraded_reasons` mapping each contributing key to its reason (a synthesis reason string, the retrieval legs that broke), `partial`, `truncated`. A coarse roll-up of the response's own flags |Silence on `stale_warning` means the index is current; don't infer staleness from its absence. `list_repos`, `get_architecture`, `get_blast_radius`, and `get_conformance` don't carry a freshness envelope at all. Neither does `search_codebase` when a workspace call merges results from several repos, since there is no single indexed commit to compare.diff --git a/packages/server/src/repowise/server/mcp_server/_budget/budgeter.py b/packages/server/src/repowise/server/mcp_server/_budget/budgeter.pyindex 83e590ab0..f460d4032 100644--- a/packages/server/src/repowise/server/mcp_server/_budget/budgeter.py+++ b/packages/server/src/repowise/server/mcp_server/_budget/budgeter.py@@ -24,10 +24,11 @@ the smallest that DID was 60,718 — consistent with a 25000-token cap at thehalf that line. The residual risk is a user who *lowers*``MAX_MCP_OUTPUT_TOKENS``, which :func:`effective_char_budget` clamps for.-The estimator is intentionally dependency-free: 4 chars/token is the-widely-quoted average for English + code on BPE tokenizers, and it undercounts-the compact JSON we emit by roughly 1.7x. ``HOST_CAP_BUDGET_FRACTION`` absorbs-that gap plus the JSON envelope and ``_meta`` the host counts on top.+The estimator is dependency-free: it charges each content class of the+serialised payload at a rate measured against the o200k_base tokenizer. A+single divisor over the whole response undercounts, worst on the payloads that+are mostly paths and identifiers. ``HOST_CAP_BUDGET_FRACTION`` absorbs the JSON+envelope and ``_meta`` the host counts on top of ours."""from __future__ import annotations@@ -43,6 +44,7 @@ from repowise.server.mcp_server._budget.collector import OmissionCollectorlogger = logging.getLogger(__name__)TOKEN_BUDGET = 8000+#: The char ceiling the truncation path measures against, not an estimate.CHARS_PER_TOKEN = 4CHAR_BUDGET = TOKEN_BUDGET * CHARS_PER_TOKEN@@ -86,15 +88,59 @@ def effective_char_budget(configured: int = CHAR_BUDGET) -> int:return min(configured, host_char_ceiling)+# Measured chars/token against the o200k_base tokenizer on recorded tool+# responses. Paths and identifiers run densest, prose loosest.+CHARS_PER_TOKEN_JSON_STRUCTURE = 3.7+CHARS_PER_TOKEN_PATH = 3.4+CHARS_PER_TOKEN_CODE_BODY = 3.8+CHARS_PER_TOKEN_PROSE = 4.5++_CODE_PUNCTUATION = frozenset("(){}[]<>=;:+-*/%&|!@#$^~`_.")++#: Punctuation share above which a whitespace-bearing string reads as code.+#: Calibrated so a source body lands on the code side and an English sentence+#: carrying identifiers does not.+_CODE_PUNCTUATION_SHARE = 0.05+++def _content_class(text: str) -> str:+ """Classify one JSON string leaf by how densely it tokenizes."""+ if not any(character.isspace() for character in text):+ return "path"+ punctuation = sum(1 for character in text if character in _CODE_PUNCTUATION)+ return "code" if punctuation >= len(text) * _CODE_PUNCTUATION_SHARE else "prose"+++def _add_leaf_chars(obj: Any, totals: dict[str, int]) -> None:+ """Accumulate the serialised length of every string leaf, per content class."""+ if isinstance(obj, str):+ totals[_content_class(obj)] += len(json.dumps(obj))+ elif isinstance(obj, dict):+ for value in obj.values():+ _add_leaf_chars(value, totals)+ elif isinstance(obj, (list, tuple)):+ for value in obj:+ _add_leaf_chars(value, totals)++def estimate_response_tokens(obj: Any) -> int:- """Cheap upper-bound token estimate for an arbitrary JSON-serialisable object.+ """Token estimate for an arbitrary JSON-serialisable object.- Serialises to compact JSON (the wire format the MCP layer eventually emits)- and divides by ``CHARS_PER_TOKEN``. We use the serialised form — not just- raw text fields — because structural JSON overhead (quotes, braces, field- names) is non-trivial and is what the downstream tokenizer actually sees.+ Measures the compact JSON the MCP layer emits rather than the text fields+ alone, because field names, quotes, and braces are what the downstream+ tokenizer sees. Each string leaf is charged at its content class's rate and+ everything left over (keys, punctuation, numbers, literals) at the+ structural one."""- return len(json.dumps(obj, separators=(",", ":"), default=str)) // CHARS_PER_TOKEN+ leaves = {"path": 0, "code": 0, "prose": 0}+ _add_leaf_chars(obj, leaves)+ structure = max(0, response_chars(obj) - sum(leaves.values()))+ return int(+ structure / CHARS_PER_TOKEN_JSON_STRUCTURE+ + leaves["path"] / CHARS_PER_TOKEN_PATH+ + leaves["code"] / CHARS_PER_TOKEN_CODE_BODY+ + leaves["prose"] / CHARS_PER_TOKEN_PROSE+ )# Reserved for what the collector appends after the last fit check: thediff --git a/packages/server/src/repowise/server/mcp_server/_budget/contracts.py b/packages/server/src/repowise/server/mcp_server/_budget/contracts.pyindex 9e100799e..8fbc0cb14 100644--- a/packages/server/src/repowise/server/mcp_server/_budget/contracts.py+++ b/packages/server/src/repowise/server/mcp_server/_budget/contracts.py@@ -40,6 +40,11 @@ class ResponseBudgetContract:shed_order: tuple[str, ...] = ()expansion_argument: str | None = "include"protected: tuple[str, ...] = ()+ #: Counts this tool derives by walking the indexed graph, named in+ #: ``_meta.floor`` when present. An edge the index failed to resolve is+ #: uncounted rather than proven absent, so the count is a lower bound.+ #: A ``<field>_total`` name here is also read as a reduction total.+ floor_fields: tuple[str, ...] = ()#: What a tool gets when it declares no priority of its own. An empty shed@@ -49,7 +54,11 @@ class ResponseBudgetContract:_DEFAULT_CONTRACT = ResponseBudgetContract("blocks")_CONTRACTS: dict[str, ResponseBudgetContract] = {- "get_context": ResponseBudgetContract("targets", protected=("targets",)),+ "get_context": ResponseBudgetContract(+ "targets",+ protected=("targets",),+ floor_fields=("callers_total",),+ ),"get_risk": ResponseBudgetContract("blocks",(@@ -62,6 +71,12 @@ _CONTRACTS: dict[str, ResponseBudgetContract] = {"targets[]",),protected=("directive", "targets"),+ floor_fields=(+ "dependents_count",+ "dependents_total",+ "impact_surface_total",+ "co_change_partners_total",+ ),),"get_change_risk": ResponseBudgetContract("blocks",@@ -360,6 +375,75 @@ def _stamp_accounting(result: dict[str, Any], *, limit: int, tier: str) -> None:budget["serialized_chars"] = measured+def _stamp_completeness(+ result: dict[str, Any], contract: ResponseBudgetContract+) -> None:+ """Roll the per-collection reduction counts up into one ``_meta`` block.++ Every reducing pass already leaves ``<field>_total`` beside+ ``<field>_emitted`` and a ``<field>_reduced_reason``, and reading them+ takes a caller a walk of the whole response. The sum spans every counted+ collection, so it says how much of what this call was going to return+ survived, not what share of the repository the caller now holds: a tool's+ own result limit applies before any of these counters exist.+ """+ shown = 0+ total = 0+ counted = False+ dropped_by_reason: dict[str, int] = {}+ floors: set[str] = set()+ wanted = set(contract.floor_fields)++ def record(field_total: int, emitted: int, reason: Any) -> None:+ nonlocal shown, total, counted+ counted = True+ total += field_total+ shown += emitted+ if isinstance(reason, str):+ dropped_by_reason[reason] = dropped_by_reason.get(reason, 0) + max(+ 0, field_total - emitted+ )++ def visit(node: dict[str, Any]) -> None:+ for key, value in node.items():+ if key in wanted and isinstance(value, int) and not isinstance(value, bool):+ floors.add(key)+ if isinstance(value, dict):+ visit(value)+ elif isinstance(value, list):+ for item in value:+ if isinstance(item, dict):+ visit(item)+ elif key.endswith("_total") and isinstance(value, int):+ stem = key[: -len("_total")]+ emitted = node.get(f"{stem}_emitted")+ if isinstance(emitted, int):+ record(value, emitted, node.get(f"{stem}_reduced_reason"))++ visit({key: value for key, value in result.items() if key != "_meta"})++ meta = result.setdefault("_meta", {})+ # A block dropped whole is recorded here instead of as sibling counts.+ for row in meta.get("reductions") or []:+ if isinstance(row, dict) and isinstance(row.get("total"), int):+ record(row["total"], int(row.get("emitted") or 0), row.get("reason"))++ completeness: dict[str, Any] = {+ "capped": shown < total or bool(result.get("truncated"))+ }+ # "0 of 0" is a collection that had nothing to reduce, and reads as+ # nothing served.+ if counted and total:+ completeness["shown"] = shown+ completeness["total"] = total+ if completeness["capped"] and dropped_by_reason:+ # Whichever pass dropped the most rows is the one worth acting on.+ completeness["reason"] = max(dropped_by_reason.items(), key=lambda row: row[1])[0]+ meta["completeness"] = completeness+ if floors:+ meta["floor"] = sorted(floors)++async def resolve_response_budget_repo_root(signature: inspect.Signature,args: tuple[Any, ...],@@ -547,6 +631,7 @@ def enforce_response_budget(if result.get("truncated"):result.setdefault("_meta", {}).setdefault("state", {})["truncated"] = True+ _stamp_completeness(result, contract)_stamp_accounting(result, limit=limit, tier=tier)if response_chars(result) > limit:result.setdefault("_meta", {}).setdefault("response_budget", {})[diff --git a/packages/server/src/repowise/server/mcp_server/tool_risk/get_risk.py b/packages/server/src/repowise/server/mcp_server/tool_risk/get_risk.pyindex 9afc81255..bf3035d09 100644--- a/packages/server/src/repowise/server/mcp_server/tool_risk/get_risk.py+++ b/packages/server/src/repowise/server/mcp_server/tool_risk/get_risk.py@@ -116,8 +116,9 @@ async def get_risk(Fuses git temporal signals (``hotspot_score``/``owner_pct`` are 0-1; trend;bus factor) with graph topology. ``dependents`` are directed structuralreach (source depends on target), ``consumers`` require typed contract links,- and ``co_change_partners`` are historical correlation only. Structural reach- is not proof of runtime breakage. The response also includes security+ and ``co_change_partners`` are historical correlation only. Those counts+ are a floor over the indexed graph. Structural reach is not proof of+ runtime breakage. The response also includes securityfindings. Pass changed_files for PR mode: the response leads with adirective block (may_break, missing_cochanges, missing_tests,tests_to_run) — read it first. Each test_recommendations row carries adiff --git a/scripts/measure_mcp_response_sizes.py b/scripts/measure_mcp_response_sizes.pyindex 3125cd70a..d6c624bdc 100644--- a/scripts/measure_mcp_response_sizes.py+++ b/scripts/measure_mcp_response_sizes.py@@ -28,6 +28,7 @@ import contextlibimport importlibimport jsonimport os+import reimport sqlite3import sysimport traceback@@ -127,6 +128,55 @@ def _merge_skeleton(into: Any, new: Any) -> Any:return new if into is None else into+#: The recorded corpus is committed, so what ties it to the machine and the+#: people it was recorded from has to go: git identities and the checkout path.+_EMAIL = re.compile(r"[^\s<>@]+@[^\s<>@]+\.[^\s<>@]+")++#: Fields that carry a person. Their values are substituted everywhere they+#: appear, including inside generated prose, which is why collecting them+#: first and replacing afterwards beats redacting field by field.+_IDENTITY_FIELDS = frozenset(+ {"author", "name", "primary_author", "primary_owner", "recent_owner"}+)+++def _identities(payload: Any, found: set[str]) -> None:+ if isinstance(payload, dict):+ for key, value in payload.items():+ if key in _IDENTITY_FIELDS and isinstance(value, str) and " " in value:+ found.add(value)+ _identities(value, found)+ elif isinstance(payload, list):+ for item in payload:+ _identities(item, found)+++def _redact(payload: Any, repo: str) -> Any:+ # Longest first, so one root cannot shadow a longer one that contains it.+ roots = sorted({repo, repo.replace("\\", "/")}, key=len, reverse=True)+ found: set[str] = set()+ _identities(payload, found)+ people = {+ name: f"Contributor {index}"+ for index, name in enumerate(sorted(found, key=len, reverse=True), start=1)+ }++ def clean(value: Any) -> Any:+ if isinstance(value, str):+ for root in roots:+ value = value.replace(root, "/repo")+ for name, alias in people.items():+ value = value.replace(name, alias)+ return _EMAIL.sub("[email protected]", value)+ if isinstance(value, dict):+ return {clean(key): clean(item) for key, item in value.items()}+ if isinstance(value, list):+ return [clean(item) for item in value]+ return value++ return clean(payload)++def _bind(kwargs: dict[str, Any], targets: dict[str, str]) -> dict[str, Any]:def sub(value: Any) -> Any:if isinstance(value, str):@@ -147,6 +197,11 @@ async def main() -> int:"--skeletons",help="write each tool's nested key shape here, for the shed-path fixture",)+ parser.add_argument(+ "--responses",+ help="write each budgeted payload here, redacted, for the "+ "token-calibration fixture",+ )options = parser.parse_args()os.environ.setdefault("REPOWISE_TELEMETRY_DISABLED", "1")@@ -170,6 +225,7 @@ async def main() -> int:rows: list[dict[str, Any]] = []skeletons: dict[str, Any] = {}+ responses: dict[str, Any] = {}async with _server._lifespan(None):ready = getattr(_state, "_vector_store_ready", None)if ready is not None:@@ -193,6 +249,8 @@ async def main() -> int:row[f"{label}_trace"] = traceback.format_exc()[-1200:]continuerow[f"{label}_chars"] = _size(payload)+ if label == "wrapped" and isinstance(payload, dict):+ responses[f"{tool}:{case}"] = payloadif label == "raw" and isinstance(payload, dict):if "error" in payload:row["unexercised"] = payload["error"]@@ -224,6 +282,15 @@ async def main() -> int:if options.skeletons:with open(options.skeletons, "w", encoding="utf-8") as handle:json.dump(skeletons, handle, indent=2, sort_keys=True)+ if options.responses:+ with open(options.responses, "w", encoding="utf-8") as handle:+ json.dump(+ _redact(responses, options.repo),+ handle,+ separators=(",", ":"),+ sort_keys=True,+ default=str,+ )return 0diff --git a/tests/fixtures/mcp/token_calibration_responses.json b/tests/fixtures/mcp/token_calibration_responses.jsonnew file mode 100644index 000000000..55737a810--- /dev/null+++ b/tests/fixtures/mcp/token_calibration_responses.json@@ -0,0 +1 @@+{"get_answer:how-question":{"_meta":{"cached":true,"completeness":{"capped":true,"reason":"confidence_projection_and_deduplication","shown":1,"total":15},"contract_version":1,"embedder_degraded":false,"index_age_days":0,"indexed_commit":"920d1c973d64","projection":{"recovery":{"arguments":{"include":["evidence"],"question":"How does index the repository work?"},"tool":"get_answer"}},"response_budget":{"limit_chars":24000,"serialized_chars":4391,"tier":"default"},"scope_hint":"Unrelated to what was served: Contributor 11 (1,478 files), Contributor 2 (641), Contributor 6 (261).","timing_ms":11.19},"answer":"## What \u201cindexing\u201d means here\n\nThe retrieved code describes the **read side of an already-created repository index**, rather than the process that parses a repository from scratch. Ingestion writes each repository\u2019s `.repowise/wiki.db`; `RepoIndex` opens that database and exposes convenient lookup APIs over its contents (`packages/core/src/repowise/core/workspace/repo_index.py`).\n\n## Opening an index\n\nFor one repository, callers use:\n\n```python\nawait open_repo_index(alias, repo_path) -> RepoIndex | None\n```\n\n`open_repo_index` opens the repository\u2019s `wiki.db` read side and returns `None` when the repository has not been indexed (`packages/core/src/repowise/core/workspace/repo_index.py`).\n\nFor a workspace, `open_workspace_index(...)` opens the indexed repositories and returns a `WorkspaceIndex`. The workspace object maps repository aliases to `RepoIndex` instances; callers retrieve one with `get(alias)`. Repositories that fail to open are skipped, and an optional alias filter can restrict which repositories are opened.\n\nEach `RepoIndex` owns one database session/connection. The implementation stores:\n\n- the repository alias, path, and `repo_id`;\n- an in-memory index by file (`_by_file`);\n- an in-memory index by symbol name (`_by_name`);\n- external-import records (`_externals`).\n\nIts `_load` method queries `WikiSymbol` rows and graph-edge data from the database. After loading, accessors are pure in-memory reads, so worker-thread dialects can call them without issuing additional database queries. The `repo_id` is required so repository-scoped queries cannot accidentally return unrelated rows.\n\n## Lookup capabilities\n\nThe exposed API supports:\n\n- `symbols_for_file(rel_path)` \u2014 symbols declared in a POSIX, repo-relative file, outermost first;\n- `symbol_at(rel_path, line)` \u2014 symbol covering a line;\n- `declared_symbol_at(...)` \u2014 declaration-specific lookup;\n- `symbol_named(expression)` \u2014 resolve qualified or unqualified symbol expressions;\n- access to external imports and the underlying session.\n\nThe index stores source locations from ingestion. Those spans can become stale if files change afterward, so callers extracting source must bound or validate spans against the current content; `extractors.from_index` provides the related safety behavior. The connection is closed explicitly through `RepoIndex.close()` or `WorkspaceIndex.close()`.","candidates_emitted":0,"candidates_reduced_reason":"confidence_projection_and_deduplication","candidates_total":5,"citations":["packages/core/src/repowise/core/workspace/repo_index.py"],"confidence":"high","fallback_targets_emitted":0,"fallback_targets_reduced_reason":"confidence_projection_and_deduplication","fallback_targets_total":5,"flow_path":["packages/core/src/repowise/core/persistence/crud/repository.py -> packages/core/src/repowise/core/workspace/repo_index.py","packages/server/src/repowise/server/schemas/repository.py -> packages/core/src/repowise/core/ingestion/languages/specs/json.py -> packages/core/src/repowise/core/persistence/crud/repository.py"],"next_action_hint":"Use the answer and citations directly.","note":"High confidence: the top retrieval result clearly dominates, by 0.83 points over the runner-up (top score 5.27). Both scores are strong, so the gap is the measure here and not the ratio. Cite this answer; do not re-read the source unless a specific detail is missing.","quotes":[{"lines":[79,81],"path":"packages/core/src/repowise/core/workspace/repo_index.py","quote":"class RepoIndex:\n \"\"\"Read-only accessor over one repo's ``wiki.db``.\n"}],"quotes_emitted":1,"quotes_reduced_reason":"confidence_projection_and_deduplication","quotes_total":5,"retrieval_quality":"high"},"get_architecture:default":{"_meta":{"completeness":{"capped":false},"contract_version":1,"embedder_degraded":false,"evidence_kind":"structural","response_budget":{"limit_chars":24000,"serialized_chars":295,"tier":"default"},"runtime_breakage_proven":false},"error":"get_architecture is only available in workspace mode."},"get_blast_radius:one-target":{"_meta":{"completeness":{"capped":false},"contract_version":1,"embedder_degraded":false,"evidence_kind":"structural","response_budget":{"limit_chars":24000,"serialized_chars":295,"tier":"default"},"runtime_breakage_proven":false},"error":"get_blast_radius is only available in workspace mode."},"get_change_risk:head":{"_meta":{"completeness":{"capped":false},"contract_version":1,"embedder_degraded":false,"index_age_days":0,"indexed_commit":"920d1c973d64","omitted":{"refs":["repowise#fede8a95b801"],"restore":"Run `repowise expand <ref>` from the repo, or call get_symbol(\"repowise#<ref>\", query=...) to retrieve the omitted content.","tokens":275},"response_budget":{"limit_chars":24000,"serialized_chars":6116,"tier":"default"},"source":"live_git","state":{"truncated":true},"timing_ms":1412.0},"branch_overlap":{"base":"origin/main","branches":[{"ahead":2,"behind":2,"branch":"perf/mcp-startup-floor","files":[{"basis":"same file","file":"packages/cli/src/repowise/cli/editor_integrations/claude_config.py"},{"basis":"same file","file":"packages/core/src/repowise/core/workspace/__init__.py"},{"basis":"same file","file":"packages/cli/src/repowise/cli/commands/mcp_cmd.py"},{"basis":"same file","file":"tests/unit/workspace/test_lazy_workspace_exports.py"}],"last_commit":"2026-09-09"},{"ahead":12,"behind":2,"branch":"origin/feat/index-freshness-hook","files":[{"basis":"same file","file":"packages/cli/src/repowise/cli/commands/mcp_cmd.py"},{"basis":"co-change pair, 3 of 6 commits","file":"packages/server/src/repowise/server/mcp_server/_meta.py","partner":"packages/core/src/repowise/core/workspace/__init__.py"}],"last_commit":"2026-09-09"}],"current":"fix/mcp-budget-accounting","scanned":50,"summary":"2 of 50 open branches (1068 exist) edit files this change also edits.","total":1068,"truncated":true},"change_shape":{"classification":"Typical","diagnostics_via":"get_change_risk(include=['diagnostics'])","fallback_band":null,"independent_changes":{"basis":"no import, call, type reference or co-change pair in the index links one group to another","count":3,"groups":[{"bridging_files":[],"files":["packages/cli/src/repowise/cli/commands/mcp_cmd.py"]},{"bridging_files":[],"files":["packages/cli/src/repowise/cli/editor_integrations/claude_config.py"]},{"bridging_files":[],"files":["packages/core/src/repowise/core/workspace/__init__.py"]}],"summary":"This diff is 3 independent changes: 1 file, 1 file and 1 file. 1 changed file is left out of the grouping: docs, config, tests, files not in the index, or files it has never linked.","ungrouped_files":["tests/unit/workspace/test_lazy_workspace_exports.py"]},"is_fix":false,"measures":"diff size and spread, not danger","review_priority":"moderate","risk_percentile":40.9,"score":8.2},"classification":"Typical","directive":{"headline":"No supported new findings surfaced in the analyzed scope.","next_actions":["Run: tests/unit/workspace/test_lazy_workspace_exports.py tests/unit/cli/test_agent_target_baseline.py tests/unit/cli/test_agent_targets.py"],"reasons":[],"status":"clear_in_analyzed_scope"},"exclude_patterns":[],"fallback_band":null,"fix_history":{"available":true,"density":0.768,"files":[{"churn":9,"fix_pressure":4.35,"path":"packages/cli/src/repowise/cli/editor_integrations/claude_config.py"},{"churn":5,"fix_pressure":1.94,"path":"packages/cli/src/repowise/cli/commands/mcp_cmd.py"},{"churn":226,"fix_pressure":0.88,"path":"packages/core/src/repowise/core/workspace/__init__.py"}],"percentile":21.2},"health_delta":{"analyzer":{"analyzer_version":10,"performance_model_version":2,"rules_fingerprint":"3e9c9fe763b725f9bb1d493656de4afd4ee75e189f42c98e96b0e4233630fe47"},"base":{"kind":"commit","ref":"HEAD^","sha":"7791e6401fa9da72b285bd224a6cf3257121e3da"},"basis":"both_sides_analyzed","by_dimension":{},"by_severity":{},"explanation":"No supported new findings surfaced in the analyzed scope.","findings_emitted":0,"findings_total":0,"head":{"kind":"commit","ref":"HEAD","sha":"920d1c973d647a5df41165225dae38b514b03ae1"},"introduced":0,"limits":["Both sides are analysed over the changed files only, so cross-file detectors (duplication, cross-function performance) see no wider context."],"resolved":1,"scope":{"analyzed":4,"changed":4,"eligible":4,"failed":0,"skipped":0},"status":"available","top_findings":[],"worsened":0},"impacted_tests":{"basis":"inferred","line_coverage":{"covered":[],"no_coverage_data":[],"stale_test_candidates":[],"untested_changes":[]},"map_present":false,"status":"inferred","summary":"29 test file(s) reach the changed files in the graph; showing first 10. Inferred from the dependency graph, not measured. For the line-precise answer build the map with `coverage run --contexts=test` then `repowise coverage add`.","tests_to_run":["tests/unit/workspace/test_lazy_workspace_exports.py","tests/unit/cli/test_agent_target_baseline.py","tests/unit/cli/test_agent_targets.py","tests/unit/cli/test_commands.py","tests/unit/cli/test_doctor_embed_recipe.py","tests/unit/cli/test_doctor_fts_drift.py","tests/unit/cli/test_doctor_honours_exclusions.py","tests/unit/cli/test_doctor_information_floor.py","tests/unit/cli/test_doctor_mcp_smoke.py","tests/unit/cli/test_doctor_page_cap.py"],"total":29,"truncated":true},"is_fix":false,"omission_marker":"[repowise#fede8a95b801: 25 lines omitted (~275 tokens); restore: repowise expand fede8a95b801]","prior_fixes":{"changed_lines_in_fixed_files":98,"concentration":"packages/core/src/repowise/core/workspace/__init__.py carries 50% of the changed lines and 1 past bug fix(es).","files":[{"changed_lines":4,"file_path":"packages/cli/src/repowise/cli/editor_integrations/claude_config.py","fix_count":5,"last_fix_days_ago":32,"overlapping_lines":0,"share_of_change":0.022},{"changed_lines":4,"file_path":"packages/cli/src/repowise/cli/commands/mcp_cmd.py","fix_count":2,"last_fix_days_ago":3,"overlapping_lines":0,"share_of_change":0.022},{"changed_lines":90,"file_path":"packages/core/src/repowise/core/workspace/__init__.py","fix_count":1,"last_fix_days_ago":68,"overlapping_lines":0,"share_of_change":0.5}],"files_with_fixes":3,"line_overlap":"approximate","summary":"8 past bug-fix commit(s) touched 3 of the changed file(s). Line overlap is approximate (past ranges are numbered on their own parent commit); the per-file counts are not.","total_fixes":8,"truncated":false},"ref":"HEAD","review_priority":"moderate","risk_percentile":40.9,"score":8.2,"working_tree":false},"get_conformance:default":{"_meta":{"completeness":{"capped":false},"contract_version":1,"embedder_degraded":false,"evidence_kind":"structural","response_budget":{"limit_chars":24000,"serialized_chars":294,"tier":"default"},"runtime_breakage_proven":false},"error":"get_conformance is only available in workspace mode."},"get_context:many-targets":{"_meta":{"completeness":{"capped":true},"contract_version":1,"embedder_degraded":false,"index_age_days":0,"indexed_commit":"920d1c973d64","omitted":{"refs":["repowise#6c9c3e123777"],"restore":"Run `repowise expand <ref>` from the repo, or call get_symbol(\"repowise#<ref>\", query=...) to retrieve the omitted content.","tokens":4507},"replaced_tokens":48638,"response_budget":{"limit_chars":32000,"serialized_chars":14278,"tier":"expanded"},"scope_hint":"Unrelated to what was served: Contributor 11 (1,478 files), Contributor 2 (641), Contributor 6 (261).","state":{"truncated":true},"timing_ms":62.24,"tokens_saved":45004},"dropped_symbols":{},"dropped_targets":[],"targets":{"packages/cli/src/repowise/cli/commands/update_cmd/command.py":{"_call_graph_note":"File-level rollup: importing files plus inbound cross-file call counts. For symbol-precise callers pass 'file.py::Symbol'.","architectural_layer":{"description":"Contains the command-line application runtime, command definitions, platform clients, agent targets, helpers, and telemetry handling.","name":"Contributor 15","role":"edge_connector"},"callers":[{"file":"tests/integration/test_cli.py","imports":true,"inbound_calls":2},{"file":"tests/unit/cli/test_update_reindex_notice.py","imports":true,"inbound_calls":2},{"file":"tests/unit/cli/test_update_renderer_gate.py","imports":true,"inbound_calls":2},{"file":"packages/cli/src/repowise/cli/commands/init_cmd/command.py","imports":true,"inbound_calls":1},{"file":"packages/cli/src/repowise/cli/commands/update_cmd/persistence.py","imports":true,"inbound_calls":1},{"file":"packages/cli/src/repowise/cli/commands/update_cmd/workspace.py","imports":true,"inbound_calls":1},{"file":"packages/cli/src/repowise/cli/commands/watch_cmd.py","imports":true,"inbound_calls":1},{"file":"tests/unit/cli/test_update_full_dry_run.py","imports":true,"inbound_calls":1},{"file":"packages/cli/src/repowise/cli/commands/update_cmd/__init__.py","imports":true},{"file":"tests/unit/cli/test_docs_pointer.py","imports":true},{"file":"tests/unit/cli/test_editor_setup.py","imports":true},{"file":"tests/unit/cli/test_update_up_to_date_lock.py","imports":true},{"file":"tests/unit/cli/test_workspace_docs_pointer.py","imports":true}],"docs":{"summary":"`repowise update` \u2014 incremental wiki regeneration for changed files.","title":"File: packages/cli/src/repowise/cli/commands/update_cmd/command.py"},"episodes":26,"fix_history":{"bug_magnet":true,"fix_count":27,"last_fix_days_ago":1},"freshness":{"confidence_score":1.0,"freshness_status":"stale","is_stale":true},"hotspot":true,"parent_page":{"section":"14.2.2","target_path":"packages/cli/src/repowise/cli/commands/health_cmd","title":"Code Health Commands"},"path":"packages/cli/src/repowise/cli/commands/update_cmd/command.py","skeleton":{"bodies_kept":["run_update","_current_renderer_fingerprint","_renderer_inputs","_surface_reindex_recommendation","_docs_provider_prompt_allowed"],"full_tokens":23489,"mode":"smart","pct_of_full":8.9,"text":"\"\"\"``repowise update`` \u2014 incremental wiki regeneration for changed files.\n\nThis module holds the Click command + single-repo orchestration. The standalone\nhelpers it relies on live in sibling modules: mode resolution (:mod:`.mode`),\ncore delegators (:mod:`.incremental`), persistence + re-score\n(:mod:`.persistence`), the workspace flow (:mod:`.workspace`), and report\nrendering (:mod:`.reporting`).\n\"\"\"\nfrom __future__ import annotations\nimport sys\nimport time\nfrom enum import StrEnum\nfrom pathlib import Path\nfrom typing import Any\nimport click\nimport structlog\nfrom repowise.cli._setup import configure_cli_logging\nfrom repowise.cli.helpers import (\n ... 19 lines (23-41)\nfrom repowise.core.docs_mode import docs_mode_state_fields, resolve_docs_mode\nfrom repowise.core.pipeline import PhaseTimings, timed\nfrom repowise.core.reasoning import REASONING_MODES\nfrom .incremental import (\n ... 8 lines (47-54)\nfrom .mode import _resolve_index_only_mode\nfrom .persistence import (\n ... 6 lines (57-62)\nfrom .reporting import (\n ... 7 lines (64-70)\nfrom .workspace import _workspace_update\nlog = structlog.get_logger(__name__)\n... 6 lines (74-79)\n_EFFICACY_LOOKBACK_SECONDS = 7 * 86400.0\n\n\ndef _docs_provider_prompt_allowed(emitter: Any) -> bool:\n \"\"\"Whether a docs run may block on an interactive provider prompt.\n\n Requires a real terminal on *both* ends: a terminal stdout (so the table\n renders) and a tty stdin (so the answer can actually be read). The stdin\n check is what keeps a background post-commit hook or CI run from hanging\n even when it inherits a ``FORCE_COLOR`` that makes ``console.is_terminal``\n report True. ``--progress json`` (emitter set) is always non-interactive.\n \"\"\"\n return console.is_terminal and sys.stdin.isatty() and emitter is None\n\n\ndef _record_update_outcome(\n *,\n index_only: bool,\n changed_count: int,\n provider: Any = None,\n generated_pages: list | None = None,\n docs_mode: str | None = None,\n) -> None:\n \"\"\"Attach an anonymous update-shape outcome to the ``command_run`` event.\n... 30 lines (104-133)\n\n\ndef _refresh_editor_stamp(\n repo_path: Any, agents_md: bool | None, degraded: list[str] | None = None\n) -> None:\n \"\"\"Re-stamp managed editor files (CLAUDE.md / AGENTS.md), best-effort.\n... 21 lines (140-160)\n\n\ndef _surface_release_news(*, written_by: str | None) -> None:\n \"\"\"Show a post-upgrade \"what's new\" panel and a cached PyPI advisory.\n... 23 lines (165-187)\n\n\ndef _surface_reindex_recommendation(repo_path, verdict, *, emitter: Any, dry_run: bool) -> None:\n \"\"\"Show the once-per-store reindex recommendation for *verdict*, if any.\n\n Read-only except for the shown-notice ledger, so it is safe to call on the\n no-op (\"already up to date\") path as well as the main assessment path. It\n never runs the verdict's auto actions \u2014 those stay behind the single-flight\n lock in the main path. Interactive-terminal only, so a background post-commit\n update never burns the one-shot into a log the user never reads; `doctor`\n reports the recommendation on demand regardless.\n \"\"\"\n from repowise.cli.upgrade import (\n record_reindex_notice_shown,\n reindex_notice_already_shown,\n )\n\n if not (verdict.reindex_recommended and verdict.reindex_command):\n return\n ... 139 lines (207-345)\ndef update_command(\n ... 49 lines (347-395)\n\n\nclass UpdateOutcome(StrEnum):\n \"\"\"What a single-repo :func:`run_update` actually did.\n... 11 lines (400-410)\n\n\ndef _render_full_upgrade_dry_run(\n repo_path: Path,\n *,\n provider_name: str | None,\n model: str | None,\n) -> None:\n \"\"\"Describe a full upgrade without resolving providers or touching the store.\"\"\"\n ... 20 lines (420-439)\n\n\ndef _renderer_inputs(repo_path):\n \"\"\"The (language, style fingerprint, style template dir) a file page uses.\n\n Read from the persisted config so the fingerprint computed at the \"up to\n date\" gate matches the one the pages actually store. A wrong triple here\n would make every page look stale on every run (or none ever), so all three\n come from the same place generation reads them. The template dir is a\n custom style's own ``templates/`` (``None`` for a built-in style), tried\n ahead of the shipped template exactly as the generator's Jinja loader does.\n \"\"\"\n from repowise.cli.helpers import load_config\n from repowise.core.generation.styles import resolve_style\n\n cfg = load_config(repo_path)\n style = resolve_style(cfg.get(\"wiki_style\", \"comprehensive\"), repo_path=repo_path)\n return cfg.get(\"language\", \"en\"), style.fingerprint, style.template_dir\n\n\ndef _head_commit_ts(repo_path) -> float | None:\n \"\"\"Committer timestamp of the repo's HEAD, or None when git is unavailable.\n... 9 lines (462-470)\n\n\ndef _current_renderer_fingerprint(repo_path) -> str:\n \"\"\"This release's fingerprint for the structural renderers, or '' on failure.\n\n Covers every template with no model path behind it, because this value is\n what decides whether a repository with no new commits is \"already up to\n date\". Fingerprinting only the file page meant a release that improved the\n spotlight template alone returned before doing anything, and the change\n never reached an existing wiki.\n\n Cheap: reads the templates and a few constants, no parse. An empty result\n disables the renderer-staleness gate for this run rather than risking a\n spurious full re-render, which is the safe direction.\n \"\"\"\n try:\n from repowise.core.generation.page_generator.structural import (\n FILE_PAGE_TEMPLATE,\n SYMBOL_SPOTLIGHT_TEMPLATE,\n structural_fingerprint,\n )\n\n language, style_fp, template_dir = _renderer_inputs(repo_path)\n return \":\".join(\n structural_fingerprint(\n template,\n language=language,\n style_fingerprint=style_fp,\n template_dir=template_dir,\n ... 6 lines (500-505)\n\n\ndef _stale_renderer_paths(repo_path, parsed_files) -> list[str]:\n \"\"\"File paths whose stored pages predate the current structural renderers.\n... 37 lines (510-546)\n\n\ndef run_update(\n path: str | None,\n provider_name: str | None,\n model: str | None,\n since: str | None,\n reasoning: str | None,\n cascade_budget: int | None,\n dry_run: bool,\n workspace: bool,\n no_workspace: bool,\n repo_alias: str | None,\n index_only: bool = False,\n docs_flag: bool | None = None,\n full: bool = False,\n yes: bool = False,\n agents_md: bool | None = None,\n concurrency: int = 10,\n no_cost_tracking: bool = False,\n verbose: bool = False,\n progress: str = \"rich\",\n skip_cross_repo_hooks: bool = False,\n include_working_tree: bool = False,\n) -> UpdateOutcome:\n \"\"\"Incrementally update wiki pages for files changed since last sync.\n\n If `since` is None, the base commit is read from state.json's last_sync_commit.\n\n ``skip_cross_repo_hooks`` is set only by the workspace docs flow, which\n calls this per repo and then runs the cross-repo hooks once over every\n updated repo instead of once per repo.\n\n ``include_working_tree`` folds uncommitted work (staged, unstaged and\n untracked) into the change set on top of the commit range. Off by default,\n because every other caller is anchored to a commit \u2014 the post-commit hook,\n a webhook, a manual sync \u2014 and indexing a half-finished edit under those is\n not what the user asked for. ``repowise watch`` sets it: watching for file\n saves and then only ever diffing commit-to-commit is what made the watcher\n a no-op until you committed.\n \"\"\"\n start = time.monotonic()\n # Per-stage wall clock for this run, written to ``state.json`` as\n # ``phase_timings`` by the paths that rebuild the index. ``run`` is the\n # denominator; stages nest and overlap, so compare each against it and\n # never against their sum. The fast paths (already up to date, no changed\n # files, config-only re-score) do not record: they do no stage work and\n # would overwrite the last real run's numbers with nothing.\n timings = PhaseTimings()\n timings.start(\"run\")\n\n # --- Machine-readable progress (--progress json) --------------------\n # Silence structlog/stdlib logging and redirect the shared Rich console\n ... 1530 lines (600-2129)\n","tokens":2095,"verified":true},"target":"packages/cli/src/repowise/cli/commands/update_cmd/command.py","type":"file"},"packages/core/src/repowise/core/ingestion/call_resolver.py":{"_call_graph_note":"File-level rollup: importing files plus inbound cross-file call counts. For symbol-precise callers pass 'file.py::Symbol'.","architectural_layer":{"description":"Implements repository ingestion, language parsing, code analysis, health evaluation, domain modeling, and supporting application utilities across the codebase.","name":"Contributor 4","role":"edge_connector"},"callers":[{"file":"tests/unit/ingestion/test_return_type_chain_resolution.py","imports":true,"inbound_calls":20},{"file":"tests/unit/ingestion/test_bare_name_index_kinds.py","imports":true,"inbound_calls":4},{"file":"tests/unit/ingestion/test_call_resolver_strategies.py","imports":true,"inbound_calls":3},{"file":"packages/core/src/repowise/core/ingestion/graph/_resolvers.py","imports":true,"inbound_calls":2},{"file":"tests/unit/ingestion/test_elixir_bare_name_scope.py","imports":true,"inbound_calls":2},{"file":"tests/unit/ingestion/test_enclosing_class_calls.py","imports":true,"inbound_calls":2},{"file":"tests/unit/ingestion/test_jvm_calls.py","imports":true,"inbound_calls":2},{"file":"tests/unit/ingestion/test_overload_set_uniqueness.py","imports":true,"inbound_calls":2},{"file":"tests/unit/ingestion/test_php_luau_receivers.py","imports":true,"inbound_calls":2},{"file":"tests/unit/ingestion/test_resolver_merged_index.py","imports":true,"inbound_calls":2},{"file":"tests/unit/ingestion/test_self_call_resolution.py","imports":true,"inbound_calls":2}],"docs":{"summary":"Three-tier call resolution engine for the symbol-level dependency graph.","title":"File: packages/core/src/repowise/core/ingestion/call_resolver.py"},"episodes":21,"fix_history":{"bug_magnet":true,"fix_count":22,"last_fix_days_ago":10},"freshness":{"confidence_score":1.0,"freshness_status":"stale","is_stale":true},"hotspot":true,"parent_page":{"section":"17.4","target_path":"packages/core/src/repowise/core/ingestion","title":"Ingestion Overview"},"path":"packages/core/src/repowise/core/ingestion/call_resolver.py","skeleton":{"bodies_kept":[],"full_tokens":25149,"mode":"smart","omitted":true,"pct_of_full":17.9,"text":"[repowise#6c9c3e123777: 508 lines omitted (~4507 tokens); restore: repowise expand 6c9c3e123777]","tokens":4507,"verified":true},"target":"packages/core/src/repowise/core/ingestion/call_resolver.py","type":"file"}},"truncated":true},"get_context:one-file":{"_meta":{"completeness":{"capped":false},"contract_version":1,"embedder_degraded":false,"index_age_days":0,"indexed_commit":"920d1c973d64","response_budget":{"limit_chars":24000,"serialized_chars":11328,"tier":"default"},"scope_hint":"Unrelated to what was served: Contributor 11 (1,478 files), Contributor 2 (641), Contributor 6 (261).","timing_ms":22.87},"targets":{"packages/core/src/repowise/core/ingestion/call_resolver.py":{"architectural_layer":{"description":"Implements repository ingestion, language parsing, code analysis, health evaluation, domain modeling, and supporting application utilities across the codebase.","name":"Contributor 4","role":"edge_connector"},"docs":{"summary":"Three-tier call resolution engine for the symbol-level dependency graph.","symbols":[{"kind":"variable","line":64,"name":"log","signature":"log = structlog.get_logger(__name__)","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::log"},{"kind":"constant","line":69,"name":"_IMPLICIT_RECEIVER_LANGUAGES","signature":"_IMPLICIT_RECEIVER_LANGUAGES = frozenset({\"java\", \"csharp\", \"cpp\", \"kotlin\"})","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::_IMPLICIT_RECEIVER_LANGUAGES"},{"kind":"constant","line":87,"name":"_INHERITED_LANGUAGES","signature":"_INHERITED_LANGUAGES = frozenset({\"kotlin\", \"python\", \"typescript\", \"swift\", \"csharp\"})","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::_INHERITED_LANGUAGES"},{"kind":"constant","line":103,"name":"_MAX_ANCESTOR_EXPAND_DEPTH","signature":"_MAX_ANCESTOR_EXPAND_DEPTH = 3","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::_MAX_ANCESTOR_EXPAND_DEPTH"},{"kind":"class","line":107,"name":"_LanguageCallStrategies","signature":"class _LanguageCallStrategies","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::_LanguageCallStrategies"},{"kind":"constant","line":122,"name":"_NO_LANGUAGE_STRATEGIES","signature":"_NO_LANGUAGE_STRATEGIES = _LanguageCallStrategies()","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::_NO_LANGUAGE_STRATEGIES"},{"kind":"constant","line":124,"name":"_TYPED_RECEIVER","signature":"_TYPED_RECEIVER = (\"_resolve_typed_receiver\",)","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::_TYPED_RECEIVER"},{"kind":"constant","line":129,"name":"_TYPE_KINDS","signature":"_TYPE_KINDS = frozenset({\"class\", \"struct\", \"interface\", \"enum\", \"trait\", \"impl\"})","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::_TYPE_KINDS"},{"kind":"constant","line":130,"name":"_FUNCTION_KINDS","signature":"_FUNCTION_KINDS = frozenset({\"function\", \"method\"})","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::_FUNCTION_KINDS"},{"kind":"constant","line":148,"name":"_NON_CALLABLE_KINDS","signature":"_NON_CALLABLE_KINDS = frozenset({\"property\"})","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::_NON_CALLABLE_KINDS"},{"kind":"constant","line":163,"name":"_JVM_STRATEGIES","signature":"_JVM_STRATEGIES = _LanguageCallStrategies(","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::_JVM_STRATEGIES"},{"kind":"constant","line":173,"name":"_CPP_STRATEGIES","signature":"_CPP_STRATEGIES = _LanguageCallStrategies(","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::_CPP_STRATEGIES"},{"kind":"constant","line":180,"name":"_LANGUAGE_CALL_STRATEGIES","signature":"_LANGUAGE_CALL_STRATEGIES: dict[str, _LanguageCallStrategies] = {","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::_LANGUAGE_CALL_STRATEGIES"},{"kind":"constant","line":212,"name":"_SOURCE_CACHE_FILES","signature":"_SOURCE_CACHE_FILES = 4","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::_SOURCE_CACHE_FILES"},{"kind":"constant","line":213,"name":"_BODY_TYPE_CACHE_ENTRIES","signature":"_BODY_TYPE_CACHE_ENTRIES = 2048","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::_BODY_TYPE_CACHE_ENTRIES"},{"kind":"constant","line":217,"name":"PRODUCTION_RETURN_TYPE_CHAIN_LANGUAGES","signature":"PRODUCTION_RETURN_TYPE_CHAIN_LANGUAGES: frozenset[str] = frozenset({\"cpp\"})","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::PRODUCTION_RETURN_TYPE_CHAIN_LANGUAGES"},{"kind":"class","line":221,"name":"ResolvedCall","signature":"class ResolvedCall","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::ResolvedCall"},{"kind":"class","line":247,"name":"CallResolver","signature":"class CallResolver","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver"},{"kind":"method","line":260,"name":"__init__","signature":"def __init__( self, parsed_files: dict[str, ParsedFile], import_targets: dict[str, set[str]], *, repo_path: str | None = None, import_maps: Any | None = None, heritage_parents: dict[str, set[str]] | None = None, return_type_chain_languages: frozenset[str] | None = None, ) -> None","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver::__init__"},{"kind":"method","line":409,"name":"_follow_barrel_exports","signature":"def _follow_barrel_exports(self) -> None","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver::_follow_barrel_exports"},{"kind":"method","line":511,"name":"_get_rust_crate_src","signature":"def _get_rust_crate_src(self) -> dict[str, str]","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver::_get_rust_crate_src"},{"kind":"method","line":533,"name":"_get_go_index","signature":"def _get_go_index(self) -> Any","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver::_get_go_index"},{"kind":"method","line":562,"name":"_strategies_for","signature":"def _strategies_for(self, file_path: str) -> _LanguageCallStrategies","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver::_strategies_for"},{"kind":"method","line":568,"name":"_get_cpp_index","signature":"def _get_cpp_index(self) -> Any","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver::_get_cpp_index"},{"kind":"method","line":640,"name":"_resolve_cpp_same_target","signature":"def _resolve_cpp_same_target( self, file_path: str, call: CallSite, caller_id: str, ) -> ResolvedCall | None","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver::_resolve_cpp_same_target"},{"kind":"method","line":663,"name":"_get_jvm_index","signature":"def _get_jvm_index(self) -> Any","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver::_get_jvm_index"},{"kind":"method","line":684,"name":"_resolve_jvm_same_package","signature":"def _resolve_jvm_same_package( self, file_path: str, call: CallSite, caller_id: str, ) -> ResolvedCall | None","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver::_resolve_jvm_same_package"},{"kind":"method","line":744,"name":"_resolve_jvm_receiver_same_package","signature":"def _resolve_jvm_receiver_same_package( self, file_path: str, call: CallSite, caller_id: str, ) -> ResolvedCall | None","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver::_resolve_jvm_receiver_same_package"},{"kind":"method","line":767,"name":"_resolve_go_package_call","signature":"def _resolve_go_package_call( self, file_path: str, call: CallSite, caller_id: str, ) -> ResolvedCall | None","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver::_resolve_go_package_call"},{"kind":"method","line":796,"name":"_resolve_go_same_package","signature":"def _resolve_go_same_package( self, file_path: str, call: CallSite, caller_id: str, ) -> ResolvedCall | None","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver::_resolve_go_same_package"},{"kind":"method","line":824,"name":"_build_indices","signature":"def _build_indices(self, parsed_files: dict[str, ParsedFile]) -> None","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver::_build_indices"},{"kind":"method","line":879,"name":"_link_declarations","signature":"def _link_declarations( self, declarations: list[tuple[str, str, tuple[str | None, str]]], definitions: dict[tuple[str | None, str], list[tuple[str, str]]], ) -> dict[str, str]","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver::_link_declarations"},{"kind":"method","line":930,"name":"declaration_definitions","signature":"def declaration_definitions(self) -> dict[str, str]","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver::declaration_definitions"},{"kind":"method","line":939,"name":"_redirect_to_definition","signature":"def _redirect_to_definition(self, resolved: ResolvedCall) -> ResolvedCall","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver::_redirect_to_definition"},{"kind":"method","line":961,"name":"_published","signature":"def _published(self, file_path: str, name: str) -> str | None","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver::_published"},{"kind":"method","line":978,"name":"_merged_symbols_for","signature":"def _merged_symbols_for(self, file_path: str) -> dict[str, str]","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver::_merged_symbols_for"},{"kind":"method","line":1017,"name":"_merged_methods_for","signature":"def _merged_methods_for(self, file_path: str) -> dict[tuple[str, str], str]","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver::_merged_methods_for"},{"kind":"method","line":1030,"name":"resolve_file","signature":"def resolve_file(self, file_path: str, calls: list[CallSite]) -> list[ResolvedCall]","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver::resolve_file"},{"kind":"method","line":1052,"name":"_resolve_one","signature":"def _resolve_one(self, file_path: str, call: CallSite) -> ResolvedCall | None","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver::_resolve_one"},{"kind":"method","line":1083,"name":"_resolve_return_typed_chain","signature":"def _resolve_return_typed_chain( self, file_path: str, call: CallSite, caller_id: str, language: str, ) -> tuple[bool, ResolvedCall | None]","symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver::_resolve_return_typed_chain"}],"symbols_truncated":{"hint":"Call with compact=False or include=['full_doc'] for the full list.","shown":40,"total":89},"title":"File: packages/core/src/repowise/core/ingestion/call_resolver.py"},"episodes":21,"fix_history":{"bug_magnet":true,"fix_count":22,"last_fix_days_ago":10},"freshness":{"confidence_score":1.0,"freshness_status":"stale","is_stale":true},"hotspot":true,"parent_page":{"section":"17.4","target_path":"packages/core/src/repowise/core/ingestion","title":"Ingestion Overview"},"path":"packages/core/src/repowise/core/ingestion/call_resolver.py","target":"packages/core/src/repowise/core/ingestion/call_resolver.py","type":"file"}}},"get_dead_code:default":{"_meta":{"completeness":{"capped":false},"contract_version":1,"embedder_degraded":false,"index_age_days":0,"indexed_commit":"920d1c973d64","omitted":{"refs":["repowise#b20f4f25756c"],"restore":"Run `repowise expand <ref>` from the repo, or call get_symbol(\"repowise#<ref>\", query=...) to retrieve the omitted content.","tokens":4031},"response_budget":{"limit_chars":24000,"serialized_chars":13223,"tier":"default"},"state":{"truncated":true}},"impact":{"recommendation":"Start with the 'high' tier \u2014 these have no references in the graph and are the strongest cleanup candidates. Confirm each (runtime-loaded config/bootstrap/database files are flagged but never auto-marked safe), then review 'medium' tier with your team.","safe_lines_reclaimable":0,"total_lines_reclaimable":2013},"omission_marker":"[repowise#b20f4f25756c: 35 lines omitted (~4031 tokens); restore: repowise expand b20f4f25756c]","summary":{"by_kind":{"unreachable_file":25,"unused_export":27,"unused_internal":508},"call_resolution_basis":[{"guessed_share":0.0,"language":"javascript","note":"Call sites the resolver could not bind are not counted, so an empty list means no resolved edge reaches this symbol, not proof that nothing calls it.","resolved_call_edges":2,"unresolved_call_sites":null},{"guessed_share":0.03,"language":"python","note":"Call sites the resolver could not bind are not counted, so an empty list means no resolved edge reaches this symbol, not proof that nothing calls it.","resolved_call_edges":49295,"unresolved_call_sites":null},{"guessed_share":0.04,"language":"typescript","note":"Call sites the resolver could not bind are not counted, so an empty list means no resolved edge reaches this symbol, not proof that nothing calls it.","resolved_call_edges":5364,"unresolved_call_sites":null}],"deletable_lines":0,"filtered_findings":52,"safe_to_delete_count":1,"total_findings":560},"tiers":{"high":{"count":1,"description":"High confidence (>=0.8): No references found in the codebase. Strong cleanup candidates \u2014 review (especially runtime-loaded files) before deleting.","findings":[{"age_days":100,"commit_count_90d":0,"confidence":0.8,"end_line":null,"file_path":"packages/core/src/repowise/core/analysis/decision_gate.py","id":"finding_a6c9a04ac7c39bae9231","kind":"unreachable_file","last_commit_at":"2026-05-27T10:27:47","last_meaningful_change":"2026-05-27T10:27:47+00:00","lines":0,"primary_owner":"Contributor 19","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":[],"safe_to_delete":true,"start_line":null,"symbol_kind":null,"symbol_name":null}],"lines":0,"safe_count":1,"truncated":false},"low":{"count":51,"description":"Low confidence (<0.5): Potentially used via dynamic imports or reflection. Investigate first.","findings":[{"age_days":22,"commit_count_90d":1,"confidence":0.4,"end_line":null,"file_path":"scripts/gen_readme_hero.py","id":"finding_0f040cd55166f823bccf","kind":"unreachable_file","last_commit_at":"2026-08-12T15:52:24","last_meaningful_change":"2026-08-12T15:52:24+00:00","lines":350,"primary_owner":"Contributor 19","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":["script"],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null},{"age_days":22,"commit_count_90d":1,"confidence":0.4,"end_line":null,"file_path":"scripts/gen_plugin_content.py","id":"finding_29369eff6365a1b0293f","kind":"unreachable_file","last_commit_at":"2026-08-12T14:19:38","last_meaningful_change":"2026-08-12T14:19:38+00:00","lines":190,"primary_owner":"Contributor 19","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":["script"],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null},{"age_days":22,"commit_count_90d":5,"confidence":0.4,"end_line":null,"file_path":"scripts/gen_agent_matrix.py","id":"finding_4e063ba4bc6f9980ff00","kind":"unreachable_file","last_commit_at":"2026-08-24T11:59:28","last_meaningful_change":"2026-08-24T11:59:28+00:00","lines":180,"primary_owner":"Contributor 19","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":["script"],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null},{"age_days":18,"commit_count_90d":4,"confidence":0.4,"end_line":352,"file_path":"packages/server/src/repowise/server/mcp_server/_graph_utils.py","id":"finding_7866e0a83040cdca646e","kind":"unused_export","last_commit_at":"2026-09-04T06:25:06","last_meaningful_change":"2026-09-04T06:25:06+00:00","lines":138,"primary_owner":"Contributor 19","reason":"Public symbol 'build_visual_context' has no importers","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":214,"symbol_kind":"function","symbol_name":"build_visual_context"},{"age_days":4,"commit_count_90d":1,"confidence":0.4,"end_line":null,"file_path":"scripts/generate_http_types.py","id":"finding_c1cedf34ddebe7d261cb","kind":"unreachable_file","last_commit_at":"2026-08-31T03:51:20","last_meaningful_change":"2026-08-31T03:51:20+00:00","lines":130,"primary_owner":"Contributor 19","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":["script"],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null},{"age_days":87,"commit_count_90d":1,"confidence":0.4,"end_line":null,"file_path":"packages/ui/scripts/contrast-check.py","id":"finding_1b9b8063b93def0ff331","kind":"unreachable_file","last_commit_at":"2026-06-08T15:01:45","last_meaningful_change":"2026-06-08T15:01:45+00:00","lines":120,"primary_owner":"Contributor 22","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":["script"],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null},{"age_days":21,"commit_count_90d":1,"confidence":0.4,"end_line":null,"file_path":"packages/cli/src/repowise/cli/commands/uninstall_cmd.py","id":"finding_4d056697ef3263430455","kind":"unreachable_file","last_commit_at":"2026-08-13T06:48:25","last_meaningful_change":"2026-08-13T06:48:25+00:00","lines":100,"primary_owner":"Contributor 19","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null},{"age_days":13,"commit_count_90d":4,"confidence":0.4,"end_line":117,"file_path":"packages/server/src/repowise/server/mcp_server/tool_refactoring.py","id":"finding_4368b4710bdc7ab05fcc","kind":"unused_export","last_commit_at":"2026-08-28T17:33:56","last_meaningful_change":"2026-08-28T17:33:56+00:00","lines":86,"primary_owner":"Contributor 19","reason":"Public symbol 'generate_refactoring_code' has no importers","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":31,"symbol_kind":"function","symbol_name":"generate_refactoring_code"},{"age_days":109,"commit_count_90d":1,"confidence":0.4,"end_line":null,"file_path":"packages/web/src/lib/hooks/use-c4-context.ts","id":"finding_3393e63b818004f15f8d","kind":"unreachable_file","last_commit_at":"2026-07-27T11:24:34","last_meaningful_change":"2026-07-27T11:24:34+00:00","lines":70,"primary_owner":"Contributor 19","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null},{"age_days":3,"commit_count_90d":1,"confidence":0.4,"end_line":null,"file_path":"scripts/measure_mcp_response_sizes.py","id":"finding_16a533bd7dba51d593b6","kind":"unreachable_file","last_commit_at":"2026-08-31T09:13:01","last_meaningful_change":"2026-08-31T09:13:01+00:00","lines":70,"primary_owner":"Contributor 19","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":["script"],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null},{"age_days":10,"commit_count_90d":2,"confidence":0.4,"end_line":100,"file_path":"packages/server/src/repowise/server/mcp_server/tool_architecture.py","id":"finding_63e9ee35b2c0edb37176","kind":"unused_export","last_commit_at":"2026-08-28T17:33:56","last_meaningful_change":"2026-08-28T17:33:56+00:00","lines":68,"primary_owner":"Contributor 19","reason":"Public symbol 'get_architecture' has no importers","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":32,"symbol_kind":"function","symbol_name":"get_architecture"},{"age_days":73,"commit_count_90d":1,"confidence":0.4,"end_line":null,"file_path":"packages/cli/src/repowise/cli/commands/telemetry_cmd.py","id":"finding_f6e27d31e8b93df85fd9","kind":"unreachable_file","last_commit_at":"2026-06-22T11:35:27","last_meaningful_change":"2026-06-22T11:35:27+00:00","lines":50,"primary_owner":"Contributor 19","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null},{"age_days":24,"commit_count_90d":2,"confidence":0.4,"end_line":null,"file_path":"packages/cli/src/repowise/cli/ui/result_panels.py","id":"finding_2f1914812c29533dd062","kind":"unreachable_file","last_commit_at":"2026-08-14T17:16:16","last_meaningful_change":"2026-08-14T17:16:16+00:00","lines":50,"primary_owner":"Contributor 22","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null},{"age_days":63,"commit_count_90d":5,"confidence":0.4,"end_line":null,"file_path":"packages/vscode/src/extension.ts","id":"finding_e900c8cb8978cb1bd8ee","kind":"unreachable_file","last_commit_at":"2026-07-04T17:35:07","last_meaningful_change":"2026-07-04T17:35:07+00:00","lines":40,"primary_owner":"Contributor 19","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null},{"age_days":102,"commit_count_90d":0,"confidence":0.4,"end_line":null,"file_path":"scripts/benchmark_upgrade.py","id":"finding_2a035f9742fa48fd2731","kind":"unreachable_file","last_commit_at":"2026-05-24T06:00:26","last_meaningful_change":"2026-05-24T06:00:26+00:00","lines":40,"primary_owner":"Contributor 19","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":["script"],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null},{"age_days":10,"commit_count_90d":3,"confidence":0.4,"end_line":103,"file_path":"packages/server/src/repowise/server/mcp_server/tool_repos.py","id":"finding_9849407bdffedca12fbb","kind":"unused_export","last_commit_at":"2026-08-28T17:33:56","last_meaningful_change":"2026-08-28T17:33:56+00:00","lines":35,"primary_owner":"joptimus","reason":"Public symbol 'list_repos' has no importers","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":68,"symbol_kind":"function","symbol_name":"list_repos"},{"age_days":10,"commit_count_90d":3,"confidence":0.4,"end_line":null,"file_path":"packages/server/src/repowise/server/mcp_server/tool_repos.py","id":"finding_237d674ac8ed2dae134d","kind":"unreachable_file","last_commit_at":"2026-08-28T17:33:56","last_meaningful_change":"2026-08-28T17:33:56+00:00","lines":30,"primary_owner":"joptimus","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null},{"age_days":109,"commit_count_90d":1,"confidence":0.4,"end_line":57,"file_path":"packages/web/src/lib/hooks/use-c4-context.ts","id":"finding_fda1711f7fc7dbcba35e","kind":"unused_export","last_commit_at":"2026-07-27T11:24:34","last_meaningful_change":"2026-07-27T11:24:34+00:00","lines":22,"primary_owner":"Contributor 19","reason":"Public symbol 'useC4DocsPathSet' has no importers","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":35,"symbol_kind":"function","symbol_name":"useC4DocsPathSet"},{"age_days":109,"commit_count_90d":1,"confidence":0.4,"end_line":87,"file_path":"packages/web/src/lib/hooks/use-c4-context.ts","id":"finding_f0e29b2242ddf3a75783","kind":"unused_export","last_commit_at":"2026-07-27T11:24:34","last_meaningful_change":"2026-07-27T11:24:34+00:00","lines":22,"primary_owner":"Contributor 19","reason":"Public symbol 'useC4SelectionContext' has no importers","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":65,"symbol_kind":"function","symbol_name":"useC4SelectionContext"},{"age_days":10,"commit_count_90d":2,"confidence":0.4,"end_line":null,"file_path":"packages/server/src/repowise/server/mcp_server/tool_architecture.py","id":"finding_de52d15beb2b3cbcbf97","kind":"unreachable_file","last_commit_at":"2026-08-28T17:33:56","last_meaningful_change":"2026-08-28T17:33:56+00:00","lines":20,"primary_owner":"Contributor 19","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null}],"lines":2013,"safe_count":0,"truncated":true},"medium":{"count":0,"description":"Medium confidence (0.5-0.8): Likely unused but may have indirect references. Review before deleting.","findings":[],"lines":0,"safe_count":0,"truncated":false}}},"get_dead_code:limit-200":{"_meta":{"completeness":{"capped":true,"reason":"response_budget","shown":36,"total":50},"contract_version":1,"embedder_degraded":false,"index_age_days":0,"indexed_commit":"920d1c973d64","omitted":{"refs":["repowise#1ee5d92d3242","repowise#31ab8534db9e"],"restore":"Run `repowise expand <ref>` from the repo, or call get_symbol(\"repowise#<ref>\", query=...) to retrieve the omitted content.","tokens":69631},"reductions":[],"response_budget":{"limit_chars":24000,"serialized_chars":22533,"tier":"default"},"state":{"truncated":true}},"limit_note":"Requested limit=200 exceeded the MCP transport budget and was clamped to 25. Use tier/directory/owner filters or paginate to see more findings.","omission_marker":"[repowise#31ab8534db9e: 299 lines omitted (~2233 tokens); restore: repowise expand 31ab8534db9e]","summary":{"by_kind":{"unreachable_file":25,"unused_export":27,"unused_internal":508},"call_resolution_basis":[{"guessed_share":0.0,"language":"javascript","note":"Call sites the resolver could not bind are not counted, so an empty list means no resolved edge reaches this symbol, not proof that nothing calls it.","resolved_call_edges":2,"unresolved_call_sites":null},{"guessed_share":0.03,"language":"python","note":"Call sites the resolver could not bind are not counted, so an empty list means no resolved edge reaches this symbol, not proof that nothing calls it.","resolved_call_edges":49295,"unresolved_call_sites":null},{"guessed_share":0.04,"language":"typescript","note":"Call sites the resolver could not bind are not counted, so an empty list means no resolved edge reaches this symbol, not proof that nothing calls it.","resolved_call_edges":5364,"unresolved_call_sites":null}],"deletable_lines":0,"filtered_findings":560,"safe_to_delete_count":1,"total_findings":560},"tiers":{"high":{"count":1,"description":"High confidence (>=0.8): No references found in the codebase. Strong cleanup candidates \u2014 review (especially runtime-loaded files) before deleting.","findings":[{"age_days":100,"commit_count_90d":0,"confidence":0.8,"end_line":null,"file_path":"packages/core/src/repowise/core/analysis/decision_gate.py","id":"finding_a6c9a04ac7c39bae9231","kind":"unreachable_file","last_commit_at":"2026-05-27T10:27:47","last_meaningful_change":"2026-05-27T10:27:47+00:00","lines":0,"primary_owner":"Contributor 19","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":[],"safe_to_delete":true,"start_line":null,"symbol_kind":null,"symbol_name":null}],"lines":0,"safe_count":1,"truncated":false},"low":{"count":51,"description":"Low confidence (<0.5): Potentially used via dynamic imports or reflection. Investigate first.","findings":[{"age_days":22,"commit_count_90d":1,"confidence":0.4,"end_line":null,"file_path":"scripts/gen_readme_hero.py","id":"finding_0f040cd55166f823bccf","kind":"unreachable_file","last_commit_at":"2026-08-12T15:52:24","last_meaningful_change":"2026-08-12T15:52:24+00:00","lines":350,"primary_owner":"Contributor 19","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":["script"],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null},{"age_days":22,"commit_count_90d":1,"confidence":0.4,"end_line":null,"file_path":"scripts/gen_plugin_content.py","id":"finding_29369eff6365a1b0293f","kind":"unreachable_file","last_commit_at":"2026-08-12T14:19:38","last_meaningful_change":"2026-08-12T14:19:38+00:00","lines":190,"primary_owner":"Contributor 19","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":["script"],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null},{"age_days":22,"commit_count_90d":5,"confidence":0.4,"end_line":null,"file_path":"scripts/gen_agent_matrix.py","id":"finding_4e063ba4bc6f9980ff00","kind":"unreachable_file","last_commit_at":"2026-08-24T11:59:28","last_meaningful_change":"2026-08-24T11:59:28+00:00","lines":180,"primary_owner":"Contributor 19","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":["script"],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null},{"age_days":18,"commit_count_90d":4,"confidence":0.4,"end_line":352,"file_path":"packages/server/src/repowise/server/mcp_server/_graph_utils.py","id":"finding_7866e0a83040cdca646e","kind":"unused_export","last_commit_at":"2026-09-04T06:25:06","last_meaningful_change":"2026-09-04T06:25:06+00:00","lines":138,"primary_owner":"Contributor 19","reason":"Public symbol 'build_visual_context' has no importers","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":214,"symbol_kind":"function","symbol_name":"build_visual_context"},{"age_days":4,"commit_count_90d":1,"confidence":0.4,"end_line":null,"file_path":"scripts/generate_http_types.py","id":"finding_c1cedf34ddebe7d261cb","kind":"unreachable_file","last_commit_at":"2026-08-31T03:51:20","last_meaningful_change":"2026-08-31T03:51:20+00:00","lines":130,"primary_owner":"Contributor 19","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":["script"],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null},{"age_days":87,"commit_count_90d":1,"confidence":0.4,"end_line":null,"file_path":"packages/ui/scripts/contrast-check.py","id":"finding_1b9b8063b93def0ff331","kind":"unreachable_file","last_commit_at":"2026-06-08T15:01:45","last_meaningful_change":"2026-06-08T15:01:45+00:00","lines":120,"primary_owner":"Contributor 22","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":["script"],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null},{"age_days":21,"commit_count_90d":1,"confidence":0.4,"end_line":null,"file_path":"packages/cli/src/repowise/cli/commands/uninstall_cmd.py","id":"finding_4d056697ef3263430455","kind":"unreachable_file","last_commit_at":"2026-08-13T06:48:25","last_meaningful_change":"2026-08-13T06:48:25+00:00","lines":100,"primary_owner":"Contributor 19","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null},{"age_days":13,"commit_count_90d":4,"confidence":0.4,"end_line":117,"file_path":"packages/server/src/repowise/server/mcp_server/tool_refactoring.py","id":"finding_4368b4710bdc7ab05fcc","kind":"unused_export","last_commit_at":"2026-08-28T17:33:56","last_meaningful_change":"2026-08-28T17:33:56+00:00","lines":86,"primary_owner":"Contributor 19","reason":"Public symbol 'generate_refactoring_code' has no importers","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":31,"symbol_kind":"function","symbol_name":"generate_refactoring_code"},{"age_days":109,"commit_count_90d":1,"confidence":0.4,"end_line":null,"file_path":"packages/web/src/lib/hooks/use-c4-context.ts","id":"finding_3393e63b818004f15f8d","kind":"unreachable_file","last_commit_at":"2026-07-27T11:24:34","last_meaningful_change":"2026-07-27T11:24:34+00:00","lines":70,"primary_owner":"Contributor 19","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null},{"age_days":3,"commit_count_90d":1,"confidence":0.4,"end_line":null,"file_path":"scripts/measure_mcp_response_sizes.py","id":"finding_16a533bd7dba51d593b6","kind":"unreachable_file","last_commit_at":"2026-08-31T09:13:01","last_meaningful_change":"2026-08-31T09:13:01+00:00","lines":70,"primary_owner":"Contributor 19","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":["script"],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null},{"age_days":10,"commit_count_90d":2,"confidence":0.4,"end_line":100,"file_path":"packages/server/src/repowise/server/mcp_server/tool_architecture.py","id":"finding_63e9ee35b2c0edb37176","kind":"unused_export","last_commit_at":"2026-08-28T17:33:56","last_meaningful_change":"2026-08-28T17:33:56+00:00","lines":68,"primary_owner":"Contributor 19","reason":"Public symbol 'get_architecture' has no importers","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":32,"symbol_kind":"function","symbol_name":"get_architecture"},{"age_days":73,"commit_count_90d":1,"confidence":0.4,"end_line":null,"file_path":"packages/cli/src/repowise/cli/commands/telemetry_cmd.py","id":"finding_f6e27d31e8b93df85fd9","kind":"unreachable_file","last_commit_at":"2026-06-22T11:35:27","last_meaningful_change":"2026-06-22T11:35:27+00:00","lines":50,"primary_owner":"Contributor 19","reason":"File has no importers (in_degree=0)","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":null,"symbol_kind":null,"symbol_name":null}],"findings_emitted":12,"findings_omitted":13,"findings_reduced_reason":"response_budget","findings_total":25,"findings_truncated":true,"lines":2013,"safe_count":0,"truncated":true},"medium":{"count":508,"description":"Medium confidence (0.5-0.8): Likely unused but may have indirect references. Review before deleting.","findings":[{"age_days":19,"commit_count_90d":1,"confidence":0.65,"end_line":224,"file_path":"packages/vscode/webview/src/views/settings/App.tsx","id":"finding_b075fd8305a7974411b7","kind":"unused_internal","last_commit_at":"2026-08-15T04:52:49","last_meaningful_change":"2026-08-15T04:52:49+00:00","lines":175,"primary_owner":"Contributor 19","reason":"Private symbol 'GROUPS' is not used anywhere","repository":"default","risk_factors":["config"],"safe_to_delete":false,"start_line":49,"symbol_kind":"constant","symbol_name":"GROUPS"},{"age_days":21,"commit_count_90d":4,"confidence":0.65,"end_line":638,"file_path":"packages/core/src/repowise/core/generation/onboarding/subkinds/key_concepts.py","id":"finding_be86c5b82740d8059283","kind":"unused_internal","last_commit_at":"2026-08-17T08:07:51","last_meaningful_change":"2026-08-17T08:07:51+00:00","lines":159,"primary_owner":"Contributor 19","reason":"Private symbol '_build' is not used anywhere","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":479,"symbol_kind":"function","symbol_name":"_build"},{"age_days":101,"commit_count_90d":2,"confidence":0.65,"end_line":173,"file_path":"packages/ui/src/c4/nodes/LayerClusterNode.tsx","id":"finding_c6ddde3060cf14ca3310","kind":"unused_internal","last_commit_at":"2026-06-23T10:24:32","last_meaningful_change":"2026-06-23T10:24:32+00:00","lines":147,"primary_owner":"Contributor 22","reason":"Private symbol 'LayerClusterNodeImpl' is not used anywhere","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":26,"symbol_kind":"function","symbol_name":"LayerClusterNodeImpl"},{"age_days":22,"commit_count_90d":3,"confidence":0.65,"end_line":589,"file_path":"packages/core/src/repowise/core/ingestion/sfc_source.py","id":"finding_27b06007ec3b456791b8","kind":"unused_internal","last_commit_at":"2026-09-04T18:23:23","last_meaningful_change":"2026-09-04T18:23:23+00:00","lines":144,"primary_owner":"Contributor 19","reason":"Private symbol '_razor_byte_scan' is not used anywhere","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":445,"symbol_kind":"function","symbol_name":"_razor_byte_scan"},{"age_days":101,"commit_count_90d":1,"confidence":0.65,"end_line":148,"file_path":"packages/ui/src/c4/nodes/ArchFileNode.tsx","id":"finding_7897e8b0e5b192dc04f3","kind":"unused_internal","last_commit_at":"2026-06-06T13:25:45","last_meaningful_change":"2026-06-06T13:25:45+00:00","lines":125,"primary_owner":"Contributor 22","reason":"Private symbol 'ArchFileNodeImpl' is not used anywhere","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":23,"symbol_kind":"function","symbol_name":"ArchFileNodeImpl"},{"age_days":22,"commit_count_90d":3,"confidence":0.65,"end_line":484,"file_path":"packages/core/src/repowise/core/persistence/database.py","id":"finding_f8da2bf875ed65e153ee","kind":"unused_internal","last_commit_at":"2026-09-05T13:30:40","last_meaningful_change":"2026-09-05T13:30:40+00:00","lines":118,"primary_owner":"Contributor 19","reason":"Private symbol '_reconcile_schema' is not used anywhere","repository":"default","risk_factors":["database"],"safe_to_delete":false,"start_line":366,"symbol_kind":"function","symbol_name":"_reconcile_schema"},{"age_days":18,"commit_count_90d":4,"confidence":0.65,"end_line":508,"file_path":"packages/core/src/repowise/core/ingestion/type_ref_resolution.py","id":"finding_97db30e3d8a29e1f728f","kind":"unused_internal","last_commit_at":"2026-08-22T16:05:26","last_meaningful_change":"2026-08-22T16:05:26+00:00","lines":96,"primary_owner":"Contributor 19","reason":"Private symbol '_resolve_c_type_refs' is not used anywhere","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":412,"symbol_kind":"function","symbol_name":"_resolve_c_type_refs"},{"age_days":101,"commit_count_90d":2,"confidence":0.65,"end_line":115,"file_path":"packages/ui/src/c4/nodes/ArchContainerNode.tsx","id":"finding_4cf23634a04a6a87e7f8","kind":"unused_internal","last_commit_at":"2026-06-23T10:24:32","last_meaningful_change":"2026-06-23T10:24:32+00:00","lines":95,"primary_owner":"Contributor 22","reason":"Private symbol 'ArchContainerNodeImpl' is not used anywhere","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":20,"symbol_kind":"function","symbol_name":"ArchContainerNodeImpl"},{"age_days":18,"commit_count_90d":4,"confidence":0.65,"end_line":638,"file_path":"packages/core/src/repowise/core/ingestion/type_ref_resolution.py","id":"finding_3494eba7bab882eb59ec","kind":"unused_internal","last_commit_at":"2026-08-22T16:05:26","last_meaningful_change":"2026-08-22T16:05:26+00:00","lines":91,"primary_owner":"Contributor 19","reason":"Private symbol '_resolve_ts_type_refs' is not used anywhere","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":547,"symbol_kind":"function","symbol_name":"_resolve_ts_type_refs"},{"age_days":19,"commit_count_90d":1,"confidence":0.65,"end_line":151,"file_path":"packages/core/src/repowise/core/generation/onboarding/subkinds/active_landscape.py","id":"finding_de7b2aff5fc207d79981","kind":"unused_internal","last_commit_at":"2026-08-15T09:40:34","last_meaningful_change":"2026-08-15T09:40:34+00:00","lines":87,"primary_owner":"Contributor 19","reason":"Private symbol '_build' is not used anywhere","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":64,"symbol_kind":"function","symbol_name":"_build"},{"age_days":101,"commit_count_90d":1,"confidence":0.65,"end_line":142,"file_path":"packages/ui/src/graph-primitives/edge-renderer.tsx","id":"finding_eade40e87507df4bdae7","kind":"unused_internal","last_commit_at":"2026-06-06T13:25:45","last_meaningful_change":"2026-06-06T13:25:45+00:00","lines":87,"primary_owner":"Contributor 22","reason":"Private symbol 'ArchEdgeRendererImpl' is not used anywhere","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":55,"symbol_kind":"function","symbol_name":"ArchEdgeRendererImpl"},{"age_days":22,"commit_count_90d":11,"confidence":0.65,"end_line":1208,"file_path":"packages/core/src/repowise/core/ingestion/parser_helpers.py","id":"finding_798475db14d41278d3f8","kind":"unused_internal","last_commit_at":"2026-09-04T18:23:23","last_meaningful_change":"2026-09-04T18:23:23+00:00","lines":86,"primary_owner":"Contributor 19","reason":"Private symbol '_ts_head_type_identifier' is not used anywhere","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":1122,"symbol_kind":"function","symbol_name":"_ts_head_type_identifier"},{"age_days":18,"commit_count_90d":4,"confidence":0.65,"end_line":366,"file_path":"packages/core/src/repowise/core/ingestion/type_ref_resolution.py","id":"finding_0320a6bd2eeb4c7b9686","kind":"unused_internal","last_commit_at":"2026-08-22T16:05:26","last_meaningful_change":"2026-08-22T16:05:26+00:00","lines":83,"primary_owner":"Contributor 19","reason":"Private symbol '_resolve_go_type_refs' is not used anywhere","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":283,"symbol_kind":"function","symbol_name":"_resolve_go_type_refs"},{"age_days":76,"commit_count_90d":1,"confidence":0.65,"end_line":94,"file_path":"packages/ui/src/workspace/system-map/system-map-edge.tsx","id":"finding_cde5d1605847ffe10cd1","kind":"unused_internal","last_commit_at":"2026-06-19T07:53:16","last_meaningful_change":"2026-06-19T07:53:16+00:00","lines":74,"primary_owner":"Contributor 19","reason":"Private symbol 'SystemMapEdgeInner' is not used anywhere","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":20,"symbol_kind":"function","symbol_name":"SystemMapEdgeInner"},{"age_days":161,"commit_count_90d":1,"confidence":0.65,"end_line":213,"file_path":"packages/core/src/repowise/core/ingestion/special_handlers.py","id":"finding_a72b31224fbeb674507a","kind":"unused_internal","last_commit_at":"2026-07-04T11:15:25","last_meaningful_change":"2026-07-04T11:15:25+00:00","lines":72,"primary_owner":"Contributor 19","reason":"Private symbol '_parse_dockerfile' is not used anywhere","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":141,"symbol_kind":"function","symbol_name":"_parse_dockerfile"},{"age_days":109,"commit_count_90d":2,"confidence":0.65,"end_line":90,"file_path":"packages/ui/src/c4/edges/RelationEdge.tsx","id":"finding_d11a1aeaa4becb88db2c","kind":"unused_internal","last_commit_at":"2026-06-23T10:24:32","last_meaningful_change":"2026-06-23T10:24:32+00:00","lines":72,"primary_owner":"Contributor 19","reason":"Private symbol 'RelationEdgeImpl' is not used anywhere","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":18,"symbol_kind":"function","symbol_name":"RelationEdgeImpl"},{"age_days":9,"commit_count_90d":4,"confidence":0.65,"end_line":831,"file_path":"packages/server/src/repowise/server/job_executor.py","id":"finding_ea3a8bb0f7e7024be0d4","kind":"unused_internal","last_commit_at":"2026-09-07T11:41:26","last_meaningful_change":"2026-09-07T11:41:26+00:00","lines":71,"primary_owner":"Contributor 19","reason":"Private symbol '_persist_initial_index_state' is not used anywhere","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":760,"symbol_kind":"function","symbol_name":"_persist_initial_index_state"},{"age_days":161,"commit_count_90d":1,"confidence":0.65,"end_line":125,"file_path":"packages/core/src/repowise/core/ingestion/special_handlers.py","id":"finding_4c6222d665b3595e0493","kind":"unused_internal","last_commit_at":"2026-07-04T11:15:25","last_meaningful_change":"2026-07-04T11:15:25+00:00","lines":70,"primary_owner":"Contributor 19","reason":"Private symbol '_parse_openapi' is not used anywhere","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":55,"symbol_kind":"function","symbol_name":"_parse_openapi"},{"age_days":18,"commit_count_90d":4,"confidence":0.65,"end_line":741,"file_path":"packages/core/src/repowise/core/ingestion/type_ref_resolution.py","id":"finding_60313f5eee105a75790e","kind":"unused_internal","last_commit_at":"2026-08-22T16:05:26","last_meaningful_change":"2026-08-22T16:05:26+00:00","lines":68,"primary_owner":"Contributor 19","reason":"Private symbol '_resolve_jvm_type_refs' is not used anywhere","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":673,"symbol_kind":"function","symbol_name":"_resolve_jvm_type_refs"},{"age_days":20,"commit_count_90d":3,"confidence":0.65,"end_line":112,"file_path":"packages/core/src/repowise/core/ingestion/graph_warmups.py","id":"finding_56627b474c7331f636f9","kind":"unused_internal","last_commit_at":"2026-09-04T13:27:00","last_meaningful_change":"2026-09-04T13:27:00+00:00","lines":62,"primary_owner":"Contributor 19","reason":"Private symbol '_warmup_jvm' is not used anywhere","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":50,"symbol_kind":"function","symbol_name":"_warmup_jvm"},{"age_days":22,"commit_count_90d":11,"confidence":0.65,"end_line":1060,"file_path":"packages/core/src/repowise/core/ingestion/parser_helpers.py","id":"finding_f2ff92755f90a64d9b11","kind":"unused_internal","last_commit_at":"2026-09-04T18:23:23","last_meaningful_change":"2026-09-04T18:23:23+00:00","lines":62,"primary_owner":"Contributor 19","reason":"Private symbol '_go_head_type_identifier' is not used anywhere","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":998,"symbol_kind":"function","symbol_name":"_go_head_type_identifier"},{"age_days":22,"commit_count_90d":11,"confidence":0.65,"end_line":1276,"file_path":"packages/core/src/repowise/core/ingestion/parser_helpers.py","id":"finding_391c43bb421d142b8094","kind":"unused_internal","last_commit_at":"2026-09-04T18:23:23","last_meaningful_change":"2026-09-04T18:23:23+00:00","lines":61,"primary_owner":"Contributor 19","reason":"Private symbol '_java_head_type_identifier' is not used anywhere","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":1215,"symbol_kind":"function","symbol_name":"_java_head_type_identifier"},{"age_days":161,"commit_count_90d":1,"confidence":0.65,"end_line":285,"file_path":"packages/core/src/repowise/core/ingestion/special_handlers.py","id":"finding_f3d3afff206d3be963cf","kind":"unused_internal","last_commit_at":"2026-07-04T11:15:25","last_meaningful_change":"2026-07-04T11:15:25+00:00","lines":59,"primary_owner":"Contributor 19","reason":"Private symbol '_parse_makefile' is not used anywhere","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":226,"symbol_kind":"function","symbol_name":"_parse_makefile"},{"age_days":20,"commit_count_90d":3,"confidence":0.65,"end_line":173,"file_path":"packages/core/src/repowise/core/ingestion/graph_warmups.py","id":"finding_d645a649dd73cd608107","kind":"unused_internal","last_commit_at":"2026-09-04T13:27:00","last_meaningful_change":"2026-09-04T13:27:00+00:00","lines":58,"primary_owner":"Contributor 19","reason":"Private symbol '_warmup_cpp' is not used anywhere","repository":"default","risk_factors":[],"safe_to_delete":false,"start_line":115,"symbol_kind":"function","symbol_name":"_warmup_cpp"}],"findings_emitted":24,"findings_omitted":1,"findings_reduced_reason":"response_budget","findings_total":25,"findings_truncated":true,"lines":5444,"safe_count":0,"truncated":true}},"truncated":true},"get_dependency_path:two-files":{"_meta":{"completeness":{"capped":false},"contract_version":1,"evidence_kind":"structural","response_budget":{"limit_chars":24000,"serialized_chars":2005,"tier":"default"},"runtime_breakage_proven":false},"distance":-1,"explanation":"No direct dependency path found","path":[],"visual_context":{"bridge_suggestions":[{"node":"external:typing","pagerank":0.02358},{"node":"external:dataclasses","pagerank":0.02038},{"node":"tests/conftest.py","pagerank":0.02011},{"node":"external:pathlib","pagerank":0.01869},{"node":"external:collections.abc","pagerank":0.01618}],"community":{"same_community":false,"source_community":3,"target_community":2},"disconnected":false,"nearest_common_ancestors":[{"distance_from_source":1,"distance_from_target":1,"node":"external:typing"},{"distance_from_source":1,"distance_from_target":1,"node":"external:structlog"},{"distance_from_source":1,"distance_from_target":1,"node":"external:pathlib"},{"distance_from_source":2,"distance_from_target":1,"node":"packages/core/src/repowise/core/docs_mode.py"},{"distance_from_source":2,"distance_from_target":1,"node":"packages/cli/src/repowise/cli/commands/upgrade_flow.py"}],"reverse_path":{"distance":5,"exists":true,"note":"A path exists in the reverse direction (packages/cli/src/repowise/cli/commands/update_cmd/command.py -> packages/core/src/repowise/core/ingestion/call_resolver.py). The dependency flows the other way.","path":["packages/cli/src/repowise/cli/commands/update_cmd/command.py","packages/core/src/repowise/core/ingestion/__init__.py","packages/core/src/repowise/core/ingestion/graph/__init__.py","packages/core/src/repowise/core/ingestion/graph/builder.py","packages/core/src/repowise/core/ingestion/graph/_resolvers.py","packages/core/src/repowise/core/ingestion/call_resolver.py"]},"shared_neighbors":["external:pathlib","external:structlog","external:typing"],"suggestion":"No direct path, but both nodes connect through 'external:typing'. This shared dependency may be the architectural bridge point."}},"get_execution_flows:default":{"_meta":{"completeness":{"capped":false},"contract_version":1,"embedder_degraded":false,"evidence_kind":"structural","hint":"Use get_context(include=['callers','callees']) on any trace node for detail.","index_age_days":0,"indexed_commit":"920d1c973d64","replaced_tokens":2160,"response_budget":{"limit_chars":24000,"serialized_chars":4969,"tier":"default"},"runtime_breakage_proven":false,"timing_ms":1155.0,"tokens_saved":870},"flows":[{"communities_visited":[0],"crosses_community":false,"depth":4,"entry_point":"packages/vscode/webview/src/views/graph/App.tsx::App","entry_point_name":"App","entry_point_score":0.95,"termination":"no_callees","trace":["packages/vscode/webview/src/views/graph/App.tsx::App","packages/vscode/webview/src/views/graph/App.tsx::CommunityPanel","packages/ui/src/graph/graph-community-panel.tsx::GraphCommunityPanel","packages/ui/src/graph/graph-community-panel.tsx::FactGrid","packages/ui/src/graph/graph-community-panel.tsx::FactValue"],"trace_via":["same_file","import_scoped","same_file","same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/core/src/repowise/core/generation/page_generator/orchestrate.py::_GenerationRun::execute","entry_point_name":"execute","entry_point_score":0.928,"termination":"no_callees","trace":["packages/core/src/repowise/core/generation/page_generator/orchestrate.py::_GenerationRun::execute","packages/core/src/repowise/core/generation/page_generator/orchestrate.py::_GenerationRun::_announce_total","packages/core/src/repowise/core/generation/page_generator/orchestrate.py::_announce_paid"],"trace_via":["self_scope","same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/server/src/repowise/server/routers/git.py::get_risk_range","entry_point_name":"get_risk_range","entry_point_score":0.843,"termination":"no_callees","trace":["packages/server/src/repowise/server/routers/git.py::get_risk_range","packages/server/src/repowise/server/routers/git.py::_revision_exists"],"trace_via":["same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/ui/src/dashboard/health-overview-card.tsx::HealthOverviewCard","entry_point_name":"HealthOverviewCard","entry_point_score":0.838,"termination":"no_callees","trace":["packages/ui/src/dashboard/health-overview-card.tsx::HealthOverviewCard","packages/ui/src/dashboard/health-overview-card.tsx::AccuracyStrip"],"trace_via":["same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/server/src/repowise/server/routers/costs.py::get_distill_savings","entry_point_name":"get_distill_savings","entry_point_score":0.831,"termination":"no_callees","trace":["packages/server/src/repowise/server/routers/costs.py::get_distill_savings","packages/server/src/repowise/server/routers/costs.py::_parse_since"],"trace_via":["same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/ui/src/git/ownership-table.tsx::OwnershipTable","entry_point_name":"OwnershipTable","entry_point_score":0.83,"termination":"no_callees","trace":["packages/ui/src/git/ownership-table.tsx::OwnershipTable","packages/ui/src/lib/cn.ts::cn"],"trace_via":["import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/ui/src/dashboard/decisions-timeline.tsx::DecisionsTimeline","entry_point_name":"DecisionsTimeline","entry_point_score":0.826,"termination":"no_callees","trace":["packages/ui/src/dashboard/decisions-timeline.tsx::DecisionsTimeline","packages/ui/src/lib/format.ts::formatRelativeTime","packages/ui/src/lib/format.ts::parseDate"],"trace_via":["import_scoped","same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/ui/src/dashboard/hotspots-mini.tsx::HotspotsMini","entry_point_name":"HotspotsMini","entry_point_score":0.826,"termination":"no_callees","trace":["packages/ui/src/dashboard/hotspots-mini.tsx::HotspotsMini","packages/ui/src/dashboard/hotspots-mini.tsx::getChurnColor"],"trace_via":["same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/ui/src/dashboard/module-minimap.tsx::ModuleMinimap","entry_point_name":"ModuleMinimap","entry_point_score":0.826,"termination":"no_callees","trace":["packages/ui/src/dashboard/module-minimap.tsx::ModuleMinimap","packages/ui/src/ui/card.tsx::Card","packages/ui/src/lib/cn.ts::cn"],"trace_via":["import_scoped","import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/ui/src/dashboard/ownership-treemap.tsx::OwnershipTreemap","entry_point_name":"OwnershipTreemap","entry_point_score":0.826,"termination":"no_callees","trace":["packages/ui/src/dashboard/ownership-treemap.tsx::OwnershipTreemap","packages/ui/src/ui/card.tsx::Card","packages/ui/src/lib/cn.ts::cn"],"trace_via":["import_scoped","import_scoped"]}],"total_entry_points":10},"get_execution_flows:top-100-depth-20":{"_meta":{"completeness":{"capped":true,"reason":"response_budget","shown":45,"total":50},"contract_version":1,"embedder_degraded":false,"evidence_kind":"structural","hint":"Use get_context(include=['callers','callees']) on any trace node for detail.","index_age_days":0,"indexed_commit":"920d1c973d64","omitted":{"refs":["repowise#54b10477a47c","repowise#94e97218a71a"],"restore":"Run `repowise expand <ref>` from the repo, or call get_symbol(\"repowise#<ref>\", query=...) to retrieve the omitted content.","tokens":761},"replaced_tokens":6000,"response_budget":{"limit_chars":24000,"serialized_chars":22639,"tier":"default"},"runtime_breakage_proven":false,"state":{"truncated":true},"timing_ms":1286.0,"tokens_saved":102},"flows":[{"communities_visited":[0],"crosses_community":false,"depth":4,"entry_point":"packages/vscode/webview/src/views/graph/App.tsx::App","entry_point_name":"App","entry_point_score":0.95,"termination":"no_callees","trace":["packages/vscode/webview/src/views/graph/App.tsx::App","packages/vscode/webview/src/views/graph/App.tsx::CommunityPanel","packages/ui/src/graph/graph-community-panel.tsx::GraphCommunityPanel","packages/ui/src/graph/graph-community-panel.tsx::FactGrid","packages/ui/src/graph/graph-community-panel.tsx::FactValue"],"trace_via":["same_file","import_scoped","same_file","same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/core/src/repowise/core/generation/page_generator/orchestrate.py::_GenerationRun::execute","entry_point_name":"execute","entry_point_score":0.928,"termination":"no_callees","trace":["packages/core/src/repowise/core/generation/page_generator/orchestrate.py::_GenerationRun::execute","packages/core/src/repowise/core/generation/page_generator/orchestrate.py::_GenerationRun::_announce_total","packages/core/src/repowise/core/generation/page_generator/orchestrate.py::_announce_paid"],"trace_via":["self_scope","same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/server/src/repowise/server/routers/git.py::get_risk_range","entry_point_name":"get_risk_range","entry_point_score":0.843,"termination":"no_callees","trace":["packages/server/src/repowise/server/routers/git.py::get_risk_range","packages/server/src/repowise/server/routers/git.py::_revision_exists"],"trace_via":["same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/ui/src/dashboard/health-overview-card.tsx::HealthOverviewCard","entry_point_name":"HealthOverviewCard","entry_point_score":0.838,"termination":"no_callees","trace":["packages/ui/src/dashboard/health-overview-card.tsx::HealthOverviewCard","packages/ui/src/dashboard/health-overview-card.tsx::AccuracyStrip"],"trace_via":["same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/server/src/repowise/server/routers/costs.py::get_distill_savings","entry_point_name":"get_distill_savings","entry_point_score":0.831,"termination":"no_callees","trace":["packages/server/src/repowise/server/routers/costs.py::get_distill_savings","packages/server/src/repowise/server/routers/costs.py::_parse_since"],"trace_via":["same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/ui/src/git/ownership-table.tsx::OwnershipTable","entry_point_name":"OwnershipTable","entry_point_score":0.83,"termination":"no_callees","trace":["packages/ui/src/git/ownership-table.tsx::OwnershipTable","packages/ui/src/lib/cn.ts::cn"],"trace_via":["import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/ui/src/dashboard/decisions-timeline.tsx::DecisionsTimeline","entry_point_name":"DecisionsTimeline","entry_point_score":0.826,"termination":"no_callees","trace":["packages/ui/src/dashboard/decisions-timeline.tsx::DecisionsTimeline","packages/ui/src/lib/format.ts::formatRelativeTime","packages/ui/src/lib/format.ts::parseDate"],"trace_via":["import_scoped","same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/ui/src/dashboard/hotspots-mini.tsx::HotspotsMini","entry_point_name":"HotspotsMini","entry_point_score":0.826,"termination":"no_callees","trace":["packages/ui/src/dashboard/hotspots-mini.tsx::HotspotsMini","packages/ui/src/dashboard/hotspots-mini.tsx::getChurnColor"],"trace_via":["same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/ui/src/dashboard/module-minimap.tsx::ModuleMinimap","entry_point_name":"ModuleMinimap","entry_point_score":0.826,"termination":"no_callees","trace":["packages/ui/src/dashboard/module-minimap.tsx::ModuleMinimap","packages/ui/src/ui/card.tsx::Card","packages/ui/src/lib/cn.ts::cn"],"trace_via":["import_scoped","import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/ui/src/dashboard/ownership-treemap.tsx::OwnershipTreemap","entry_point_name":"OwnershipTreemap","entry_point_score":0.826,"termination":"no_callees","trace":["packages/ui/src/dashboard/ownership-treemap.tsx::OwnershipTreemap","packages/ui/src/ui/card.tsx::Card","packages/ui/src/lib/cn.ts::cn"],"trace_via":["import_scoped","import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/server/src/repowise/server/routers/graph/community.py::get_community_detail","entry_point_name":"get_community_detail","entry_point_score":0.825,"termination":"no_callees","trace":["packages/server/src/repowise/server/routers/graph/community.py::get_community_detail","packages/server/src/repowise/server/mcp_server/_graph_utils.py::community_cohesion","packages/server/src/repowise/server/mcp_server/_graph_utils.py::parse_community_meta"],"trace_via":["import_scoped","same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/ui/src/health/kpi-cards.tsx::HealthKpiCards","entry_point_name":"HealthKpiCards","entry_point_score":0.821,"termination":"no_callees","trace":["packages/ui/src/health/kpi-cards.tsx::HealthKpiCards","packages/ui/src/health/kpi-cards.tsx::InlineStat","packages/ui/src/health/sparkline.tsx::Sparkline"],"trace_via":["same_file","import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":0,"entry_point":"packages/ui/src/health/ai-prompt-builder.ts::buildGalaxyMapAiPrompt","entry_point_name":"buildGalaxyMapAiPrompt","entry_point_score":0.821,"termination":"no_callees","trace":["packages/ui/src/health/ai-prompt-builder.ts::buildGalaxyMapAiPrompt"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/server/src/repowise/server/routers/modules.py::get_module_health","entry_point_name":"get_module_health","entry_point_score":0.821,"termination":"no_callees","trace":["packages/server/src/repowise/server/routers/modules.py::get_module_health","packages/server/src/repowise/server/routers/modules.py::_decision_refs","packages/server/src/repowise/server/schemas/ownership.py::GoverningDecisionRef"],"trace_via":["same_file","import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/server/src/repowise/server/routers/refactoring.py::get_refactoring_plan_page","entry_point_name":"get_refactoring_plan_page","entry_point_score":0.821,"termination":"no_callees","trace":["packages/server/src/repowise/server/routers/refactoring.py::get_refactoring_plan_page","packages/server/src/repowise/server/routers/refactoring.py::RefactoringPlanPageResponse"],"trace_via":["same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":4,"entry_point":"packages/server/src/repowise/server/routers/c4.py::get_c4_mermaid","entry_point_name":"get_c4_mermaid","entry_point_score":0.816,"termination":"no_callees","trace":["packages/server/src/repowise/server/routers/c4.py::get_c4_mermaid","packages/server/src/repowise/server/services/c4_builder/mermaid.py::to_mermaid_l1","packages/server/src/repowise/server/services/c4_builder/mermaid.py::_emit_externals","packages/server/src/repowise/server/services/c4_builder/mermaid.py::_external_line","packages/server/src/repowise/server/services/c4_builder/mermaid.py::_ext_kind"],"trace_via":["import_scoped","same_file","same_file","same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/server/src/repowise/server/routers/workspace.py::get_workspace_graph","entry_point_name":"get_workspace_graph","entry_point_score":0.816,"termination":"no_callees","trace":["packages/server/src/repowise/server/routers/workspace.py::get_workspace_graph","packages/server/src/repowise/server/routers/workspace.py::_query_repo_stats","packages/core/src/repowise/core/docs_mode.py::resolve_docs_mode"],"trace_via":["same_file","import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/ui/src/dashboard/commits-mini.tsx::CommitsMini","entry_point_name":"CommitsMini","entry_point_score":0.815,"termination":"no_callees","trace":["packages/ui/src/dashboard/commits-mini.tsx::CommitsMini","packages/ui/src/lib/format.ts::formatRelativeTime","packages/ui/src/lib/format.ts::parseDate"],"trace_via":["import_scoped","same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/ui/src/dashboard/module-overview-grid.tsx::ModuleOverviewGrid","entry_point_name":"ModuleOverviewGrid","entry_point_score":0.815,"termination":"no_callees","trace":["packages/ui/src/dashboard/module-overview-grid.tsx::ModuleOverviewGrid","packages/ui/src/lib/cn.ts::cn"],"trace_via":["import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/ui/src/dashboard/savings-mini.tsx::SavingsMini","entry_point_name":"SavingsMini","entry_point_score":0.815,"termination":"no_callees","trace":["packages/ui/src/dashboard/savings-mini.tsx::SavingsMini","packages/ui/src/lib/format.ts::formatCost"],"trace_via":["import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/ui/src/git/contributors-strip.tsx::ContributorsStrip","entry_point_name":"ContributorsStrip","entry_point_score":0.815,"termination":"no_callees","trace":["packages/ui/src/git/contributors-strip.tsx::ContributorsStrip","packages/ui/src/git/contributors-strip.tsx::firstName"],"trace_via":["same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/ui/src/graph/graph-context-drawer.tsx::GraphContextDrawer","entry_point_name":"GraphContextDrawer","entry_point_score":0.815,"termination":"no_callees","trace":["packages/ui/src/graph/graph-context-drawer.tsx::GraphContextDrawer","packages/ui/src/graph/node-badges.tsx::NodeBadges","packages/ui/src/lib/cn.ts::cn"],"trace_via":["import_scoped","import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/server/src/repowise/server/routers/c4.py::get_c4_l1","entry_point_name":"get_c4_l1","entry_point_score":0.81,"termination":"no_callees","trace":["packages/server/src/repowise/server/routers/c4.py::get_c4_l1","packages/server/src/repowise/server/routers/c4.py::_person","packages/server/src/repowise/server/schemas/c4.py::C4PersonResponse"],"trace_via":["same_file","import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/server/src/repowise/server/routers/c4.py::get_c4_l3","entry_point_name":"get_c4_l3","entry_point_score":0.81,"termination":"no_callees","trace":["packages/server/src/repowise/server/routers/c4.py::get_c4_l3","packages/server/src/repowise/server/routers/c4.py::_component","packages/server/src/repowise/server/schemas/c4.py::C4ComponentResponse"],"trace_via":["same_file","import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/server/src/repowise/server/routers/decisions.py::get_decision_graph","entry_point_name":"get_decision_graph","entry_point_score":0.81,"termination":"no_callees","trace":["packages/server/src/repowise/server/routers/decisions.py::get_decision_graph","packages/server/src/repowise/server/schemas/decisions.py::DecisionCodeEdge"],"trace_via":["import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/cli/src/repowise/cli/commands/init_cmd/command.py::init_command","entry_point_name":"init_command","entry_point_score":0.809,"termination":"no_callees","trace":["packages/cli/src/repowise/cli/commands/init_cmd/command.py::init_command","packages/cli/src/repowise/cli/commands/init_cmd/command.py::_print_structural_plan","packages/cli/src/repowise/cli/commands/init_cmd/generation.py::page_type_label"],"trace_via":["same_file","import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/ui/src/graph/centrality-leaderboard.tsx::CentralityLeaderboard","entry_point_name":"CentralityLeaderboard","entry_point_score":0.807,"termination":"no_callees","trace":["packages/ui/src/graph/centrality-leaderboard.tsx::CentralityLeaderboard","packages/ui/src/graph/centrality-leaderboard.tsx::score"],"trace_via":["same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/cli/src/repowise/cli/commands/health_cmd/command.py::health_command","entry_point_name":"health_command","entry_point_score":0.805,"termination":"no_callees","trace":["packages/cli/src/repowise/cli/commands/health_cmd/command.py::health_command","packages/cli/src/repowise/cli/_setup.py::configure_cli_logging"],"trace_via":["import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/vscode/webview/src/views/decisions/App.tsx::App","entry_point_name":"App","entry_point_score":0.805,"termination":"confidence_filtered","termination_detail":{"global_unique":1},"trace":["packages/vscode/webview/src/views/decisions/App.tsx::App","packages/vscode/webview/src/views/decisions/App.tsx::DecisionsSkeleton"],"trace_via":["same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/web/src/app/repos/[id]/overview/page.tsx::OverviewPage","entry_point_name":"OverviewPage","entry_point_score":0.804,"termination":"no_callees","trace":["packages/web/src/app/repos/[id]/overview/page.tsx::OverviewPage","packages/web/src/app/repos/[id]/overview/page.tsx::safeFetch"],"trace_via":["same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":4,"entry_point":"packages/web/src/app/repos/[id]/costs/page.tsx::CostsPage","entry_point_name":"CostsPage","entry_point_score":0.803,"termination":"no_callees","trace":["packages/web/src/app/repos/[id]/costs/page.tsx::CostsPage","packages/api-client/src/costs.ts::getCostSummary","packages/api-client/src/client.ts::apiGet","packages/api-client/src/client.ts::buildHeaders","packages/api-client/src/client.ts::resolveToken"],"trace_via":["import_scoped","import_scoped","same_file","same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/vscode/src/extension.ts::activate","entry_point_name":"activate","entry_point_score":0.802,"termination":"confidence_filtered","termination_detail":{"global_unique":1},"trace":["packages/vscode/src/extension.ts::activate","packages/vscode/src/extension.ts::checkSetup"],"trace_via":["same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/server/src/repowise/server/routers/c4.py::get_c4_l2","entry_point_name":"get_c4_l2","entry_point_score":0.802,"termination":"no_callees","trace":["packages/server/src/repowise/server/routers/c4.py::get_c4_l2","packages/server/src/repowise/server/routers/c4.py::_container","packages/server/src/repowise/server/schemas/c4.py::C4ContainerResponse"],"trace_via":["same_file","import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/server/src/repowise/server/routers/knowledge_map.py::get_knowledge_map","entry_point_name":"get_knowledge_map","entry_point_score":0.802,"termination":"no_callees","trace":["packages/server/src/repowise/server/routers/knowledge_map.py::get_knowledge_map","packages/server/src/repowise/server/schemas/ownership.py::KnowledgeMapOwner"],"trace_via":["import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/server/src/repowise/server/routers/refactoring.py::get_refactoring_targets","entry_point_name":"get_refactoring_targets","entry_point_score":0.802,"termination":"no_callees","trace":["packages/server/src/repowise/server/routers/refactoring.py::get_refactoring_targets","packages/server/src/repowise/server/routers/refactoring.py::RefactoringSummary"],"trace_via":["same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":4,"entry_point":"packages/server/src/repowise/server/routers/repos.py::create_repo","entry_point_name":"create_repo","entry_point_score":0.802,"termination":"no_callees","trace":["packages/server/src/repowise/server/routers/repos.py::create_repo","packages/server/src/repowise/server/routers/repos.py::_enqueue_index_job","packages/server/src/repowise/server/routers/repos.py::_launch_job_task","packages/server/src/repowise/server/routers/repos.py::_resolve_repo_session_factory","packages/server/src/repowise/server/deps.py::resolve_session_factory"],"trace_via":["same_file","same_file","same_file","import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/server/src/repowise/server/routers/workspace.py::get_workspace","entry_point_name":"get_workspace","entry_point_score":0.802,"termination":"no_callees","trace":["packages/server/src/repowise/server/routers/workspace.py::get_workspace","packages/server/src/repowise/server/routers/workspace.py::_query_repo_stats","packages/core/src/repowise/core/docs_mode.py::resolve_docs_mode"],"trace_via":["same_file","import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":3,"entry_point":"packages/server/src/repowise/server/routers/graph/intelligence.py::get_execution_flows","entry_point_name":"get_execution_flows","entry_point_score":0.802,"termination":"no_callees","trace":["packages/server/src/repowise/server/routers/graph/intelligence.py::get_execution_flows","packages/server/src/repowise/server/mcp_server/_graph_utils.py::bfs_trace","packages/server/src/repowise/server/mcp_server/_graph_utils.py::_node_id_is_excluded","packages/core/src/repowise/core/analysis/execution_graph.py::is_excluded_execution_path"],"trace_via":["import_scoped","same_file","import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/server/src/repowise/server/routers/workspace.py::get_contract_detail","entry_point_name":"get_contract_detail","entry_point_score":0.802,"termination":"no_callees","trace":["packages/server/src/repowise/server/routers/workspace.py::get_contract_detail","packages/server/src/repowise/server/routers/workspace.py::_contract_entry","packages/server/src/repowise/server/schemas/workspace.py::WorkspaceContractEntry"],"trace_via":["same_file","import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":4,"entry_point":"packages/cli/src/repowise/cli/commands/saved_cmd.py::saved_command","entry_point_name":"saved_command","entry_point_score":0.799,"termination":"no_callees","trace":["packages/cli/src/repowise/cli/commands/saved_cmd.py::saved_command","packages/cli/src/repowise/cli/commands/saved_cmd.py::_estimate_usd","packages/core/src/repowise/core/generation/cost_tracker.py::get_model_pricing","packages/core/src/repowise/core/generation/cost_tracker.py::_get_pricing","packages/core/src/repowise/core/generation/cost_tracker.py::_family_pricing"],"trace_via":["same_file","import_scoped","same_file","same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/web/src/app/repos/[id]/code-health/page.tsx::CodeHealthPage","entry_point_name":"CodeHealthPage","entry_point_score":0.799,"termination":"no_callees","trace":["packages/web/src/app/repos/[id]/code-health/page.tsx::CodeHealthPage","packages/web/src/app/repos/[id]/code-health/page.tsx::ViewSelect","packages/ui/src/ui/select.tsx::Select"],"trace_via":["same_file","import_scoped"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/cli/src/repowise/cli/commands/dead_code_cmd.py::dead_code_command","entry_point_name":"dead_code_command","entry_point_score":0.798,"termination":"no_callees","trace":["packages/cli/src/repowise/cli/commands/dead_code_cmd.py::dead_code_command","packages/cli/src/repowise/cli/helpers.py::load_state","packages/cli/src/repowise/cli/helpers.py::get_repowise_dir"],"trace_via":["import_scoped","same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":4,"entry_point":"packages/cli/src/repowise/cli/commands/restyle_cmd.py::restyle_command","entry_point_name":"restyle_command","entry_point_score":0.798,"termination":"no_callees","trace":["packages/cli/src/repowise/cli/commands/restyle_cmd.py::restyle_command","packages/cli/src/repowise/cli/commands/restyle_cmd.py::_print_styles","packages/core/src/repowise/core/generation/styles/registry.py::list_styles","packages/core/src/repowise/core/generation/styles/registry.py::_load_custom_style","packages/core/src/repowise/core/generation/styles/registry.py::_clip"],"trace_via":["same_file","import_scoped","same_file","same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":1,"entry_point":"packages/web/src/app/repos/[id]/refactoring/page.tsx::RefactoringPage","entry_point_name":"RefactoringPage","entry_point_score":0.797,"termination":"no_callees","trace":["packages/web/src/app/repos/[id]/refactoring/page.tsx::RefactoringPage","packages/web/src/app/repos/[id]/refactoring/page.tsx::leadTypeFor"],"trace_via":["same_file"]},{"communities_visited":[0],"crosses_community":false,"depth":2,"entry_point":"packages/vscode/webview/src/views/risk/App.tsx::App","entry_point_name":"App","entry_point_score":0.797,"termination":"no_callees","trace":["packages/vscode/webview/src/views/risk/App.tsx::App","packages/vscode/webview/src/views/risk/App.tsx::ChangeImpact","packages/vscode/webview/src/views/risk/App.tsx::DirectRiskRow"],"trace_via":["same_file","same_file"]}],"flows_emitted":45,"flows_omitted":5,"flows_reduced_reason":"response_budget","flows_total":50,"flows_truncated":true,"omission_marker":"[repowise#94e97218a71a: 26 lines omitted (~201 tokens); restore: repowise expand 94e97218a71a]","total_entry_points":50,"truncated":true},"get_health:all-includes":{"_meta":{"completeness":{"capped":true,"reason":"collection_cap_and_response_budget","shown":64,"total":4465},"contract_version":1,"embedder_degraded":false,"health_analysis":{"analyzed_at":"2026-09-09T10:32:48.965510","analyzed_commit":"920d1c973d64","live_verification":{"basis":"unavailable","source_bytes_verified":false},"recomputed_this_call":false,"refresh":{"command":"repowise update","precondition":"commit health-relevant working-tree changes first","required_before_comparison":true},"source":"stored_health_analysis","status":"available"},"health_analyzed_at":"2026-09-09T10:32:48.965510","health_analyzed_commit":"920d1c973d64","health_semantics":{"percentiles":{"direction":"higher means ranked above more files in the eligible stored population","freshness":"stored analysis; not recomputed by get_health","population":"the eligible repository files used by the stored analysis for that signal","public_raw_scale":"percentile_rank_0_to_100","stored_scale":"ratio_0_to_1"},"weighted_deficit_points":{"denominator":"gap_analysis.weighted_gross_gap_points","direction":"higher means the file contributes more to the eligible population's gross deficit from the Healthy threshold","interpretation":"a deterministic triage weight, not a probability, percentage, normalized score, or guaranteed improvement","numerator":"max(8.0 - file_score, 0.0) * max(nloc, 1)","scale":{"maximum":null,"minimum":0,"normalized":false},"unit":"health_score_points_x_nloc"}},"index_age_days":0,"indexed_commit":"920d1c973d64","omitted":{"refs":["repowise#bc0f64f88aed"],"restore":"Run `repowise expand <ref>` from the repo, or call get_symbol(\"repowise#<ref>\", query=...) to retrieve the omitted content.","tokens":26041},"reductions":[{"emitted":0,"field":"performance_summary.facets.context","reason":"response_budget","total":3},{"emitted":0,"field":"performance_summary.facets.boundary","reason":"response_budget","total":5},{"emitted":0,"field":"performance_summary.facets.confidence","reason":"response_budget","total":1},{"emitted":0,"field":"performance_summary.facets.actionability","reason":"response_budget","total":3},{"emitted":0,"field":"performance_summary.facets.plan_state","reason":"response_budget","total":2}],"response_budget":{"limit_chars":32000,"serialized_chars":20421,"tier":"expanded"},"state":{"truncated":true},"timing_ms":1761.0},"directive":{"fix_first":"packages/server/src/repowise/server/mcp_server/tool_health.py","next_action":"inspect matching plan via plan_via","plan_addresses_reason":true,"plan_via":"get_health(include=['refactoring'], only=['refactoring_plans'])","reason":"Brain Method: get_health is 975 lines, CCN 193, in a file imported by 105 others","recovers_points":15688,"recovers_points_compatibility":{"deprecated":true,"equivalent_value":true,"replacement":"recovers_weighted_deficit_points"},"recovers_weighted_deficit_points":15688,"share_of_repo_gap_pct":1.5,"then":["packages/ui/src/health/ai-prompt-builder.ts","packages/core/src/repowise/core/pipeline/persist.py"],"then_emitted":2,"then_total":2,"watch":{"biomarker":"change_entropy","note":"History-derived. Read it as context; there is nothing here to fix.","reason":"changes are scattered across noisy commits (top 0.6% among files eligible for change-entropy ranking); a strong history-based fault predictor"}},"distribution":{"bands":{"alert":{"files":212,"nloc":110556,"pct":17.5},"healthy":{"files":2678,"nloc":299568,"pct":47.5},"warning":{"files":903,"nloc":220758,"pct":35.0}},"total_files":3793,"total_nloc":630882},"gap_analysis":{"files_below_target":1115,"files_for_half_gap":48,"files_to_reach_target":166,"target_score":8.0,"weighted_gap_points":667877,"weighted_gross_gap_points":1066540},"high_leverage_files":[{"branch_coverage_pct":null,"file_path":"packages/server/src/repowise/server/mcp_server/tool_health.py","has_test_file":true,"is_test":false,"line_coverage_pct":74.71,"maintainability_score":3.1,"max_ccn":193,"max_nesting":4,"module":"packages/server","nloc":2254,"performance_score":10.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.6% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.04,"share_of_repo_gap_pct":1.5,"total_deduction":8.965,"weighted_deficit":15688},{"branch_coverage_pct":null,"file_path":"packages/ui/src/health/ai-prompt-builder.ts","has_test_file":true,"is_test":false,"line_coverage_pct":null,"maintainability_score":2.8,"max_ccn":56,"max_nesting":3,"module":"packages/ui","nloc":1911,"performance_score":10.0,"primary_biomarker":"co_change_scatter","primary_reason":"co-changes with 25 distinct files \u2014 editing this file tends to ripple across the codebase (shotgun surgery)","score":1.9,"share_of_repo_gap_pct":1.1,"total_deduction":8.097,"weighted_deficit":11657},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/pipeline/persist.py","has_test_file":true,"is_test":false,"line_coverage_pct":85.47,"maintainability_score":1.3,"max_ccn":29,"max_nesting":5,"module":"packages/core","nloc":1570,"performance_score":8.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.3% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.07,"share_of_repo_gap_pct":1.0,"total_deduction":8.928,"weighted_deficit":10880},{"branch_coverage_pct":null,"file_path":"packages/server/src/repowise/server/mcp_server/tool_why.py","has_test_file":true,"is_test":false,"line_coverage_pct":81.27,"maintainability_score":3.7,"max_ccn":19,"max_nesting":3,"module":"packages/server","nloc":1695,"performance_score":8.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.7% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.6,"share_of_repo_gap_pct":1.0,"total_deduction":8.399,"weighted_deficit":10848}],"high_leverage_files_emitted":4,"high_leverage_files_omitted":1111,"high_leverage_files_reduced_reason":"limit_and_response_budget","high_leverage_files_total":1115,"high_leverage_files_truncated":true,"kpis":{"average_health":6.94,"average_health_unweighted":8.35,"average_health_weighting":"nloc","band":"warning","file_count":3793,"history_average":1.43,"hotspot_health":4.35,"maintainability_average":7.94,"performance_analyzed_files":3791,"performance_average":9.73,"performance_coverage_pct":100.0,"performance_covered_files":3787,"performance_findings":974,"performance_findings_density_per_10k_loc":15.45,"performance_skipped_files":4,"performance_unsupported_languages":[["shell",4]],"performance_unsupported_languages_emitted":1,"performance_unsupported_languages_total":1,"structure_average":1.67,"worst_performer_path":"packages/server/src/repowise/server/routers/repos.py","worst_performer_score":1.0},"mode":"dashboard","omission_marker":"[repowise#bc0f64f88aed: 3475 lines omitted (~26041 tokens); restore: repowise expand bc0f64f88aed]","performance_directive":{"advisory_total":272,"affected_call_sites_total":1,"boundary_kind":"db","execution_context":"production","file_path":"packages/core/src/repowise/core/persistence/crud/external_systems.py","investigate_total":539,"next_action":{"arguments":{"opportunity_id":"perf2_034ee9eced0e382bb3ea"},"tool":"get_health"},"observations_total":1,"opportunities_total":845,"opportunity_id":"perf2_034ee9eced0e382bb3ea","performance_model_version":2,"plan_ready_total":34,"plan_reason":"A stored performance plan addresses this exact opportunity.","plan_state":"available","prerequisites":[],"prerequisites_emitted":0,"prerequisites_total":0,"status":"plan_ready","title":"serial_await_in_loop reaching packages/core/src/repowise/core/persistence/crud/external_systems.py","why_ranked":[{"factor":"boundary_kind","points":4,"value":"db"},{"factor":"multiplier_shape","points":4,"value":"serial_await_in_loop"},{"factor":"execution_context","points":3,"value":"production"}],"why_ranked_emitted":3,"why_ranked_total":3},"performance_opportunities":[{"actionability_reason":"proven_strategy","actionability_state":"plan_ready","affected_call_sites_total":1,"affected_files_total":1,"biomarker_type":"serial_await_in_loop","biomarker_types":["serial_await_in_loop"],"biomarker_types_emitted":1,"biomarker_types_total":1,"boundary_kind":"db","confidence":"high","evidence":[{"biomarker_type":"serial_await_in_loop","file_path":"packages/core/src/repowise/core/persistence/crud/external_systems.py","finding_id":"finding_99ea6677d915fceab5f7","function_name":"reconcile_symbols_for_files","line_end":294,"line_start":294,"path":[],"path_emitted":0,"path_total":0,"provenance":"direct","reason":"a database call is awaited serially in a loop whose iterations carry no data dependence; fan out with gather / Promise.all"}],"evidence_emitted":1,"evidence_total":1,"evidence_truncated":false,"execution_context":"production","facets":{"actionability_confidence":"high","amplification":"per_iteration","change_risk":"contained","exposure":"unknown","leverage":"isolated"},"file_path":"packages/core/src/repowise/core/persistence/crud/external_systems.py","fix":{"rationale":"Dataflow proves that every observed loop carries no cross-iteration dependence.","safety":"proven","strategy":"parallelize_independent_awaits"},"intervention_symbol":null,"observations_total":1,"opportunity_id":"perf2_034ee9eced0e382bb3ea","performance_model_version":2,"plan_id":"1b813b8813c24565bd009be544baaedf","plan_reason":"A stored performance plan addresses this exact opportunity.","plan_reference":"refac2_7606d680b10cc557b5e7","plan_status":"available","prerequisites":[],"prerequisites_emitted":0,"prerequisites_total":0,"provenance":"direct","rank_factors":{"affected_call_sites":2,"boundary_kind":4,"entry_reachability":0,"execution_context":3,"multiplier_shape":4,"provenance":3},"rank_position":0,"rank_score":16,"reliable_entry_reachability":null,"resource_fingerprints":[],"resource_fingerprints_emitted":0,"resource_fingerprints_total":0,"shared_path_suffix":[],"shared_path_suffix_emitted":0,"shared_path_suffix_total":0,"terminal_sink":null,"why_ranked":[{"factor":"boundary_kind","points":4,"value":"db"},{"factor":"multiplier_shape","points":4,"value":"serial_await_in_loop"},{"factor":"execution_context","points":3,"value":"production"}],"why_ranked_emitted":3,"why_ranked_total":3}],"performance_opportunities_emitted":1,"performance_opportunities_omitted":455,"performance_opportunities_reduced_reason":"collection_cap_and_response_budget","performance_opportunities_total":456,"performance_opportunities_truncated":true,"recommendation_lede":{"next_call":"get_health(targets=[], repo=None, include=['performance','refactoring'], limit=3, only=['performance_opportunities','refactoring_plans'], refactoring_view='diversified')","performance_lead":{"affected_call_sites_total":1,"boundary_kind":"db","execution_context":"production","intervention_symbol":null,"opportunity_id":"perf2_034ee9eced0e382bb3ea","rank_score":16},"performance_opportunities_total":456,"performance_plan_id":"refac2_7606d680b10cc557b5e7","performance_plan_reason":"A stored performance plan addresses this exact opportunity.","recommendation_lead":{"benefit":1.452,"cost":1.0,"file_path":"packages/core/src/repowise/core/co_change.py","id":"refac2_d95bd5e229aa99f1bdaf","leverage":5.853,"rank_score":3.618,"refactoring_type":"extract_method","risk":0.75,"target_symbol":"parse_partners"},"refactoring_plans_total":2146},"recovery":{"high_leverage_files":{"call":"get_health(targets=[], include=['files', 'refactoring', 'performance'], repo=None, limit=50, only=['high_leverage_files'], refactoring_view='diversified', cursor=100)","remaining":1015},"performance_opportunities":{"call":"get_health(targets=[], include=['files', 'refactoring', 'performance'], repo=None, limit=6, only=['performance_opportunities'], refactoring_view='diversified', cursor=6)","remaining":450},"refactoring_opportunities":{"call":"get_health(targets=[], include=['files', 'refactoring', 'performance'], repo=None, limit=6, only=['refactoring_opportunities'], refactoring_view='diversified', cursor=6)","remaining":622},"refactoring_plans":{"call":"get_health(targets=[], include=['files', 'refactoring', 'performance'], repo=None, limit=6, only=['refactoring_plans'], refactoring_view='diversified', cursor=6)","remaining":2140}},"refactoring_directive":{"addresses_primary_problem":true,"confidence":"medium","effort_bucket":"M","fix_first":"packages/cli/src/repowise/cli/agent_targets/targets/hermes.py","judgment_steps":3,"lead_refactoring_type":"extract_method","mechanical_steps":2,"next_action":{"arguments":{"opportunity_id":"refop2_02242668954622a5d496"},"tool":"get_health"},"opportunities_total":628,"opportunity_id":"refop2_02242668954622a5d496","reason":"complex_method","recovers_health_points":1.5,"status":"available","steps":5},"refactoring_opportunities":[{"addresses_primary_problem":true,"affected_files_total":2,"confidence":"medium","dependents":1,"effort_bucket":"M","evidence_total":1,"file_nloc":738,"file_path":"packages/cli/src/repowise/cli/agent_targets/targets/hermes.py","judgment_steps":3,"lead_biomarker":"complex_method","lead_refactoring_type":"extract_method","mechanical_steps":2,"opportunity_id":"refop2_02242668954622a5d496","queue_position":0,"rank_factors":{"benefit":7.678,"cost":6.0,"mechanical_share":0.2,"primary_problem":0.5,"risk":1.193},"rank_position":0,"rank_score":1.593,"recoverable_health":1.5,"refactoring_model_version":2,"status":"open","step_count":5,"steps":[{"applicability":{"classification":"judgment","facts":{"affected_file_count":2,"blast_size":2,"callers":1,"confidence":"medium","cross_file":true,"framework_registration":null},"reasons":["changes_symbol_home"],"reasons_emitted":1,"reasons_total":1,"unknowns":["framework_registration"],"unknowns_emitted":1,"unknowns_total":1},"confidence":"medium","effort_bucket":"M","file_path":"packages/cli/src/repowise/cli/agent_targets/targets/hermes.py","finding_ids":[],"finding_ids_emitted":0,"finding_ids_total":0,"impact_delta":0.0,"line_end":895,"line_start":853,"plan_id":"refac2_6cde1e96425eff562cdc","refactoring_type":"move_method","relocated_by":null,"source_biomarker":"","target_symbol":"HermesTarget._install_user","validation_profile_id":"validation_7930504470d6557f"},{"applicability":{"classification":"judgment","facts":{"affected_file_count":2,"blast_size":2,"callers":1,"confidence":"medium","cross_file":true,"framework_registration":null},"reasons":["changes_symbol_home"],"reasons_emitted":1,"reasons_total":1,"unknowns":["framework_registration"],"unknowns_emitted":1,"unknowns_total":1},"confidence":"medium","effort_bucket":"S","file_path":"packages/cli/src/repowise/cli/agent_targets/targets/hermes.py","finding_ids":[],"finding_ids_emitted":0,"finding_ids_total":0,"impact_delta":0.0,"line_end":945,"line_start":921,"plan_id":"refac2_065b2171c336d19cf156","refactoring_type":"move_method","relocated_by":"refac2_6cde1e96425eff562cdc","source_biomarker":"","target_symbol":"HermesTarget._install_project","validation_profile_id":"validation_fdd06b95856e574b"},{"applicability":{"classification":"judgment","facts":{"affected_file_count":2,"blast_size":2,"callers":0,"confidence":"high","cross_file":true,"framework_registration":null},"reasons":["changes_symbol_home"],"reasons_emitted":1,"reasons_total":1,"unknowns":["framework_registration"],"unknowns_emitted":1,"unknowns_total":1},"confidence":"high","effort_bucket":"S","file_path":"packages/cli/src/repowise/cli/agent_targets/targets/hermes.py","finding_ids":[],"finding_ids_emitted":0,"finding_ids_total":0,"impact_delta":0.0,"line_end":968,"line_start":947,"plan_id":"refac2_77f1f6f5c207a1f6e0c3","refactoring_type":"move_method","relocated_by":"refac2_065b2171c336d19cf156","source_biomarker":"","target_symbol":"HermesTarget.uninstall","validation_profile_id":"validation_34374d7940731da7"}],"steps_emitted":3,"steps_reduced_reason":"limit","steps_total":5,"why_ranked":[{"factor":"benefit","value":7.678},{"factor":"cost","value":6.0},{"factor":"risk","value":1.193}],"why_ranked_emitted":3,"why_ranked_total":3}],"refactoring_opportunities_emitted":1,"refactoring_opportunities_omitted":627,"refactoring_opportunities_reduced_reason":"collection_cap_and_response_budget","refactoring_opportunities_total":628,"refactoring_opportunities_truncated":true,"refactoring_plans":[{"benefit":1.452,"blast_radius":{"scope":"local"},"confidence":"high","cost":1.0,"dependents":24,"effort_bucket":"S","evidence":{"ccn_removed":3,"slice_nloc":16},"file_nloc":120,"file_path":"packages/core/src/repowise/core/co_change.py","file_weighted_deficit":193,"id":"refac2_d95bd5e229aa99f1bdaf","impact_delta":1.452,"leverage":5.853,"line_end":154,"line_start":104,"plan":{"params":["out","path","record","weight"],"params_emitted":4,"params_total":4,"returns":[],"returns_emitted":0,"returns_total":0,"span":{"end":152,"start":137},"suggested_name":null},"rank_score":3.618,"refactoring_type":"extract_method","repository":"default","risk":0.75,"source_biomarker":"complex_method","target_symbol":"parse_partners","validation_profile_id":"validation_196eb44587dd5d6d"}],"refactoring_plans_emitted":1,"refactoring_plans_omitted":2145,"refactoring_plans_reduced_reason":"collection_cap_and_response_budget","refactoring_plans_status":{"reason":null,"state":"available"},"refactoring_plans_total":2146,"refactoring_plans_truncated":true,"scope":"all","secondary_rankings":{"modules":{"call":"get_health(repo=None, only=['modules'], limit=50)","total":12},"test_findings":{"call":"get_health(repo=None, only=['test_findings'], limit=50)","total":364},"top_findings":{"call":"get_health(repo=None, only=['top_findings'], limit=50)","total":610},"worst_files":{"call":"get_health(repo=None, only=['worst_files'], limit=50)","total":3793}},"truncated":true,"unknown_include_keys":["files"],"unknown_include_keys_emitted":1,"unknown_include_keys_total":1,"validation_profiles":[{"affected_files":["packages/core/src/repowise/core/co_change.py"],"affected_files_emitted":1,"affected_files_total":1,"affected_symbols":["parse_partners"],"affected_symbols_emitted":1,"affected_symbols_total":1,"basis":"inferred","commands":["pytest tests/integration/test_cli.py tests/integration/test_pipeline_fast_checkpoint.py tests/integration/test_pipeline_resume.py tests/integration/test_upgrade_fast_to_full.py tests/unit/analysis/test_branch_overlap.py tests/unit/analysis/test_independent_changes.py tests/unit/cli/test_augment_decision_inject.py tests/unit/cli/test_augment_session_start.py tests/unit/cli/test_augment_wrong_path.py tests/unit/cli/test_docs_pointer.py tests/unit/cli/test_update_e2e.py tests/unit/cli/test_update_forgets_deleted_files.py"],"commands_emitted":1,"commands_total":1,"id":"validation_196eb44587dd5d6d","targets":[{"basis":"inferred","file_path":"packages/core/src/repowise/core/co_change.py","tests":["tests/integration/test_cli.py","tests/integration/test_pipeline_fast_checkpoint.py","tests/integration/test_pipeline_resume.py","tests/integration/test_upgrade_fast_to_full.py","tests/unit/analysis/test_branch_overlap.py","tests/unit/analysis/test_independent_changes.py","tests/unit/cli/test_augment_decision_inject.py","tests/unit/cli/test_augment_session_start.py","tests/unit/cli/test_augment_wrong_path.py","tests/unit/cli/test_docs_pointer.py","tests/unit/cli/test_update_e2e.py","tests/unit/cli/test_update_forgets_deleted_files.py"],"tests_emitted":12,"tests_total":12,"total":54,"truncated":true,"via":"call-graph"}],"targets_emitted":1,"targets_total":1,"tests":["tests/integration/test_cli.py","tests/integration/test_pipeline_fast_checkpoint.py","tests/integration/test_pipeline_resume.py","tests/integration/test_upgrade_fast_to_full.py","tests/unit/analysis/test_branch_overlap.py","tests/unit/analysis/test_independent_changes.py","tests/unit/cli/test_augment_decision_inject.py","tests/unit/cli/test_augment_session_start.py","tests/unit/cli/test_augment_wrong_path.py","tests/unit/cli/test_docs_pointer.py","tests/unit/cli/test_update_e2e.py","tests/unit/cli/test_update_forgets_deleted_files.py"],"tests_emitted":12,"tests_reduced_reason":"analysis_source_cap","tests_total":54,"total":54,"via":"call-graph"}],"validation_profiles_emitted":1,"validation_profiles_reduced_reason":"response_budget","validation_profiles_total":6},"get_health:default":{"_meta":{"completeness":{"capped":true,"reason":"limit","shown":26,"total":1121},"contract_version":1,"embedder_degraded":false,"health_analysis":{"analyzed_at":"2026-09-09T10:32:48.965510","analyzed_commit":"920d1c973d64","live_verification":{"basis":"unavailable","source_bytes_verified":false},"recomputed_this_call":false,"refresh":{"command":"repowise update","precondition":"commit health-relevant working-tree changes first","required_before_comparison":true},"source":"stored_health_analysis","status":"available"},"health_analyzed_at":"2026-09-09T10:32:48.965510","health_analyzed_commit":"920d1c973d64","health_semantics":{"percentiles":{"direction":"higher means ranked above more files in the eligible stored population","freshness":"stored analysis; not recomputed by get_health","population":"the eligible repository files used by the stored analysis for that signal","public_raw_scale":"percentile_rank_0_to_100","stored_scale":"ratio_0_to_1"},"weighted_deficit_points":{"denominator":"gap_analysis.weighted_gross_gap_points","direction":"higher means the file contributes more to the eligible population's gross deficit from the Healthy threshold","interpretation":"a deterministic triage weight, not a probability, percentage, normalized score, or guaranteed improvement","numerator":"max(8.0 - file_score, 0.0) * max(nloc, 1)","scale":{"maximum":null,"minimum":0,"normalized":false},"unit":"health_score_points_x_nloc"}},"index_age_days":0,"indexed_commit":"920d1c973d64","response_budget":{"limit_chars":24000,"serialized_chars":17265,"tier":"default"},"timing_ms":324.1},"directive":{"fix_first":"packages/server/src/repowise/server/mcp_server/tool_health.py","next_action":"inspect matching plan via plan_via","plan_addresses_reason":true,"plan_via":"get_health(include=['refactoring'], only=['refactoring_plans'])","reason":"Brain Method: get_health is 975 lines, CCN 193, in a file imported by 105 others","recovers_points":15688,"recovers_points_compatibility":{"deprecated":true,"equivalent_value":true,"replacement":"recovers_weighted_deficit_points"},"recovers_weighted_deficit_points":15688,"share_of_repo_gap_pct":1.5,"then":["packages/ui/src/health/ai-prompt-builder.ts","packages/core/src/repowise/core/pipeline/persist.py"],"then_emitted":2,"then_total":2,"watch":{"biomarker":"change_entropy","note":"History-derived. Read it as context; there is nothing here to fix.","reason":"changes are scattered across noisy commits (top 0.6% among files eligible for change-entropy ranking); a strong history-based fault predictor"}},"distribution":{"bands":{"alert":{"files":212,"nloc":110556,"pct":17.5},"healthy":{"files":2678,"nloc":299568,"pct":47.5},"warning":{"files":903,"nloc":220758,"pct":35.0}},"total_files":3793,"total_nloc":630882},"gap_analysis":{"files_below_target":1115,"files_for_half_gap":48,"files_to_reach_target":166,"target_score":8.0,"weighted_gap_points":667877,"weighted_gross_gap_points":1066540},"high_leverage_files":[{"branch_coverage_pct":null,"file_path":"packages/server/src/repowise/server/mcp_server/tool_health.py","has_test_file":true,"is_test":false,"line_coverage_pct":74.71,"maintainability_score":3.1,"max_ccn":193,"max_nesting":4,"module":"packages/server","nloc":2254,"performance_score":10.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.6% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.04,"share_of_repo_gap_pct":1.5,"total_deduction":8.965,"weighted_deficit":15688},{"branch_coverage_pct":null,"file_path":"packages/ui/src/health/ai-prompt-builder.ts","has_test_file":true,"is_test":false,"line_coverage_pct":null,"maintainability_score":2.8,"max_ccn":56,"max_nesting":3,"module":"packages/ui","nloc":1911,"performance_score":10.0,"primary_biomarker":"co_change_scatter","primary_reason":"co-changes with 25 distinct files \u2014 editing this file tends to ripple across the codebase (shotgun surgery)","score":1.9,"share_of_repo_gap_pct":1.1,"total_deduction":8.097,"weighted_deficit":11657},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/pipeline/persist.py","has_test_file":true,"is_test":false,"line_coverage_pct":85.47,"maintainability_score":1.3,"max_ccn":29,"max_nesting":5,"module":"packages/core","nloc":1570,"performance_score":8.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.3% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.07,"share_of_repo_gap_pct":1.0,"total_deduction":8.928,"weighted_deficit":10880},{"branch_coverage_pct":null,"file_path":"packages/server/src/repowise/server/mcp_server/tool_why.py","has_test_file":true,"is_test":false,"line_coverage_pct":81.27,"maintainability_score":3.7,"max_ccn":19,"max_nesting":3,"module":"packages/server","nloc":1695,"performance_score":8.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.7% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.6,"share_of_repo_gap_pct":1.0,"total_deduction":8.399,"weighted_deficit":10848},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/pipeline/incremental.py","has_test_file":true,"is_test":false,"line_coverage_pct":85.35,"maintainability_score":1.3,"max_ccn":41,"max_nesting":4,"module":"packages/core","nloc":1555,"performance_score":10.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.3% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.06,"share_of_repo_gap_pct":1.0,"total_deduction":8.925,"weighted_deficit":10792},{"branch_coverage_pct":null,"file_path":"packages/cli/src/repowise/cli/commands/update_cmd/command.py","has_test_file":true,"is_test":false,"line_coverage_pct":69.6,"maintainability_score":1.3,"max_ccn":188,"max_nesting":5,"module":"packages/cli","nloc":1517,"performance_score":10.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.2% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.0,"share_of_repo_gap_pct":1.0,"total_deduction":9.574,"weighted_deficit":10619},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/ingestion/parser.py","has_test_file":true,"is_test":false,"line_coverage_pct":92.35,"maintainability_score":3.1,"max_ccn":134,"max_nesting":7,"module":"packages/core","nloc":1650,"performance_score":10.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.2% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.74,"share_of_repo_gap_pct":1.0,"total_deduction":8.252,"weighted_deficit":10329},{"branch_coverage_pct":null,"file_path":"packages/cli/src/repowise/cli/commands/init_cmd/command.py","has_test_file":true,"is_test":false,"line_coverage_pct":75.35,"maintainability_score":2.4,"max_ccn":140,"max_nesting":4,"module":"packages/cli","nloc":1404,"performance_score":10.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.2% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.0,"share_of_repo_gap_pct":0.9,"total_deduction":9.288,"weighted_deficit":9828},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/ingestion/call_resolver.py","has_test_file":true,"is_test":false,"line_coverage_pct":91.47,"maintainability_score":3.3,"max_ccn":34,"max_nesting":5,"module":"packages/core","nloc":1558,"performance_score":10.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.3% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.81,"share_of_repo_gap_pct":0.9,"total_deduction":8.189,"weighted_deficit":9644},{"branch_coverage_pct":null,"file_path":"packages/cli/src/repowise/cli/commands/workspace_cmd.py","has_test_file":true,"is_test":false,"line_coverage_pct":72.45,"maintainability_score":1.3,"max_ccn":29,"max_nesting":4,"module":"packages/cli","nloc":1340,"performance_score":8.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 1.4% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.0,"share_of_repo_gap_pct":0.9,"total_deduction":9.451,"weighted_deficit":9380},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/ingestion/parser_helpers.py","has_test_file":true,"is_test":false,"line_coverage_pct":73.03,"maintainability_score":3.4,"max_ccn":20,"max_nesting":5,"module":"packages/core","nloc":1330,"performance_score":10.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 1.8% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.12,"share_of_repo_gap_pct":0.9,"total_deduction":8.88,"weighted_deficit":9150},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/analysis/decisions/extractor.py","has_test_file":true,"is_test":false,"line_coverage_pct":59.51,"maintainability_score":2.2,"max_ccn":24,"max_nesting":6,"module":"packages/core","nloc":1267,"performance_score":8.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 2.3% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.0,"share_of_repo_gap_pct":0.8,"total_deduction":9.92,"weighted_deficit":8869},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/analysis/kg_curation.py","has_test_file":true,"is_test":false,"line_coverage_pct":93.19,"maintainability_score":2.0,"max_ccn":90,"max_nesting":4,"module":"packages/core","nloc":1411,"performance_score":9.58,"primary_biomarker":"co_change_scatter","primary_reason":"co-changes with 25 distinct files \u2014 editing this file tends to ripple across the codebase (shotgun surgery)","score":1.73,"share_of_repo_gap_pct":0.8,"total_deduction":8.263,"weighted_deficit":8847},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/persistence/crud/decisions.py","has_test_file":true,"is_test":false,"line_coverage_pct":72.39,"maintainability_score":3.7,"max_ccn":73,"max_nesting":4,"module":"packages/core","nloc":1309,"performance_score":8.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 3.4% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.25,"share_of_repo_gap_pct":0.8,"total_deduction":8.754,"weighted_deficit":8836},{"branch_coverage_pct":null,"file_path":"packages/server/src/repowise/server/mcp_server/tool_answer/symbols.py","has_test_file":true,"is_test":false,"line_coverage_pct":80.2,"maintainability_score":4.0,"max_ccn":44,"max_nesting":5,"module":"packages/server","nloc":1243,"performance_score":8.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 1.3% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.71,"share_of_repo_gap_pct":0.7,"total_deduction":8.3,"weighted_deficit":7818},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/analysis/dead_code/analyzer.py","has_test_file":true,"is_test":false,"line_coverage_pct":91.47,"maintainability_score":3.1,"max_ccn":85,"max_nesting":5,"module":"packages/core","nloc":1198,"performance_score":8.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.2% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.71,"share_of_repo_gap_pct":0.7,"total_deduction":8.287,"weighted_deficit":7535},{"branch_coverage_pct":null,"file_path":"packages/cli/src/repowise/cli/helpers.py","has_test_file":true,"is_test":false,"line_coverage_pct":78.67,"maintainability_score":2.0,"max_ccn":24,"max_nesting":4,"module":"packages/cli","nloc":1082,"performance_score":9.3,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.4% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.15,"share_of_repo_gap_pct":0.7,"total_deduction":8.857,"weighted_deficit":7412},{"branch_coverage_pct":null,"file_path":"packages/server/src/repowise/server/routers/repos.py","has_test_file":true,"is_test":false,"line_coverage_pct":30.21,"maintainability_score":1.3,"max_ccn":22,"max_nesting":4,"module":"packages/server","nloc":1047,"performance_score":8.0,"primary_biomarker":"prior_defect","primary_reason":"6 bug-fixes touched this file in the last ~6 months; recent defect history is the strongest cost-effective predictor of further defects","score":1.0,"share_of_repo_gap_pct":0.7,"total_deduction":12.12,"weighted_deficit":7329},{"branch_coverage_pct":null,"file_path":"packages/cli/src/repowise/cli/commands/update_cmd/persistence.py","has_test_file":true,"is_test":false,"line_coverage_pct":86.49,"maintainability_score":1.3,"max_ccn":44,"max_nesting":4,"module":"packages/cli","nloc":1054,"performance_score":8.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.5% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.11,"share_of_repo_gap_pct":0.7,"total_deduction":8.885,"weighted_deficit":7262},{"branch_coverage_pct":null,"file_path":"packages/server/src/repowise/server/job_executor.py","has_test_file":true,"is_test":false,"line_coverage_pct":65.04,"maintainability_score":2.0,"max_ccn":48,"max_nesting":5,"module":"packages/server","nloc":1017,"performance_score":9.79,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 1.3% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.0,"share_of_repo_gap_pct":0.7,"total_deduction":9.39,"weighted_deficit":7119}],"high_leverage_files_emitted":20,"high_leverage_files_reduced_reason":"limit","high_leverage_files_total":1115,"kpis":{"average_health":6.94,"average_health_unweighted":8.35,"average_health_weighting":"nloc","band":"warning","file_count":3793,"history_average":1.43,"hotspot_health":4.35,"maintainability_average":7.94,"performance_analyzed_files":3791,"performance_average":9.73,"performance_coverage_pct":100.0,"performance_covered_files":3787,"performance_findings":974,"performance_findings_density_per_10k_loc":15.45,"performance_skipped_files":4,"performance_unsupported_languages":[["shell",4]],"performance_unsupported_languages_emitted":1,"performance_unsupported_languages_total":1,"structure_average":1.67,"worst_performer_path":"packages/server/src/repowise/server/routers/repos.py","worst_performer_score":1.0},"mode":"dashboard","performance_directive":{"advisory_total":272,"affected_call_sites_total":1,"boundary_kind":"db","execution_context":"production","file_path":"packages/core/src/repowise/core/persistence/crud/external_systems.py","investigate_total":539,"next_action":{"arguments":{"opportunity_id":"perf2_034ee9eced0e382bb3ea"},"tool":"get_health"},"observations_total":1,"opportunities_total":845,"opportunity_id":"perf2_034ee9eced0e382bb3ea","performance_model_version":2,"plan_ready_total":34,"plan_reason":"A stored performance plan addresses this exact opportunity.","plan_state":"available","prerequisites":[],"prerequisites_emitted":0,"prerequisites_total":0,"status":"plan_ready","title":"serial_await_in_loop reaching packages/core/src/repowise/core/persistence/crud/external_systems.py","why_ranked":[{"factor":"boundary_kind","points":4,"value":"db"},{"factor":"multiplier_shape","points":4,"value":"serial_await_in_loop"},{"factor":"execution_context","points":3,"value":"production"}],"why_ranked_emitted":3,"why_ranked_total":3},"recovery":{"high_leverage_files":{"call":"get_health(targets=[], include=[], repo=None, limit=50, only=['high_leverage_files'], refactoring_view='diversified', cursor=20)","remaining":1095}},"refactoring_directive":{"addresses_primary_problem":true,"confidence":"medium","effort_bucket":"M","fix_first":"packages/cli/src/repowise/cli/agent_targets/targets/hermes.py","judgment_steps":3,"lead_refactoring_type":"extract_method","mechanical_steps":2,"next_action":{"arguments":{"opportunity_id":"refop2_02242668954622a5d496"},"tool":"get_health"},"opportunities_total":628,"opportunity_id":"refop2_02242668954622a5d496","reason":"complex_method","recovers_health_points":1.5,"status":"available","steps":5},"scope":"all","secondary_rankings":{"modules":{"call":"get_health(repo=None, only=['modules'], limit=50)","total":12},"test_findings":{"call":"get_health(repo=None, only=['test_findings'], limit=50)","total":3063},"top_findings":{"call":"get_health(repo=None, only=['top_findings'], limit=50)","total":10202},"worst_files":{"call":"get_health(repo=None, only=['worst_files'], limit=50)","total":3793}}},"get_health:limit-100":{"_meta":{"completeness":{"capped":true,"reason":"limit_and_response_budget","shown":35,"total":1121},"contract_version":1,"embedder_degraded":false,"health_analysis":{"analyzed_at":"2026-09-09T10:32:48.965510","analyzed_commit":"920d1c973d64","live_verification":{"basis":"unavailable","source_bytes_verified":false},"recomputed_this_call":false,"refresh":{"command":"repowise update","precondition":"commit health-relevant working-tree changes first","required_before_comparison":true},"source":"stored_health_analysis","status":"available"},"health_analyzed_at":"2026-09-09T10:32:48.965510","health_analyzed_commit":"920d1c973d64","health_semantics":{"percentiles":{"direction":"higher means ranked above more files in the eligible stored population","freshness":"stored analysis; not recomputed by get_health","population":"the eligible repository files used by the stored analysis for that signal","public_raw_scale":"percentile_rank_0_to_100","stored_scale":"ratio_0_to_1"},"weighted_deficit_points":{"denominator":"gap_analysis.weighted_gross_gap_points","direction":"higher means the file contributes more to the eligible population's gross deficit from the Healthy threshold","interpretation":"a deterministic triage weight, not a probability, percentage, normalized score, or guaranteed improvement","numerator":"max(8.0 - file_score, 0.0) * max(nloc, 1)","scale":{"maximum":null,"minimum":0,"normalized":false},"unit":"health_score_points_x_nloc"}},"index_age_days":0,"indexed_commit":"920d1c973d64","omitted":{"refs":["repowise#d097411d1691","repowise#c561ee268912"],"restore":"Run `repowise expand <ref>` from the repo, or call get_symbol(\"repowise#<ref>\", query=...) to retrieve the omitted content.","tokens":10963},"reductions":[],"response_budget":{"limit_chars":24000,"serialized_chars":22424,"tier":"default"},"state":{"truncated":true},"timing_ms":487.5},"directive":{"fix_first":"packages/server/src/repowise/server/mcp_server/tool_health.py","next_action":"inspect matching plan via plan_via","plan_addresses_reason":true,"plan_via":"get_health(include=['refactoring'], only=['refactoring_plans'])","reason":"Brain Method: get_health is 975 lines, CCN 193, in a file imported by 105 others","recovers_points":15688,"recovers_points_compatibility":{"deprecated":true,"equivalent_value":true,"replacement":"recovers_weighted_deficit_points"},"recovers_weighted_deficit_points":15688,"share_of_repo_gap_pct":1.5,"then":["packages/ui/src/health/ai-prompt-builder.ts","packages/core/src/repowise/core/pipeline/persist.py"],"then_emitted":2,"then_total":2,"watch":{"biomarker":"change_entropy","note":"History-derived. Read it as context; there is nothing here to fix.","reason":"changes are scattered across noisy commits (top 0.6% among files eligible for change-entropy ranking); a strong history-based fault predictor"}},"distribution":{"bands":{"alert":{"files":212,"nloc":110556,"pct":17.5},"healthy":{"files":2678,"nloc":299568,"pct":47.5},"warning":{"files":903,"nloc":220758,"pct":35.0}},"total_files":3793,"total_nloc":630882},"gap_analysis":{"files_below_target":1115,"files_for_half_gap":48,"files_to_reach_target":166,"target_score":8.0,"weighted_gap_points":667877,"weighted_gross_gap_points":1066540},"high_leverage_files":[{"branch_coverage_pct":null,"file_path":"packages/server/src/repowise/server/mcp_server/tool_health.py","has_test_file":true,"is_test":false,"line_coverage_pct":74.71,"maintainability_score":3.1,"max_ccn":193,"max_nesting":4,"module":"packages/server","nloc":2254,"performance_score":10.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.6% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.04,"share_of_repo_gap_pct":1.5,"total_deduction":8.965,"weighted_deficit":15688},{"branch_coverage_pct":null,"file_path":"packages/ui/src/health/ai-prompt-builder.ts","has_test_file":true,"is_test":false,"line_coverage_pct":null,"maintainability_score":2.8,"max_ccn":56,"max_nesting":3,"module":"packages/ui","nloc":1911,"performance_score":10.0,"primary_biomarker":"co_change_scatter","primary_reason":"co-changes with 25 distinct files \u2014 editing this file tends to ripple across the codebase (shotgun surgery)","score":1.9,"share_of_repo_gap_pct":1.1,"total_deduction":8.097,"weighted_deficit":11657},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/pipeline/persist.py","has_test_file":true,"is_test":false,"line_coverage_pct":85.47,"maintainability_score":1.3,"max_ccn":29,"max_nesting":5,"module":"packages/core","nloc":1570,"performance_score":8.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.3% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.07,"share_of_repo_gap_pct":1.0,"total_deduction":8.928,"weighted_deficit":10880},{"branch_coverage_pct":null,"file_path":"packages/server/src/repowise/server/mcp_server/tool_why.py","has_test_file":true,"is_test":false,"line_coverage_pct":81.27,"maintainability_score":3.7,"max_ccn":19,"max_nesting":3,"module":"packages/server","nloc":1695,"performance_score":8.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.7% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.6,"share_of_repo_gap_pct":1.0,"total_deduction":8.399,"weighted_deficit":10848},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/pipeline/incremental.py","has_test_file":true,"is_test":false,"line_coverage_pct":85.35,"maintainability_score":1.3,"max_ccn":41,"max_nesting":4,"module":"packages/core","nloc":1555,"performance_score":10.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.3% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.06,"share_of_repo_gap_pct":1.0,"total_deduction":8.925,"weighted_deficit":10792},{"branch_coverage_pct":null,"file_path":"packages/cli/src/repowise/cli/commands/update_cmd/command.py","has_test_file":true,"is_test":false,"line_coverage_pct":69.6,"maintainability_score":1.3,"max_ccn":188,"max_nesting":5,"module":"packages/cli","nloc":1517,"performance_score":10.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.2% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.0,"share_of_repo_gap_pct":1.0,"total_deduction":9.574,"weighted_deficit":10619},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/ingestion/parser.py","has_test_file":true,"is_test":false,"line_coverage_pct":92.35,"maintainability_score":3.1,"max_ccn":134,"max_nesting":7,"module":"packages/core","nloc":1650,"performance_score":10.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.2% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.74,"share_of_repo_gap_pct":1.0,"total_deduction":8.252,"weighted_deficit":10329},{"branch_coverage_pct":null,"file_path":"packages/cli/src/repowise/cli/commands/init_cmd/command.py","has_test_file":true,"is_test":false,"line_coverage_pct":75.35,"maintainability_score":2.4,"max_ccn":140,"max_nesting":4,"module":"packages/cli","nloc":1404,"performance_score":10.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.2% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.0,"share_of_repo_gap_pct":0.9,"total_deduction":9.288,"weighted_deficit":9828},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/ingestion/call_resolver.py","has_test_file":true,"is_test":false,"line_coverage_pct":91.47,"maintainability_score":3.3,"max_ccn":34,"max_nesting":5,"module":"packages/core","nloc":1558,"performance_score":10.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.3% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.81,"share_of_repo_gap_pct":0.9,"total_deduction":8.189,"weighted_deficit":9644},{"branch_coverage_pct":null,"file_path":"packages/cli/src/repowise/cli/commands/workspace_cmd.py","has_test_file":true,"is_test":false,"line_coverage_pct":72.45,"maintainability_score":1.3,"max_ccn":29,"max_nesting":4,"module":"packages/cli","nloc":1340,"performance_score":8.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 1.4% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.0,"share_of_repo_gap_pct":0.9,"total_deduction":9.451,"weighted_deficit":9380},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/ingestion/parser_helpers.py","has_test_file":true,"is_test":false,"line_coverage_pct":73.03,"maintainability_score":3.4,"max_ccn":20,"max_nesting":5,"module":"packages/core","nloc":1330,"performance_score":10.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 1.8% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.12,"share_of_repo_gap_pct":0.9,"total_deduction":8.88,"weighted_deficit":9150},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/analysis/decisions/extractor.py","has_test_file":true,"is_test":false,"line_coverage_pct":59.51,"maintainability_score":2.2,"max_ccn":24,"max_nesting":6,"module":"packages/core","nloc":1267,"performance_score":8.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 2.3% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.0,"share_of_repo_gap_pct":0.8,"total_deduction":9.92,"weighted_deficit":8869},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/analysis/kg_curation.py","has_test_file":true,"is_test":false,"line_coverage_pct":93.19,"maintainability_score":2.0,"max_ccn":90,"max_nesting":4,"module":"packages/core","nloc":1411,"performance_score":9.58,"primary_biomarker":"co_change_scatter","primary_reason":"co-changes with 25 distinct files \u2014 editing this file tends to ripple across the codebase (shotgun surgery)","score":1.73,"share_of_repo_gap_pct":0.8,"total_deduction":8.263,"weighted_deficit":8847},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/persistence/crud/decisions.py","has_test_file":true,"is_test":false,"line_coverage_pct":72.39,"maintainability_score":3.7,"max_ccn":73,"max_nesting":4,"module":"packages/core","nloc":1309,"performance_score":8.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 3.4% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.25,"share_of_repo_gap_pct":0.8,"total_deduction":8.754,"weighted_deficit":8836},{"branch_coverage_pct":null,"file_path":"packages/server/src/repowise/server/mcp_server/tool_answer/symbols.py","has_test_file":true,"is_test":false,"line_coverage_pct":80.2,"maintainability_score":4.0,"max_ccn":44,"max_nesting":5,"module":"packages/server","nloc":1243,"performance_score":8.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 1.3% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.71,"share_of_repo_gap_pct":0.7,"total_deduction":8.3,"weighted_deficit":7818},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/analysis/dead_code/analyzer.py","has_test_file":true,"is_test":false,"line_coverage_pct":91.47,"maintainability_score":3.1,"max_ccn":85,"max_nesting":5,"module":"packages/core","nloc":1198,"performance_score":8.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.2% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.71,"share_of_repo_gap_pct":0.7,"total_deduction":8.287,"weighted_deficit":7535},{"branch_coverage_pct":null,"file_path":"packages/cli/src/repowise/cli/helpers.py","has_test_file":true,"is_test":false,"line_coverage_pct":78.67,"maintainability_score":2.0,"max_ccn":24,"max_nesting":4,"module":"packages/cli","nloc":1082,"performance_score":9.3,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.4% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.15,"share_of_repo_gap_pct":0.7,"total_deduction":8.857,"weighted_deficit":7412},{"branch_coverage_pct":null,"file_path":"packages/server/src/repowise/server/routers/repos.py","has_test_file":true,"is_test":false,"line_coverage_pct":30.21,"maintainability_score":1.3,"max_ccn":22,"max_nesting":4,"module":"packages/server","nloc":1047,"performance_score":8.0,"primary_biomarker":"prior_defect","primary_reason":"6 bug-fixes touched this file in the last ~6 months; recent defect history is the strongest cost-effective predictor of further defects","score":1.0,"share_of_repo_gap_pct":0.7,"total_deduction":12.12,"weighted_deficit":7329},{"branch_coverage_pct":null,"file_path":"packages/cli/src/repowise/cli/commands/update_cmd/persistence.py","has_test_file":true,"is_test":false,"line_coverage_pct":86.49,"maintainability_score":1.3,"max_ccn":44,"max_nesting":4,"module":"packages/cli","nloc":1054,"performance_score":8.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.5% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.11,"share_of_repo_gap_pct":0.7,"total_deduction":8.885,"weighted_deficit":7262},{"branch_coverage_pct":null,"file_path":"packages/server/src/repowise/server/job_executor.py","has_test_file":true,"is_test":false,"line_coverage_pct":65.04,"maintainability_score":2.0,"max_ccn":48,"max_nesting":5,"module":"packages/server","nloc":1017,"performance_score":9.79,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 1.3% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.0,"share_of_repo_gap_pct":0.7,"total_deduction":9.39,"weighted_deficit":7119},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/ingestion/traverser.py","has_test_file":true,"is_test":false,"line_coverage_pct":91.54,"maintainability_score":2.8,"max_ccn":21,"max_nesting":5,"module":"packages/core","nloc":1020,"performance_score":8.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.8% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.66,"share_of_repo_gap_pct":0.6,"total_deduction":8.337,"weighted_deficit":6467},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/analysis/health/engine.py","has_test_file":true,"is_test":false,"line_coverage_pct":81.77,"maintainability_score":1.3,"max_ccn":30,"max_nesting":4,"module":"packages/core","nloc":922,"performance_score":9.58,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.3% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.0,"share_of_repo_gap_pct":0.6,"total_deduction":9.076,"weighted_deficit":6454},{"branch_coverage_pct":null,"file_path":"packages/cli/src/repowise/cli/commands/decision_cmd.py","has_test_file":true,"is_test":false,"line_coverage_pct":16.05,"maintainability_score":3.4,"max_ccn":19,"max_nesting":4,"module":"packages/cli","nloc":852,"performance_score":9.3,"primary_biomarker":"co_change_scatter","primary_reason":"co-changes with 25 distinct files \u2014 editing this file tends to ripple across the codebase (shotgun surgery)","score":1.0,"share_of_repo_gap_pct":0.6,"total_deduction":11.8,"weighted_deficit":5964},{"branch_coverage_pct":null,"file_path":"packages/cli/src/repowise/cli/ui/provider_selection.py","has_test_file":true,"is_test":false,"line_coverage_pct":58.2,"maintainability_score":3.1,"max_ccn":22,"max_nesting":4,"module":"packages/cli","nloc":851,"performance_score":8.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 3.5% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.0,"share_of_repo_gap_pct":0.6,"total_deduction":9.919,"weighted_deficit":5957},{"branch_coverage_pct":null,"file_path":"packages/cli/src/repowise/cli/commands/hook_cmd.py","has_test_file":false,"is_test":false,"line_coverage_pct":74.29,"maintainability_score":3.3,"max_ccn":26,"max_nesting":4,"module":"packages/cli","nloc":847,"performance_score":8.0,"primary_biomarker":"prior_defect","primary_reason":"7 bug-fixes touched this file in the last ~6 months; recent defect history is the strongest cost-effective predictor of further defects","score":1.12,"share_of_repo_gap_pct":0.5,"total_deduction":8.879,"weighted_deficit":5827},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/workspace/cross_repo.py","has_test_file":true,"is_test":false,"line_coverage_pct":84.36,"maintainability_score":1.3,"max_ccn":33,"max_nesting":7,"module":"packages/core","nloc":832,"performance_score":8.0,"primary_biomarker":"co_change_scatter","primary_reason":"co-changes with 25 distinct files \u2014 editing this file tends to ripple across the codebase (shotgun surgery)","score":1.02,"share_of_repo_gap_pct":0.5,"total_deduction":8.976,"weighted_deficit":5807},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/workspace/update.py","has_test_file":true,"is_test":false,"line_coverage_pct":87.58,"maintainability_score":2.0,"max_ccn":26,"max_nesting":6,"module":"packages/core","nloc":891,"performance_score":8.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.8% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.5,"share_of_repo_gap_pct":0.5,"total_deduction":8.502,"weighted_deficit":5792},{"branch_coverage_pct":null,"file_path":"packages/server/src/repowise/server/mcp_server/tool_overview.py","has_test_file":true,"is_test":false,"line_coverage_pct":90.23,"maintainability_score":3.1,"max_ccn":21,"max_nesting":4,"module":"packages/server","nloc":912,"performance_score":8.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 0.9% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.66,"share_of_repo_gap_pct":0.5,"total_deduction":8.34,"weighted_deficit":5782},{"branch_coverage_pct":null,"file_path":"packages/core/src/repowise/core/ingestion/git_indexer/indexer.py","has_test_file":true,"is_test":false,"line_coverage_pct":85.98,"maintainability_score":2.0,"max_ccn":28,"max_nesting":4,"module":"packages/core","nloc":861,"performance_score":10.0,"primary_biomarker":"change_entropy","primary_reason":"changes are scattered across noisy commits (top 1.6% among files eligible for change-entropy ranking); a strong history-based fault predictor","score":1.44,"share_of_repo_gap_pct":0.5,"total_deduction":8.555,"weighted_deficit":5648}],"high_leverage_files_emitted":29,"high_leverage_files_omitted":1086,"high_leverage_files_reduced_reason":"limit_and_response_budget","high_leverage_files_total":1115,"high_leverage_files_truncated":true,"kpis":{"average_health":6.94,"average_health_unweighted":8.35,"average_health_weighting":"nloc","band":"warning","file_count":3793,"history_average":1.43,"hotspot_health":4.35,"maintainability_average":7.94,"performance_analyzed_files":3791,"performance_average":9.73,"performance_coverage_pct":100.0,"performance_covered_files":3787,"performance_findings":974,"performance_findings_density_per_10k_loc":15.45,"performance_skipped_files":4,"performance_unsupported_languages":[["shell",4]],"performance_unsupported_languages_emitted":1,"performance_unsupported_languages_total":1,"structure_average":1.67,"worst_performer_path":"packages/server/src/repowise/server/routers/repos.py","worst_performer_score":1.0},"mode":"dashboard","omission_marker":"[repowise#c561ee268912: 25 lines omitted (~176 tokens); restore: repowise expand c561ee268912]","performance_directive":{"advisory_total":272,"affected_call_sites_total":1,"boundary_kind":"db","execution_context":"production","file_path":"packages/core/src/repowise/core/persistence/crud/external_systems.py","investigate_total":539,"next_action":{"arguments":{"opportunity_id":"perf2_034ee9eced0e382bb3ea"},"tool":"get_health"},"observations_total":1,"opportunities_total":845,"opportunity_id":"perf2_034ee9eced0e382bb3ea","performance_model_version":2,"plan_ready_total":34,"plan_reason":"A stored performance plan addresses this exact opportunity.","plan_state":"available","prerequisites":[],"prerequisites_emitted":0,"prerequisites_total":0,"status":"plan_ready","title":"serial_await_in_loop reaching packages/core/src/repowise/core/persistence/crud/external_systems.py","why_ranked":[{"factor":"boundary_kind","points":4,"value":"db"},{"factor":"multiplier_shape","points":4,"value":"serial_await_in_loop"},{"factor":"execution_context","points":3,"value":"production"}],"why_ranked_emitted":3,"why_ranked_total":3},"recovery":{"high_leverage_files":{"call":"get_health(targets=[], include=[], repo=None, limit=50, only=['high_leverage_files'], refactoring_view='diversified', cursor=100)","remaining":1015}},"refactoring_directive":{"addresses_primary_problem":true,"confidence":"medium","effort_bucket":"M","fix_first":"packages/cli/src/repowise/cli/agent_targets/targets/hermes.py","judgment_steps":3,"lead_refactoring_type":"extract_method","mechanical_steps":2,"next_action":{"arguments":{"opportunity_id":"refop2_02242668954622a5d496"},"tool":"get_health"},"opportunities_total":628,"opportunity_id":"refop2_02242668954622a5d496","reason":"complex_method","recovers_health_points":1.5,"status":"available","steps":5},"scope":"all","truncated":true},"get_overview:all-includes":{"_meta":{"completeness":{"capped":false},"contract_version":1,"embedder_degraded":false,"index_age_days":0,"indexed_commit":"920d1c973d64","omitted":{"refs":["repowise#4e8f0bb0e304"],"restore":"Run `repowise expand <ref>` from the repo, or call get_symbol(\"repowise#<ref>\", query=...) to retrieve the omitted content.","tokens":1376},"response_budget":{"limit_chars":32000,"serialized_chars":7934,"tier":"expanded"},"state":{"truncated":true}},"architecture":{"layer_order":["UI","CLI","Application","API","Config","Utility","Data","Types","Service","Docs & Tooling","Test"],"layers":[{"file_count":641,"name":"Contributor 2"},{"file_count":261,"name":"Contributor 6"},{"file_count":191,"name":"Contributor 15"},{"file_count":92,"name":"Contributor 12"},{"file_count":28,"name":"Contributor 10"},{"file_count":52,"name":"Contributor 17"},{"file_count":60,"name":"Contributor 13"},{"file_count":81,"name":"Contributor 18"},{"file_count":981,"name":"Contributor 4"},{"file_count":220,"name":"Contributor 8"},{"file_count":1478,"name":"Contributor 11"}],"tour_available":true,"tour_step_count":12},"code_health":{"average_health":6.94,"band":"warning","distribution":{"bands":{"alert":{"files":212,"nloc":110556,"pct":17.5},"healthy":{"files":2678,"nloc":299568,"pct":47.5},"warning":{"files":903,"nloc":220758,"pct":35.0}},"total_files":3793,"total_nloc":630882},"file_count":3793,"hotspot_health":4.35,"open_findings":14239,"worst_performer_path":"packages/server/src/repowise/server/routers/repos.py","worst_performer_score":1.0},"content_hint":"Overview essay trimmed to its summary section. Call get_overview(include=[\"content\"]) for the full walkthrough.","content_md":"## Project Summary\n\nRepowise consumes source repositories and configuration files, walks and parses them through language-specific ingestion, persists and analyzes the resulting code graph, and generates documentation, health insights, and interactive views exposed through CLI, MCP/server APIs, web apps, and VS Code.\n\nIt is a Python/TypeScript monorepo organized around a shared analysis engine and several presentation surfaces. The repository contains 3,659 files and approximately 740k lines of code; dependency analysis reports 18 circular dependencies. Recent hotspots include dead-code analysis, MCP answer generation, and the web sidebar.","entry_points":["packages/server/src/repowise/server/app.py","packages/cli/src/repowise/cli/main.py","packages/vscode/webview/src/views/risk/App.tsx","packages/vscode/webview/src/views/decisions/App.tsx","packages/vscode/webview/src/views/settings/App.tsx","packages/vscode/webview/src/views/architecture/App.tsx","packages/vscode/webview/src/views/home/App.tsx","packages/vscode/webview/src/views/refactoring/App.tsx"],"git_health":{"avg_bus_factor":1.2,"churn_trend":"increasing","files_git_attributed":4136,"files_with_bus_factor_1":3339,"hotspot_count":419,"top_churn_modules":["packages/core","tests/unit","packages/ui","packages/server","packages/web"]},"key_modules":[{"name":"Contributor 3","path":"packages/api-client","section":"6"},{"name":"Contributor 14","path":"packages/api-client/src","section":"7"},{"name":"Contributor 5","path":"packages/vscode/src/features","section":"8"},{"name":"Contributor 9","path":"packages/vscode/webview/src/runtime","section":"9"},{"name":"Contributor 7","path":"packages/web","section":"10"},{"name":"Contributor 21","path":"packages/web/src/app/repos/[id]","section":"11"},{"name":"Contributor 1","path":"packages/web/src/app/repos/[id]/docs","section":"11.1"},{"name":"Contributor 16","path":"packages/web/src/app/repos/[id]/settings","section":"11.2"}],"more":"get_overview(include=[...]) also serves: \"outline\" (the wiki page tree), \"tour\" (guided_tour + reading_order), \"decisions\", \"graph\" (code communities), \"ownership\" (top owners, silos), \"content\" (the full essay).","omission_marker":"[repowise#4e8f0bb0e304: 90 lines omitted (~1376 tokens); restore: repowise expand 4e8f0bb0e304]","title":"Repository Overview: repowise","tool_surface":{"counts":{"default":10,"eligible":13,"enabled":10,"opt_in_available":3,"tiers":{"canonical":10}},"enabled":["get_answer","get_context","get_symbol","search_codebase","get_risk","get_change_risk","get_why","get_overview","get_health","get_dead_code"],"mode":"single_repo","opt_in":[{"description":"Find how two files/modules are connected in the dependency graph.","enabled":false,"name":"get_dependency_path"},{"description":"Show how the codebase executes: top entry points and their call traces.","enabled":false,"name":"get_execution_flows"},{"description":"Generate refactored code + a unified diff for one refactoring plan.","enabled":false,"name":"generate_refactoring_code"}],"recipes":[{"call":"get_answer(question=\"how does X work?\")","name":"answer_question"},{"call":"get_context(targets=[\"path\"], include=[\"skeleton\"])","name":"read_file_shape"},{"call":"search_codebase(query=\"identifier or path\", mode=\"auto\")","name":"find_raw_hits"},{"call":"get_risk(targets=[\"path\"])","name":"assess_hotspot"},{"call":"get_risk(targets=[\"path\"], changed_files=[\"path\"])","name":"review_change"},{"call":"get_why(targets=[\"path\"])","name":"read_rationale"},{"call":"get_health(only=[\"directive\"])","name":"health_directive"},{"call":"get_health(targets=[\"path\"], include=[\"refactoring\"])","name":"health_file_self_check"},{"call":"get_health(targets=[\"module:path\"], only=[\"modules\",\"metrics\"])","name":"health_module_triage"},{"call":"get_health(include=[\"trend\"], only=[\"trend\"])","name":"health_trend"},{"call":"get_health(include=[\"accuracy\"], only=[\"accuracy\"])","name":"health_accuracy"},{"call":"get_health(include=[\"coverage\"], only=[\"coverage\"])","name":"health_coverage"},{"call":"get_health(include=[\"performance\",\"refactoring\"], only=[\"performance_opportunities\",\"refactoring_plans\"])","name":"health_performance_refactoring"},{"call":"get_health(include=[\"performance\"], only=[\"performance_summary\"])","name":"health_performance_summary"},{"call":"get_health(opportunity_id=\"perf...\")","name":"health_performance_opportunity"},{"call":"get_health(opportunity_id=\"perf...\", only=[\"performance_evidence\"], cursor=0)","name":"health_performance_evidence"}],"tools":[{"default":true,"description":"Answer a how, where, or why question in one evidence-grounded call.","name":"get_answer","tier":"canonical"},{"default":true,"description":"Triage card for files / modules / symbols \u2014 relationships, not source bytes.","name":"get_context","tier":"canonical"},{"default":true,"description":"Follow-up read of one symbol whose id another response already gave you.","name":"get_symbol","tier":"canonical"},{"default":true,"description":"Find code by concept, symbol, or path \u2014 hybrid codebase search.","name":"search_codebase","tier":"canonical"},{"default":true,"description":"What history says about touching these files \u2014 bug fixes, churn, owners.","name":"get_risk","tier":"canonical"},{"default":true,"description":"Review a commit, ``base..head`` range, or uncommitted work.","name":"get_change_risk","tier":"canonical"},{"default":true,"description":"Why this code is shaped this way \u2014 decision records + evidence commits.","name":"get_why","tier":"canonical"},{"default":true,"description":"Architecture map for an unfamiliar repo \u2014 first call when you don't know your way around.","name":"get_overview","tier":"canonical"},{"default":true,"description":"Code-health scores and findings from stored analysis.","name":"get_health","tier":"canonical"},{"default":true,"description":"Unused exports, unreachable files, zombie packages \u2014 tiered by confidence.","name":"get_dead_code","tier":"canonical"}]}},"get_overview:default":{"_meta":{"completeness":{"capped":false},"contract_version":1,"embedder_degraded":false,"index_age_days":0,"indexed_commit":"920d1c973d64","omitted":{"refs":["repowise#4e8f0bb0e304"],"restore":"Run `repowise expand <ref>` from the repo, or call get_symbol(\"repowise#<ref>\", query=...) to retrieve the omitted content.","tokens":1376},"response_budget":{"limit_chars":24000,"serialized_chars":7933,"tier":"default"},"state":{"truncated":true}},"architecture":{"layer_order":["UI","CLI","Application","API","Config","Utility","Data","Types","Service","Docs & Tooling","Test"],"layers":[{"file_count":641,"name":"Contributor 2"},{"file_count":261,"name":"Contributor 6"},{"file_count":191,"name":"Contributor 15"},{"file_count":92,"name":"Contributor 12"},{"file_count":28,"name":"Contributor 10"},{"file_count":52,"name":"Contributor 17"},{"file_count":60,"name":"Contributor 13"},{"file_count":81,"name":"Contributor 18"},{"file_count":981,"name":"Contributor 4"},{"file_count":220,"name":"Contributor 8"},{"file_count":1478,"name":"Contributor 11"}],"tour_available":true,"tour_step_count":12},"code_health":{"average_health":6.94,"band":"warning","distribution":{"bands":{"alert":{"files":212,"nloc":110556,"pct":17.5},"healthy":{"files":2678,"nloc":299568,"pct":47.5},"warning":{"files":903,"nloc":220758,"pct":35.0}},"total_files":3793,"total_nloc":630882},"file_count":3793,"hotspot_health":4.35,"open_findings":14239,"worst_performer_path":"packages/server/src/repowise/server/routers/repos.py","worst_performer_score":1.0},"content_hint":"Overview essay trimmed to its summary section. Call get_overview(include=[\"content\"]) for the full walkthrough.","content_md":"## Project Summary\n\nRepowise consumes source repositories and configuration files, walks and parses them through language-specific ingestion, persists and analyzes the resulting code graph, and generates documentation, health insights, and interactive views exposed through CLI, MCP/server APIs, web apps, and VS Code.\n\nIt is a Python/TypeScript monorepo organized around a shared analysis engine and several presentation surfaces. The repository contains 3,659 files and approximately 740k lines of code; dependency analysis reports 18 circular dependencies. Recent hotspots include dead-code analysis, MCP answer generation, and the web sidebar.","entry_points":["packages/server/src/repowise/server/app.py","packages/cli/src/repowise/cli/main.py","packages/vscode/webview/src/views/risk/App.tsx","packages/vscode/webview/src/views/decisions/App.tsx","packages/vscode/webview/src/views/settings/App.tsx","packages/vscode/webview/src/views/architecture/App.tsx","packages/vscode/webview/src/views/home/App.tsx","packages/vscode/webview/src/views/refactoring/App.tsx"],"git_health":{"avg_bus_factor":1.2,"churn_trend":"increasing","files_git_attributed":4136,"files_with_bus_factor_1":3339,"hotspot_count":419,"top_churn_modules":["packages/core","tests/unit","packages/ui","packages/server","packages/web"]},"key_modules":[{"name":"Contributor 3","path":"packages/api-client","section":"6"},{"name":"Contributor 14","path":"packages/api-client/src","section":"7"},{"name":"Contributor 5","path":"packages/vscode/src/features","section":"8"},{"name":"Contributor 9","path":"packages/vscode/webview/src/runtime","section":"9"},{"name":"Contributor 7","path":"packages/web","section":"10"},{"name":"Contributor 21","path":"packages/web/src/app/repos/[id]","section":"11"},{"name":"Contributor 1","path":"packages/web/src/app/repos/[id]/docs","section":"11.1"},{"name":"Contributor 16","path":"packages/web/src/app/repos/[id]/settings","section":"11.2"}],"more":"get_overview(include=[...]) also serves: \"outline\" (the wiki page tree), \"tour\" (guided_tour + reading_order), \"decisions\", \"graph\" (code communities), \"ownership\" (top owners, silos), \"content\" (the full essay).","omission_marker":"[repowise#4e8f0bb0e304: 90 lines omitted (~1376 tokens); restore: repowise expand 4e8f0bb0e304]","title":"Repository Overview: repowise","tool_surface":{"counts":{"default":10,"eligible":13,"enabled":10,"opt_in_available":3,"tiers":{"canonical":10}},"enabled":["get_answer","get_context","get_symbol","search_codebase","get_risk","get_change_risk","get_why","get_overview","get_health","get_dead_code"],"mode":"single_repo","opt_in":[{"description":"Find how two files/modules are connected in the dependency graph.","enabled":false,"name":"get_dependency_path"},{"description":"Show how the codebase executes: top entry points and their call traces.","enabled":false,"name":"get_execution_flows"},{"description":"Generate refactored code + a unified diff for one refactoring plan.","enabled":false,"name":"generate_refactoring_code"}],"recipes":[{"call":"get_answer(question=\"how does X work?\")","name":"answer_question"},{"call":"get_context(targets=[\"path\"], include=[\"skeleton\"])","name":"read_file_shape"},{"call":"search_codebase(query=\"identifier or path\", mode=\"auto\")","name":"find_raw_hits"},{"call":"get_risk(targets=[\"path\"])","name":"assess_hotspot"},{"call":"get_risk(targets=[\"path\"], changed_files=[\"path\"])","name":"review_change"},{"call":"get_why(targets=[\"path\"])","name":"read_rationale"},{"call":"get_health(only=[\"directive\"])","name":"health_directive"},{"call":"get_health(targets=[\"path\"], include=[\"refactoring\"])","name":"health_file_self_check"},{"call":"get_health(targets=[\"module:path\"], only=[\"modules\",\"metrics\"])","name":"health_module_triage"},{"call":"get_health(include=[\"trend\"], only=[\"trend\"])","name":"health_trend"},{"call":"get_health(include=[\"accuracy\"], only=[\"accuracy\"])","name":"health_accuracy"},{"call":"get_health(include=[\"coverage\"], only=[\"coverage\"])","name":"health_coverage"},{"call":"get_health(include=[\"performance\",\"refactoring\"], only=[\"performance_opportunities\",\"refactoring_plans\"])","name":"health_performance_refactoring"},{"call":"get_health(include=[\"performance\"], only=[\"performance_summary\"])","name":"health_performance_summary"},{"call":"get_health(opportunity_id=\"perf...\")","name":"health_performance_opportunity"},{"call":"get_health(opportunity_id=\"perf...\", only=[\"performance_evidence\"], cursor=0)","name":"health_performance_evidence"}],"tools":[{"default":true,"description":"Answer a how, where, or why question in one evidence-grounded call.","name":"get_answer","tier":"canonical"},{"default":true,"description":"Triage card for files / modules / symbols \u2014 relationships, not source bytes.","name":"get_context","tier":"canonical"},{"default":true,"description":"Follow-up read of one symbol whose id another response already gave you.","name":"get_symbol","tier":"canonical"},{"default":true,"description":"Find code by concept, symbol, or path \u2014 hybrid codebase search.","name":"search_codebase","tier":"canonical"},{"default":true,"description":"What history says about touching these files \u2014 bug fixes, churn, owners.","name":"get_risk","tier":"canonical"},{"default":true,"description":"Review a commit, ``base..head`` range, or uncommitted work.","name":"get_change_risk","tier":"canonical"},{"default":true,"description":"Why this code is shaped this way \u2014 decision records + evidence commits.","name":"get_why","tier":"canonical"},{"default":true,"description":"Architecture map for an unfamiliar repo \u2014 first call when you don't know your way around.","name":"get_overview","tier":"canonical"},{"default":true,"description":"Code-health scores and findings from stored analysis.","name":"get_health","tier":"canonical"},{"default":true,"description":"Unused exports, unreachable files, zombie packages \u2014 tiered by confidence.","name":"get_dead_code","tier":"canonical"}]}},"get_risk:one-target":{"_meta":{"completeness":{"capped":true,"reason":"construction_cap","shown":5,"total":25},"contract_version":1,"embedder_degraded":false,"floor":["co_change_partners_total","dependents_count"],"index_age_days":0,"indexed_commit":"920d1c973d64","omitted":{"refs":["repowise#160ca2a7eeeb"],"restore":"Run `repowise expand <ref>` from the repo, or call get_symbol(\"repowise#<ref>\", query=...) to retrieve the omitted content.","tokens":1810},"response_budget":{"limit_chars":24000,"serialized_chars":3742,"tier":"default"},"state":{"truncated":true}},"omission_marker":"[repowise#160ca2a7eeeb: 258 lines omitted (~1810 tokens); restore: repowise expand 160ca2a7eeeb]","targets":{"packages/core/src/repowise/core/ingestion/call_resolver.py":{"bus_factor":1,"co_change_partners":[{"direction":"undirected","evidence_kind":"historical","file_path":"tests/unit/ingestion/test_call_resolver_strategies.py","has_import_link":true,"has_structural_link":true,"last_co_change":"2026-08-23","provenance":"git_history","relationship_type":"co_change","structural_relationship_types":["imports"],"support":6,"weight":2.906},{"direction":"undirected","evidence_kind":"historical","file_path":"packages/core/src/repowise/core/ingestion/languages/receiver_types.py","has_import_link":true,"has_structural_link":true,"last_co_change":"2026-08-25","provenance":"git_history","relationship_type":"co_change","structural_relationship_types":["imports"],"support":9,"weight":2.799},{"direction":"undirected","evidence_kind":"historical","file_path":"packages/core/src/repowise/core/ingestion/models.py","has_import_link":true,"has_structural_link":true,"last_co_change":"2026-08-30","provenance":"git_history","relationship_type":"co_change","structural_relationship_types":["imports"],"support":20,"weight":2.578},{"direction":"undirected","evidence_kind":"historical","file_path":"tests/unit/ingestion/test_receiver_types.py","has_import_link":false,"has_structural_link":false,"last_co_change":"2026-08-25","provenance":"git_history","relationship_type":"co_change","support":7,"weight":2.315},{"direction":"undirected","evidence_kind":"historical","file_path":"packages/core/src/repowise/core/ingestion/parser.py","has_import_link":false,"has_structural_link":false,"last_co_change":"2026-09-04","provenance":"git_history","relationship_type":"co_change","support":17,"weight":1.567}],"co_change_partners_emitted":5,"co_change_partners_omitted":20,"co_change_partners_reduced_reason":"construction_cap","co_change_partners_total":25,"co_change_partners_truncated":true,"commit_count_capped":false,"contributor_count":3,"coverage_pct":91.47,"defect_profile":{"bug_magnet":true,"fix_count":22,"last_fix_days_ago":10,"top_symbols":{"__init__":5,"_link_declarations":4,"_published":3},"window":"6 months"},"dependents_count":11,"episodes":21,"health_score":1.81,"hotspot_score":0.9995,"is_hotspot":true,"owner_pct":0.9412,"primary_owner":"Contributor 19","recent_owner":"Contributor 19","recent_owner_pct":0.9412,"risk_summary":"packages/core/src/repowise/core/ingestion/call_resolver.py \u2014 22 bug fixes in 6mo, last 10d ago (bug magnet), hotspot score 100% (increasing), 11 direct dependents, bug-prone, feature-active, 25 co-change partners, owned 94% by Contributor 19, bus factor risk (sole maintainer: Contributor 19)","security_signals":[],"target":"packages/core/src/repowise/core/ingestion/call_resolver.py","test_gap":false,"top_biomarkers":[{"biomarker_type":"change_entropy","function_name":null,"impact":1.18,"severity":"critical"},{"biomarker_type":"co_change_scatter","function_name":null,"impact":0.85,"severity":"high"},{"biomarker_type":"prior_defect","function_name":null,"impact":0.78,"severity":"critical"}],"trend":"increasing"}}},"get_symbol:largest-depth-3":{"_meta":{"completeness":{"capped":true},"contract_version":1,"embedder_degraded":false,"index_age_days":0,"indexed_commit":"920d1c973d64","omitted":{"refs":["repowise#63171fe88e36","repowise#bb943f58f05d"],"restore":"Run `repowise expand <ref>` from the repo, or call get_symbol(\"repowise#<ref>\", query=...) to retrieve the omitted content.","tokens":8087},"replaced_tokens":25149,"response_budget":{"limit_chars":24000,"serialized_chars":22623,"tier":"default"},"state":{"truncated":true},"timing_ms":6.7,"tokens_saved":19480},"continuation":"packages/core/src/repowise/core/ingestion/call_resolver.py:797-2117","continuation_reference":{"id":"packages/core/src/repowise/core/ingestion/call_resolver.py:797-2117","kind":"file_range","path":"packages/core/src/repowise/core/ingestion/call_resolver.py","range":[797,2117],"repository":"default","source_kind":"source","verification_basis":"live"},"end_line":796,"file":"packages/core/src/repowise/core/ingestion/call_resolver.py","kind":"class","name":"CallResolver","omission_marker":"[repowise#bb943f58f05d: 11 lines omitted (~136 tokens); restore: repowise expand bb943f58f05d]","qualified_name":"packages.core.src.repowise.core.ingestion.call_resolver.CallResolver","signature":"class CallResolver","source":" 197\t _JVM_STRATEGIES,\n 198\t free=(\"_resolve_java_same_package_unique\",),\n 199\t member_fallback=_TYPED_RECEIVER,\n 200\t ),\n 201\t \"kotlin\": replace(_JVM_STRATEGIES, member_fallback=_TYPED_RECEIVER),\n 202\t \"csharp\": _LanguageCallStrategies(member_fallback=_TYPED_RECEIVER),\n 203\t \"python\": _LanguageCallStrategies(member_fallback=_TYPED_RECEIVER),\n 204\t # Swift registers the fallback and nothing else: it has no package\n 205\t # tier of its own, so a typed receiver is looked for in the caller's\n 206\t # file, in what the file imports, and then in the global pair index.\n 207\t \"swift\": _LanguageCallStrategies(member_fallback=_TYPED_RECEIVER),\n 208\t \"cpp\": _CPP_STRATEGIES,\n 209\t \"c\": _CPP_STRATEGIES,\n 210\t}\n 211\t\n 212\t_SOURCE_CACHE_FILES = 4\n 213\t_BODY_TYPE_CACHE_ENTRIES = 2048\n 214\t\n 215\t# Phase admission is intentionally explicit. P16 lands the behavior-preserving\n 216\t# substrate with no language enabled; later phases add only measured lanes.\n 217\tPRODUCTION_RETURN_TYPE_CHAIN_LANGUAGES: frozenset[str] = frozenset({\"cpp\"})\n 218\t\n 219\t\n 220\t@dataclass(frozen=True, slots=True)\n 221\tclass ResolvedCall:\n 222\t \"\"\"A call resolved to concrete symbol IDs with a confidence score.\"\"\"\n 223\t\n 224\t caller_id: str # symbol node ID of the calling function/method\n 225\t callee_id: str # symbol node ID of the called function/method\n 226\t confidence: float # 0.0\u20131.0\n 227\t line: int # call site line number (for diagnostics)\n 228\t origin: ResolutionOrigin # which strategy below produced it\n 229\t edge_type: CallSiteEdgeType = \"calls\" # carried through from the CallSite\n 230\t supplied_props: frozenset[str] | None = None # prop names supplied in JSX element (None if unknown/spread)\n 231\t\n 232\t\n 233\tdef _same_translation_unit(decl_file: str, def_file: str) -> bool:\n 234\t \"\"\"Are these two paths the same C++ translation unit?\n 235\t\n 236\t Compared on the base name, because a public header rarely sits beside its\n 237\t implementation (``include/pkg/thing.h`` against ``src/thing.cc``). The\n 238\t include relation would be the better test, but a C++ include binds to the\n 239\t path as written and usually is not a file key.\n 240\t \"\"\"\n 241\t return (\n 242\t decl_file == def_file\n 243\t or PurePosixPath(decl_file).stem == PurePosixPath(def_file).stem\n 244\t )\n 245\t\n 246\t\n 247\tclass CallResolver:\n 248\t \"\"\"Resolve raw CallSites to symbol-level edges.\n 249\t\n 250\t Constructed once per ``GraphBuilder.build()`` call with the full set of\n 251\t parsed files and import edges, then driven one file at a time.\n 252\t\n 253\t ``resolve_file()`` is **not** safe to call concurrently. Several lazy\n 254\t caches are filled during resolution, and the capped ones evict wholesale.\n 255\t Every cached value is a pure function of state fixed at construction, so a\n 256\t race would cost recomputation rather than a wrong answer, but the eviction\n 257\t makes concurrent use pointless as well as unsupported.\n 258\t \"\"\"\n 259\t\n 260\t def __init__(\n 261\t self,\n 262\t parsed_files: dict[str, ParsedFile],\n 263\t import_targets: dict[str, set[str]],\n 264\t *,\n 265\t repo_path: str | None = None,\n 266\t import_maps: Any | None = None,\n 267\t heritage_parents: dict[str, set[str]] | None = None,\n 268\t return_type_chain_languages: frozenset[str] | None = None,\n 269\t ) -> None:\n 270\t # {type symbol id: parent type symbol ids}, from the caller's already\n 271\t # resolved heritage. Absent when the resolver is built standalone, in\n 272\t # which case the inherited tier simply never fires.\n 273\t self._heritage_parents: dict[str, set[str]] = heritage_parents or {}\n 274\t self._return_type_chain_languages = (\n 275\t PRODUCTION_RETURN_TYPE_CHAIN_LANGUAGES\n 276\t if return_type_chain_languages is None\n 277\t else return_type_chain_languages\n 278\t )\n 279\t self._ancestors: dict[str, tuple[str, ...]] = {}\n 280\t # Per-file symbol index: {file_path: {symbol_name: symbol_id}}\n 281\t self._file_symbols: dict[str, dict[str, str]] = {}\n 282\t\n 283\t # Per-file method index: {file_path: {(class_name, method_name): symbol_id}}\n 284\t self._file_methods: dict[str, dict[tuple[str, str], str]] = {}\n 285\t\n 286\t # Global method index: {(class_name, method_name): [(file_path, symbol_id)]}\n 287\t # in file-insertion order \u2014 replaces the trait-dispatch scan over\n 288\t # every file's method dict with one short-list lookup.\n 289\t self._global_methods: dict[tuple[str, str], list[tuple[str, str]]] = defaultdict(list)\n 290\t\n 291\t # Global symbol index: {name: [symbol_ids]} \u2014 for Tier 3\n 292\t self._global_symbols: dict[str, list[str]] = defaultdict(list)\n 293\t self._symbols_by_id = {\n 294\t symbol.id: symbol for parsed in parsed_files.values() for symbol in parsed.symbols\n 295\t }\n 296\t self._symbol_paths_by_id = {\n 297\t symbol.id: path\n 298\t for path, parsed in parsed_files.items()\n 299\t for symbol in parsed.symbols\n 300\t }\n 301\t self._overload_return_types: dict[tuple[str, str | None, str, int | None], set[str]] = (\n 302\t defaultdict(set)\n 303\t )\n 304\t for path, parsed in parsed_files.items():\n 305\t for symbol in parsed.symbols:\n 306\t raw_return = declared_return_type(symbol.signature or \"\")\n 307\t normalized = (\n 308\t normalize_return_type(raw_return, symbol.language) if raw_return else None\n 309\t )\n 310\t if normalized is not None:\n 311\t key = (\n 312\t path,\n 313\t symbol.parent_name,\n 314\t symbol.name,\n 315\t signature_parameter_count(symbol.signature or \"\"),\n 316\t )\n 317\t self._overload_return_types[key].add(normalized)\n 318\t self._known_type_names = frozenset(\n 319\t symbol.name for symbol in self._symbols_by_id.values() if symbol.kind in _TYPE_KINDS\n 320\t )\n 321\t\n 322\t # Symbols in the index above that are data members, not callables\n 323\t # Held as an id set rather than a full id->kind map: it is the only\n 324\t # kind question asked of it and the set is small.\n 325\t self._non_callable_ids: set[str] = set()\n 326\t self._property_accessor_ids: set[str] = set()\n 327\t\n 328\t # C/C++ forward declaration \u2192 the definition it declares. Populated by\n 329\t # ``_build_indices``; applied to every resolved call so the edge lands\n 330\t # on the body rather than the header line that announced it.\n 331\t self._decl_to_def: dict[str, str] = {}\n 332\t\n 333\t # Import graph: {file_path: set of imported file paths}\n 334\t self._import_targets = import_targets\n 335\t\n 336\t # Shared import-name maps (built once per GraphBuilder.build() and\n 337\t # injected; standalone construction builds them locally).\n 338\t if import_maps is None:\n 339\t from .import_index import build_import_name_maps\n 340\t\n 341\t import_maps = build_import_name_maps(parsed_files)\n 342\t # Import name mapping: {file_path: {local_name: source_file}}\n 343\t self._import_names: dict[str, dict[str, str]] = import_maps.import_names\n 344\t # Full binding data: {file_path: {local_name: NamedBinding}}\n 345\t self._import_bindings: dict[str, dict[str, NamedBinding]] = import_maps.import_bindings\n 346\t # Module alias mapping: {file_path: {alias: source_file}}\n 347\t self._module_aliases: dict[str, dict[str, str]] = import_maps.module_aliases\n 348\t\n 349\t # Lazy per-file merged views of every imported file's symbol /\n 350\t # method tables \u2014 turns the Tier-2b \"scan each imported file\"\n 351\t # loops into single dict lookups. Built on first miss per file;\n 352\t # merge order is sorted(import paths) with first-wins so shadowed\n 353\t # names resolve deterministically (the old set-iteration order was\n 354\t # hash-randomized per process).\n 355\t self._merged_import_symbols: dict[str, dict[str, str]] = {}\n 356\t self._merged_import_methods: dict[str, dict[tuple[str, str], str]] = {}\n 357\t\n 358\t # Lazy per-file set of (line, target) that also carry a receiver.\n 359\t self._member_shaped: dict[str, set[tuple[int, str]]] = {}\n 360\t\n 361\t # Receiver typing reads source text, so both caches are capped rather\n 362\t # than per-repo: files resolve one at a time, so a few slots always\n 363\t # hit, and the cap is what keeps a whole repo's source out of memory.\n 364\t # Scanning is memoised per *function*, not per reference \u2014 one scan\n 365\t # answers every unresolved receiver in a body.\n 366\t self._source_text: dict[str, str] = {}\n 367\t self._declarations: dict[str, tuple[Declaration, ...]] = {}\n 368\t self._symbol_spans: dict[str, dict[str, tuple[int, int]]] = {}\n 369\t self._body_types: dict[tuple[str, str], dict[str, str | None]] = {}\n 370\t self._field_types: dict[str, dict[str, dict[str, str | None]]] = {}\n 371\t self._bindings: dict[str, tuple[tuple[int, str], ...]] = {}\n 372\t self._bound_names: dict[tuple[str, str], frozenset[str]] = {}\n 373\t # {file: {name: type}} \u2014 module-level defs a framework decorator retyped.\n 374\t self._framework_types: dict[str, dict[str, str]] = {}\n 375\t self._external_names: dict[str, frozenset[str]] = {}\n 376\t self._repo_rebound_names: dict[str, frozenset[str]] = {}\n 377\t self._method_name_set: frozenset[str] | None = None\n 378\t self._framework_name_set: frozenset[str] | None = None\n 379\t\n 380\t # Barrel re-export origins: {barrel_file: {name: origin_file}}\n 381\t self._barrel_origins: dict[str, dict[str, str]] = defaultdict(dict)\n 382\t\n 383\t # Keep reference for cross-language checks in Tier 3\n 384\t self._parsed_files = parsed_files\n 385\t\n 386\t # Rust cross-crate resolution\n 387\t self._repo_path = repo_path\n 388\t self._rust_crate_src: dict[str, str] | None = None # lazy\n 389\t\n 390\t # Go package-scoped resolution (lazy GoPackageIndex). ``_go_index``\n 391\t # holds the built index; ``_go_index_built`` distinguishes \"not yet\n 392\t # built\" from \"built but unavailable\" (no repo_path / no go files).\n 393\t self._go_index: Any = None\n 394\t self._go_index_built = False\n 395\t\n 396\t # JVM same-package resolution (lazy JvmWorkspaceIndex)\n 397\t self._jvm_index: Any = None\n 398\t self._jvm_index_built = False\n 399\t\n 400\t # C/C++ same-target resolution (lazy CppWorkspaceIndex)\n 401\t self._cpp_index: Any = None\n 402\t self._cpp_index_built = False\n 403\t\n 404\t self._strategies_by_file: dict[str, _LanguageCallStrategies] = {}\n 405\t\n 406\t self._build_indices(parsed_files)\n 407\t self._follow_barrel_exports()\n 408\t\n 409\t def _follow_barrel_exports(self) -> None:\n 410\t \"\"\"Detect barrel/re-export files and record origin mappings.\n 411\t\n 412\t A barrel file imports a name and re-exports it without defining it\n 413\t locally (e.g., ``__init__.py`` with ``from .calculator import Calculator``).\n 414\t When downstream code imports from the barrel, we follow chains to\n 415\t find the actual defining file.\n 416\t \"\"\"\n 417\t # First pass: identify direct barrel origins\n 418\t for path, name_to_file in self._import_names.items():\n 419\t file_syms = self._file_symbols.get(path, {})\n 420\t for name, source_file in name_to_file.items():\n 421\t # An origin outside the repo names no file any reader of this\n 422\t # map can look up, and the wildcard pass below already refuses\n 423\t # one. Holding the invariant in one pass and not its twin is\n 424\t # what makes a later reader look safe when it is not.\n 425\t if name not in file_syms and not source_file.startswith(\"external:\"):\n 426\t self._barrel_origins[path][name] = source_file\n 427\t\n 428\t # Track wildcard re-exports, which forward every symbol of the imported\n 429\t # module under this file's namespace. Two shapes qualify: Rust\n 430\t # `pub use foo::*` (is_reexport) and Python/JS `from foo import *` (a\n 431\t # \"*\" imported name). The latter is how package ``__init__.py`` barrels\n 432\t # commonly re-export a subpackage \u2014 ``build_import_name_maps`` skips the\n 433\t # \"*\" name (it is not a binding), so without this pass the barrel chain\n 434\t # dead-ends one hop short of the real definition and a call through the\n 435\t # barrel resolves to nothing.\n 436\t wildcard_sources: dict[str, list[str]] = defaultdict(list)\n 437\t for path, parsed in self._parsed_files.items():\n 438\t file_syms = self._file_symbols.get(path, {})\n 439\t for imp in parsed.imports:\n 440\t is_wildcard = imp.is_reexport or \"*\" in imp.imported_names\n 441\t if not is_wildcard or not imp.resolved_file:\n 442\t continue\n 443\t if imp.resolved_file.startswith(\"external:\"):\n 444\t continue\n 445\t # ``export * as ns from \"x\"`` forwards the module under ``ns``,\n 446\t # so x's names are reachable as ``ns.name`` and are NOT this\n 447\t # file's own exports. Flattening them makes a bare ``name``\n 448\t # resolve into a nested namespace it was never in.\n 449\t if any(b.local_name == \"*\" and b.exported_name for b in imp.bindings):\n 450\t continue\n 451\t resolved = imp.resolved_file\n 452\t if resolved != path:\n 453\t wildcard_sources[path].append(resolved)\n 454\t source_syms = self._file_symbols.get(resolved, {})\n 455\t source_parsed = self._parsed_files.get(resolved)\n 456\t published = (\n 457\t (*source_syms, *source_parsed.export_aliases)\n 458\t if source_parsed\n 459\t else tuple(source_syms)\n 460\t )\n 461\t for sym_name in published:\n 462\t if sym_name not in file_syms:\n 463\t self._barrel_origins[path][sym_name] = resolved\n 464\t\n 465\t # The pass above forwards only what the source file DECLARES, so a\n 466\t # barrel over a barrel forwards nothing and the chain breaks at its\n 467\t # first link rather than its last. Forward what the source file\n 468\t # re-exports too, to a fixpoint. The multi-hop pass below cannot do\n 469\t # this job \u2014 it deepens entries that exist, and here none do.\n 470\t #\n 471\t # Sorted so that a name two of this file's barrels both forward lands on\n 472\t # the same origin whatever order the repository was walked in.\n 473\t for _ in range(4):\n 474\t changed = False\n 475\t for path, sources in sorted(wildcard_sources.items()):\n 476\t file_syms = self._file_symbols.get(path, {})\n 477\t origins = self._barrel_origins[path]\n 478\t for source in sorted(sources):\n 479\t source_bindings = self._import_bindings.get(source, {})\n 480\t for name, declaring in sorted(self._barrel_origins.get(source, {}).items()):\n 481\t if name in file_syms or name in origins or declaring == path:\n 482\t continue\n 483\t # The map keys a name as the source file spells it and\n 484\t # records only the declaring file, never the name the\n 485\t # symbol has there. A hop that renames therefore hands\n 486\t # on a key the declaring file may coincidentally\n 487\t # declare as something unrelated, and the receiving\n 488\t # file carries no binding to undo it with. Refuse those\n 489\t # rather than forward a name that means something else\n 490\t # at the far end; it costs reach, never correctness.\n 491\t binding = source_bindings.get(name)\n 492\t if binding is not None and (binding.exported_name or name) != name:\n 493\t continue\n 494\t origins[name] = declaring\n 495\t changed = True\n 496\t if not changed:\n 497\t break\n 498\t\n 499\t # Multi-hop: follow chains up to 5 hops\n 500\t for _ in range(4):\n 501\t changed = False\n 502\t for _path, origins in list(self._barrel_origins.items()):\n 503\t for name, source in list(origins.items()):\n 504\t deeper = self._barrel_origins.get(source, {}).get(name)\n 505\t if deeper and deeper != source:\n 506\t origins[name] = deeper\n 507\t changed = True\n 508\t if not changed:\n 509\t break\n 510\t\n 511\t def _get_rust_crate_src(self) -> dict[str, str]:\n 512\t \"\"\"Lazily build a mapping from normalised crate name to src/ dir.\"\"\"\n 513\t if self._rust_crate_src is not None:\n 514\t return self._rust_crate_src\n 515\t self._rust_crate_src = {}\n 516\t if not self._repo_path:\n 517\t return self._rust_crate_src\n 518\t from .resolvers.rust_workspace import get_or_build_cargo_workspace_index\n 519\t\n 520\t class _Ctx:\n 521\t def __init__(self, rp, pf):\n 522\t self.repo_path = rp\n 523\t self.parsed_files = pf\n 524\t\n 525\t ctx = _Ctx(self._repo_path, self._parsed_files)\n 526\t ws = get_or_build_cargo_workspace_index(ctx)\n 527\t if ws:\n 528\t for crate in ws.crates:\n 529\t normalized = crate.name.replace(\"-\", \"_\")\n 530\t self._rust_crate_src[normalized] = crate.src_dir\n 531\t return self._rust_crate_src\n 532\t\n 533\t def _get_go_index(self) -> Any:\n 534\t \"\"\"Lazily build the GoPackageIndex (or None if unavailable).\n 535\t\n 536\t Mirrors ``_get_rust_crate_src``: the resolver runs without a\n 537\t ``ResolverContext``, so it constructs a minimal stand-in and rebuilds\n 538\t the package index. The build is one walk over the ``.go`` files; the\n 539\t result is cached for the lifetime of the resolver.\n 540\t \"\"\"\n 541\t if self._go_index_built:\n 542\t return self._go_index\n 543\t self._go_index_built = True\n 544\t if not self._repo_path:\n 545\t return None\n 546\t from pathlib import Path\n 547\t\n 548\t from .resolvers.go_workspace import build_go_package_index\n 549\t\n 550\t class _Ctx:\n 551\t def __init__(self, rp: str, pf: dict[str, ParsedFile]) -> None:\n 552\t self.repo_path = Path(rp)\n 553\t self.path_set = set(pf.keys())\n 554\t self.sorted_paths = tuple(sorted(self.path_set))\n 555\t self.parsed_files = pf\n 556\t self.go_modules: tuple[\n[repowise#63171fe88e36: 600 lines omitted (~7951 tokens); restore: repowise expand 63171fe88e36]","start_line":197,"symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver","truncated":true,"verified":true},"get_symbol:largest-symbol":{"_meta":{"completeness":{"capped":true},"contract_version":1,"embedder_degraded":false,"index_age_days":0,"indexed_commit":"920d1c973d64","omitted":{"refs":["repowise#c07e342c9b4c","repowise#6abe1e1bba89"],"restore":"Run `repowise expand <ref>` from the repo, or call get_symbol(\"repowise#<ref>\", query=...) to retrieve the omitted content.","tokens":8114},"replaced_tokens":25149,"response_budget":{"limit_chars":24000,"serialized_chars":22619,"tier":"default"},"state":{"truncated":true},"timing_ms":7.41,"tokens_saved":19481},"continuation":"packages/core/src/repowise/core/ingestion/call_resolver.py:847-2117","continuation_reference":{"id":"packages/core/src/repowise/core/ingestion/call_resolver.py:847-2117","kind":"file_range","path":"packages/core/src/repowise/core/ingestion/call_resolver.py","range":[847,2117],"repository":"default","source_kind":"source","verification_basis":"live"},"end_line":846,"file":"packages/core/src/repowise/core/ingestion/call_resolver.py","kind":"class","name":"CallResolver","omission_marker":"[repowise#6abe1e1bba89: 11 lines omitted (~136 tokens); restore: repowise expand 6abe1e1bba89]","qualified_name":"packages.core.src.repowise.core.ingestion.call_resolver.CallResolver","signature":"class CallResolver","source":" 247\tclass CallResolver:\n 248\t \"\"\"Resolve raw CallSites to symbol-level edges.\n 249\t\n 250\t Constructed once per ``GraphBuilder.build()`` call with the full set of\n 251\t parsed files and import edges, then driven one file at a time.\n 252\t\n 253\t ``resolve_file()`` is **not** safe to call concurrently. Several lazy\n 254\t caches are filled during resolution, and the capped ones evict wholesale.\n 255\t Every cached value is a pure function of state fixed at construction, so a\n 256\t race would cost recomputation rather than a wrong answer, but the eviction\n 257\t makes concurrent use pointless as well as unsupported.\n 258\t \"\"\"\n 259\t\n 260\t def __init__(\n 261\t self,\n 262\t parsed_files: dict[str, ParsedFile],\n 263\t import_targets: dict[str, set[str]],\n 264\t *,\n 265\t repo_path: str | None = None,\n 266\t import_maps: Any | None = None,\n 267\t heritage_parents: dict[str, set[str]] | None = None,\n 268\t return_type_chain_languages: frozenset[str] | None = None,\n 269\t ) -> None:\n 270\t # {type symbol id: parent type symbol ids}, from the caller's already\n 271\t # resolved heritage. Absent when the resolver is built standalone, in\n 272\t # which case the inherited tier simply never fires.\n 273\t self._heritage_parents: dict[str, set[str]] = heritage_parents or {}\n 274\t self._return_type_chain_languages = (\n 275\t PRODUCTION_RETURN_TYPE_CHAIN_LANGUAGES\n 276\t if return_type_chain_languages is None\n 277\t else return_type_chain_languages\n 278\t )\n 279\t self._ancestors: dict[str, tuple[str, ...]] = {}\n 280\t # Per-file symbol index: {file_path: {symbol_name: symbol_id}}\n 281\t self._file_symbols: dict[str, dict[str, str]] = {}\n 282\t\n 283\t # Per-file method index: {file_path: {(class_name, method_name): symbol_id}}\n 284\t self._file_methods: dict[str, dict[tuple[str, str], str]] = {}\n 285\t\n 286\t # Global method index: {(class_name, method_name): [(file_path, symbol_id)]}\n 287\t # in file-insertion order \u2014 replaces the trait-dispatch scan over\n 288\t # every file's method dict with one short-list lookup.\n 289\t self._global_methods: dict[tuple[str, str], list[tuple[str, str]]] = defaultdict(list)\n 290\t\n 291\t # Global symbol index: {name: [symbol_ids]} \u2014 for Tier 3\n 292\t self._global_symbols: dict[str, list[str]] = defaultdict(list)\n 293\t self._symbols_by_id = {\n 294\t symbol.id: symbol for parsed in parsed_files.values() for symbol in parsed.symbols\n 295\t }\n 296\t self._symbol_paths_by_id = {\n 297\t symbol.id: path\n 298\t for path, parsed in parsed_files.items()\n 299\t for symbol in parsed.symbols\n 300\t }\n 301\t self._overload_return_types: dict[tuple[str, str | None, str, int | None], set[str]] = (\n 302\t defaultdict(set)\n 303\t )\n 304\t for path, parsed in parsed_files.items():\n 305\t for symbol in parsed.symbols:\n 306\t raw_return = declared_return_type(symbol.signature or \"\")\n 307\t normalized = (\n 308\t normalize_return_type(raw_return, symbol.language) if raw_return else None\n 309\t )\n 310\t if normalized is not None:\n 311\t key = (\n 312\t path,\n 313\t symbol.parent_name,\n 314\t symbol.name,\n 315\t signature_parameter_count(symbol.signature or \"\"),\n 316\t )\n 317\t self._overload_return_types[key].add(normalized)\n 318\t self._known_type_names = frozenset(\n 319\t symbol.name for symbol in self._symbols_by_id.values() if symbol.kind in _TYPE_KINDS\n 320\t )\n 321\t\n 322\t # Symbols in the index above that are data members, not callables\n 323\t # Held as an id set rather than a full id->kind map: it is the only\n 324\t # kind question asked of it and the set is small.\n 325\t self._non_callable_ids: set[str] = set()\n 326\t self._property_accessor_ids: set[str] = set()\n 327\t\n 328\t # C/C++ forward declaration \u2192 the definition it declares. Populated by\n 329\t # ``_build_indices``; applied to every resolved call so the edge lands\n 330\t # on the body rather than the header line that announced it.\n 331\t self._decl_to_def: dict[str, str] = {}\n 332\t\n 333\t # Import graph: {file_path: set of imported file paths}\n 334\t self._import_targets = import_targets\n 335\t\n 336\t # Shared import-name maps (built once per GraphBuilder.build() and\n 337\t # injected; standalone construction builds them locally).\n 338\t if import_maps is None:\n 339\t from .import_index import build_import_name_maps\n 340\t\n 341\t import_maps = build_import_name_maps(parsed_files)\n 342\t # Import name mapping: {file_path: {local_name: source_file}}\n 343\t self._import_names: dict[str, dict[str, str]] = import_maps.import_names\n 344\t # Full binding data: {file_path: {local_name: NamedBinding}}\n 345\t self._import_bindings: dict[str, dict[str, NamedBinding]] = import_maps.import_bindings\n 346\t # Module alias mapping: {file_path: {alias: source_file}}\n 347\t self._module_aliases: dict[str, dict[str, str]] = import_maps.module_aliases\n 348\t\n 349\t # Lazy per-file merged views of every imported file's symbol /\n 350\t # method tables \u2014 turns the Tier-2b \"scan each imported file\"\n 351\t # loops into single dict lookups. Built on first miss per file;\n 352\t # merge order is sorted(import paths) with first-wins so shadowed\n 353\t # names resolve deterministically (the old set-iteration order was\n 354\t # hash-randomized per process).\n 355\t self._merged_import_symbols: dict[str, dict[str, str]] = {}\n 356\t self._merged_import_methods: dict[str, dict[tuple[str, str], str]] = {}\n 357\t\n 358\t # Lazy per-file set of (line, target) that also carry a receiver.\n 359\t self._member_shaped: dict[str, set[tuple[int, str]]] = {}\n 360\t\n 361\t # Receiver typing reads source text, so both caches are capped rather\n 362\t # than per-repo: files resolve one at a time, so a few slots always\n 363\t # hit, and the cap is what keeps a whole repo's source out of memory.\n 364\t # Scanning is memoised per *function*, not per reference \u2014 one scan\n 365\t # answers every unresolved receiver in a body.\n 366\t self._source_text: dict[str, str] = {}\n 367\t self._declarations: dict[str, tuple[Declaration, ...]] = {}\n 368\t self._symbol_spans: dict[str, dict[str, tuple[int, int]]] = {}\n 369\t self._body_types: dict[tuple[str, str], dict[str, str | None]] = {}\n 370\t self._field_types: dict[str, dict[str, dict[str, str | None]]] = {}\n 371\t self._bindings: dict[str, tuple[tuple[int, str], ...]] = {}\n 372\t self._bound_names: dict[tuple[str, str], frozenset[str]] = {}\n 373\t # {file: {name: type}} \u2014 module-level defs a framework decorator retyped.\n 374\t self._framework_types: dict[str, dict[str, str]] = {}\n 375\t self._external_names: dict[str, frozenset[str]] = {}\n 376\t self._repo_rebound_names: dict[str, frozenset[str]] = {}\n 377\t self._method_name_set: frozenset[str] | None = None\n 378\t self._framework_name_set: frozenset[str] | None = None\n 379\t\n 380\t # Barrel re-export origins: {barrel_file: {name: origin_file}}\n 381\t self._barrel_origins: dict[str, dict[str, str]] = defaultdict(dict)\n 382\t\n 383\t # Keep reference for cross-language checks in Tier 3\n 384\t self._parsed_files = parsed_files\n 385\t\n 386\t # Rust cross-crate resolution\n 387\t self._repo_path = repo_path\n 388\t self._rust_crate_src: dict[str, str] | None = None # lazy\n 389\t\n 390\t # Go package-scoped resolution (lazy GoPackageIndex). ``_go_index``\n 391\t # holds the built index; ``_go_index_built`` distinguishes \"not yet\n 392\t # built\" from \"built but unavailable\" (no repo_path / no go files).\n 393\t self._go_index: Any = None\n 394\t self._go_index_built = False\n 395\t\n 396\t # JVM same-package resolution (lazy JvmWorkspaceIndex)\n 397\t self._jvm_index: Any = None\n 398\t self._jvm_index_built = False\n 399\t\n 400\t # C/C++ same-target resolution (lazy CppWorkspaceIndex)\n 401\t self._cpp_index: Any = None\n 402\t self._cpp_index_built = False\n 403\t\n 404\t self._strategies_by_file: dict[str, _LanguageCallStrategies] = {}\n 405\t\n 406\t self._build_indices(parsed_files)\n 407\t self._follow_barrel_exports()\n 408\t\n 409\t def _follow_barrel_exports(self) -> None:\n 410\t \"\"\"Detect barrel/re-export files and record origin mappings.\n 411\t\n 412\t A barrel file imports a name and re-exports it without defining it\n 413\t locally (e.g., ``__init__.py`` with ``from .calculator import Calculator``).\n 414\t When downstream code imports from the barrel, we follow chains to\n 415\t find the actual defining file.\n 416\t \"\"\"\n 417\t # First pass: identify direct barrel origins\n 418\t for path, name_to_file in self._import_names.items():\n 419\t file_syms = self._file_symbols.get(path, {})\n 420\t for name, source_file in name_to_file.items():\n 421\t # An origin outside the repo names no file any reader of this\n 422\t # map can look up, and the wildcard pass below already refuses\n 423\t # one. Holding the invariant in one pass and not its twin is\n 424\t # what makes a later reader look safe when it is not.\n 425\t if name not in file_syms and not source_file.startswith(\"external:\"):\n 426\t self._barrel_origins[path][name] = source_file\n 427\t\n 428\t # Track wildcard re-exports, which forward every symbol of the imported\n 429\t # module under this file's namespace. Two shapes qualify: Rust\n 430\t # `pub use foo::*` (is_reexport) and Python/JS `from foo import *` (a\n 431\t # \"*\" imported name). The latter is how package ``__init__.py`` barrels\n 432\t # commonly re-export a subpackage \u2014 ``build_import_name_maps`` skips the\n 433\t # \"*\" name (it is not a binding), so without this pass the barrel chain\n 434\t # dead-ends one hop short of the real definition and a call through the\n 435\t # barrel resolves to nothing.\n 436\t wildcard_sources: dict[str, list[str]] = defaultdict(list)\n 437\t for path, parsed in self._parsed_files.items():\n 438\t file_syms = self._file_symbols.get(path, {})\n 439\t for imp in parsed.imports:\n 440\t is_wildcard = imp.is_reexport or \"*\" in imp.imported_names\n 441\t if not is_wildcard or not imp.resolved_file:\n 442\t continue\n 443\t if imp.resolved_file.startswith(\"external:\"):\n 444\t continue\n 445\t # ``export * as ns from \"x\"`` forwards the module under ``ns``,\n 446\t # so x's names are reachable as ``ns.name`` and are NOT this\n 447\t # file's own exports. Flattening them makes a bare ``name``\n 448\t # resolve into a nested namespace it was never in.\n 449\t if any(b.local_name == \"*\" and b.exported_name for b in imp.bindings):\n 450\t continue\n 451\t resolved = imp.resolved_file\n 452\t if resolved != path:\n 453\t wildcard_sources[path].append(resolved)\n 454\t source_syms = self._file_symbols.get(resolved, {})\n 455\t source_parsed = self._parsed_files.get(resolved)\n 456\t published = (\n 457\t (*source_syms, *source_parsed.export_aliases)\n 458\t if source_parsed\n 459\t else tuple(source_syms)\n 460\t )\n 461\t for sym_name in published:\n 462\t if sym_name not in file_syms:\n 463\t self._barrel_origins[path][sym_name] = resolved\n 464\t\n 465\t # The pass above forwards only what the source file DECLARES, so a\n 466\t # barrel over a barrel forwards nothing and the chain breaks at its\n 467\t # first link rather than its last. Forward what the source file\n 468\t # re-exports too, to a fixpoint. The multi-hop pass below cannot do\n 469\t # this job \u2014 it deepens entries that exist, and here none do.\n 470\t #\n 471\t # Sorted so that a name two of this file's barrels both forward lands on\n 472\t # the same origin whatever order the repository was walked in.\n 473\t for _ in range(4):\n 474\t changed = False\n 475\t for path, sources in sorted(wildcard_sources.items()):\n 476\t file_syms = self._file_symbols.get(path, {})\n 477\t origins = self._barrel_origins[path]\n 478\t for source in sorted(sources):\n 479\t source_bindings = self._import_bindings.get(source, {})\n 480\t for name, declaring in sorted(self._barrel_origins.get(source, {}).items()):\n 481\t if name in file_syms or name in origins or declaring == path:\n 482\t continue\n 483\t # The map keys a name as the source file spells it and\n 484\t # records only the declaring file, never the name the\n 485\t # symbol has there. A hop that renames therefore hands\n 486\t # on a key the declaring file may coincidentally\n 487\t # declare as something unrelated, and the receiving\n 488\t # file carries no binding to undo it with. Refuse those\n 489\t # rather than forward a name that means something else\n 490\t # at the far end; it costs reach, never correctness.\n 491\t binding = source_bindings.get(name)\n 492\t if binding is not None and (binding.exported_name or name) != name:\n 493\t continue\n 494\t origins[name] = declaring\n 495\t changed = True\n 496\t if not changed:\n 497\t break\n 498\t\n 499\t # Multi-hop: follow chains up to 5 hops\n 500\t for _ in range(4):\n 501\t changed = False\n 502\t for _path, origins in list(self._barrel_origins.items()):\n 503\t for name, source in list(origins.items()):\n 504\t deeper = self._barrel_origins.get(source, {}).get(name)\n 505\t if deeper and deeper != source:\n 506\t origins[name] = deeper\n 507\t changed = True\n 508\t if not changed:\n 509\t break\n 510\t\n 511\t def _get_rust_crate_src(self) -> dict[str, str]:\n 512\t \"\"\"Lazily build a mapping from normalised crate name to src/ dir.\"\"\"\n 513\t if self._rust_crate_src is not None:\n 514\t return self._rust_crate_src\n 515\t self._rust_crate_src = {}\n 516\t if not self._repo_path:\n 517\t return self._rust_crate_src\n 518\t from .resolvers.rust_workspace import get_or_build_cargo_workspace_index\n 519\t\n 520\t class _Ctx:\n 521\t def __init__(self, rp, pf):\n 522\t self.repo_path = rp\n 523\t self.parsed_files = pf\n 524\t\n 525\t ctx = _Ctx(self._repo_path, self._parsed_files)\n 526\t ws = get_or_build_cargo_workspace_index(ctx)\n 527\t if ws:\n 528\t for crate in ws.crates:\n 529\t normalized = crate.name.replace(\"-\", \"_\")\n 530\t self._rust_crate_src[normalized] = crate.src_dir\n 531\t return self._rust_crate_src\n 532\t\n 533\t def _get_go_index(self) -> Any:\n 534\t \"\"\"Lazily build the GoPackageIndex (or None if unavailable).\n 535\t\n 536\t Mirrors ``_get_rust_crate_src``: the resolver runs without a\n 537\t ``ResolverContext``, so it constructs a minimal stand-in and rebuilds\n 538\t the package index. The build is one walk over the ``.go`` files; the\n 539\t result is cached for the lifetime of the resolver.\n 540\t \"\"\"\n 541\t if self._go_index_built:\n 542\t return self._go_index\n 543\t self._go_index_built = True\n 544\t if not self._repo_path:\n 545\t return None\n 546\t from pathlib import Path\n 547\t\n 548\t from .resolvers.go_workspace import build_go_package_index\n 549\t\n 550\t class _Ctx:\n 551\t def __init__(self, rp: str, pf: dict[str, ParsedFile]) -> None:\n 552\t self.repo_path = Path(rp)\n 553\t self.path_set = set(pf.keys())\n 554\t self.sorted_paths = tuple(sorted(self.path_set))\n 555\t self.parsed_files = pf\n 556\t self.go_modules: tuple[tuple[str, str], ...] = ()\n 557\t self.go_module_path: str | None = None\n 558\t\n 559\t self._go_index = build_go_package_index(_Ctx(self._repo_path, self._parsed_files))\n 560\t return self._go_index\n 561\t\n 562\t def _strategies_for(self, file_path: str) -> _LanguageCallStrategies:\n 563\t \"\"\"The extra strategies this file's language gets.\"\"\"\n 564\t parsed = self._parsed_files.get(file_path)\n 565\t language = parsed.file_info.language if parsed else \"\"\n 566\t return _LANGUAGE_CALL_STRATEGIES.get(language, _NO_LANGUAGE_STRATEGIES)\n 567\t\n 568\t def _get_cpp_index(self) -> Any:\n 569\t \"\"\"Lazily build a CppWorkspaceIndex via a minimal stand-in context.\"\"\"\n 570\t if self._cpp_index_built:\n 571\t return self._cpp_index\n 572\t self._cpp_index_built = True\n 573\t if not self._repo_path:\n 574\t return None\n 575\t from pathlib import Path\n 576\t\n 577\t from .resolvers.cpp_workspace import build_cpp_workspace_index\n 578\t\n 579\t class _Ctx:\n 580\t def __init__(self, rp: str, pf: dict[str, ParsedFile]) -> None:\n 581\t self.repo_path = Path(rp)\n 582\t self.path_set = set(pf.keys())\n 583\t self.sorted_paths = tuple(sorted(self.path_set))\n 584\t self.parsed_files = pf\n 585\t self.stem_map: dict[str, list[str]] = {}\n 586\t\n 587\t self._cpp_index = build_cpp_workspace_index(_Ctx(self._repo_path, self._parsed_files))\n 588\t return self._cpp_index\n 589\t\n 590\t def _collapse_declarations(self, sym_ids: list[str]) -> set[str]:\n 591\t \"\"\"Fold each declaration onto the definition it was paired with.\n 592\t\n 593\t Two ids naming one symbol must not read as an ambiguity.\n 594\t \"\"\"\n 595\t return {self._decl_to_def.get(sym_id, sym_id) for sym_id in sym_ids}\n 596\t\n 597\t def _resolve_cpp_scoped_call(\n 598\t self,\n 599\t file_path: str,\n 600\t call: CallSite,\n 601\t caller_id: str,\n 602\t ) -> ResolvedCall | None:\n 603\t \"\"\"Resolve ``Qualifier::name()`` against the class the qualifier names.\n 604\t\n 605\t The qualifier is written at the call site, so this infers nothing: the\n 606\t repository either declares ``Qualifier::name`` or it does not. Before\n 607\t it existed only the leaf name survived ex\n[repowise#c07e342c9b4c: 600 lines omitted (~7978 tokens); restore: repowise expand c07e342c9b4c]","start_line":247,"symbol_id":"packages/core/src/repowise/core/ingestion/call_resolver.py::CallResolver","truncated":true,"verified":true},"get_why:targets":{"_meta":{"completeness":{"capped":true,"reason":"construction_cap","shown":23,"total":173},"contract_version":1,"embedder_degraded":false,"index_age_days":0,"indexed_commit":"920d1c973d64","omitted":{"refs":["repowise#c3d5b15fafd9","repowise#9f8533616584","repowise#5e41015972a5","repowise#9fcc901ca410"],"restore":"Run `repowise expand <ref>` from the repo, or call get_symbol(\"repowise#<ref>\", query=...) to retrieve the omitted content.","tokens":39053},"response_budget":{"limit_chars":24000,"serialized_chars":22762,"tier":"default"},"state":{"truncated":true}},"alignment":{"active_count":0,"candidate_count":0,"deprecated_count":0,"explanation":"No architectural decisions govern packages/core/src/repowise/core/ingestion/call_resolver.py. This file is ungoverned \u2014 it may be an outlier or simply undocumented.","governing_count":0,"score":"none","sibling_coverage":null,"stale_count":0},"answer_basis":"episode","code_rationale":[{"comment":"Three-tier call resolution engine for the symbol-level dependency graph. Resolves CallSite objects (extracted from AST) to concrete symbol node IDs in the graph, producing CALLS edges with confidence scores. Resolution tiers (checked in order, first match wins): Tier 1 \u2014 Same-file exact match (confidence 0.95) The call target matches a symbol defined in the same file. Tier 2 \u2014 Import-scoped match (confidence 0.90) The call target matches a symbol in a file that the caller imports, optionally scoped by the specific imported names. Tier 3 \u2014 Global unique match (confidence 0.50) The call target matches exactly one symbol across the entire codebase. Only fires when the match is unambiguous to avoid false edges. Each resolved call produces a (source_id, target_id, confidence, origin) tuple that the GraphBuilder converts into a CALLS edge. The tiers above are the headline three; ``ResolutionOrigin`` in ``models`` is the full set, one name per strategy, and it is what the edge carries.","evidence_refs":[{"content_id":"e7b6b95c70b3f8749c12","id":"ev_30e9f5f0c3b34b452e8c","kind":"file_content","line":1,"path":"packages/core/src/repowise/core/ingestion/call_resolver.py","provenance":"extracted_rationale","range":[1,12],"repository":"default","source":"live_code_rationale","source_kind":"code_comment","verification":"exact","verification_basis":"live"}],"lines":[1,12],"matched_terms":[],"path":"packages/core/src/repowise/core/ingestion/call_resolver.py","provenance":"extracted_rationale"},{"comment":"Languages where a call the caller's own class cannot answer is looked for on its ancestors. Both shapes \u2014 an explicit ``self``/``this`` receiver and an implicit one \u2014 end in the same walk. C++ is absent because its heritage binds a qualified external parent to a same-named local type, which puts unrelated siblings in one hierarchy before this walk even runs. Java is absent because `java.scm`'s bare-call pattern also matches `this.field.m()`, which no receiver-carrying pattern claims, so such a call arrives here indistinguishable from a real implicit receiver \u2014 and its measured population on two Java repos was zero, so the tier could only cost. C# is present, and was once wrongly removed: a name's overloads all share one symbol id, so a declaration line read back out of the graph names an arbitrary overload. That reads as a wrong target and is not one \u2014 the id these calls resolve to is the id C# binds.","evidence_refs":[{"content_id":"e4551f6a4120417a9ac1","id":"ev_4c7480bb5b6fcc223188","kind":"file_content","line":71,"path":"packages/core/src/repowise/core/ingestion/call_resolver.py","provenance":"extracted_rationale","range":[71,82],"repository":"default","source":"live_code_rationale","source_kind":"code_comment","verification":"exact","verification_basis":"live"}],"lines":[71,82],"matched_terms":[],"path":"packages/core/src/repowise/core/ingestion/call_resolver.py","provenance":"extracted_rationale"},{"comment":"Languages where a bare name is scoped lexically: it can only mean the caller's own module, an explicit ``import``, or the prelude. Elixir's ``alias`` / ``require`` / ``use`` bind a module name, never a function name, so repo-wide uniqueness is no evidence and only wildcard imports may merge names. F# is the same rule with different spelling: a bare name means the enclosing scope, a module the file has ``open``ed, or FSharp.Core, and nothing else -- a name unique across the repo is not thereby in scope.","evidence_refs":[{"content_id":"279bc93ec731b668214a","id":"ev_925a17bc0fec5d8f2f7e","kind":"file_content","line":89,"path":"packages/core/src/repowise/core/ingestion/call_resolver.py","provenance":"extracted_rationale","range":[89,95],"repository":"default","source":"live_code_rationale","source_kind":"code_comment","verification":"exact","verification_basis":"live"}],"lines":[89,95],"matched_terms":[],"path":"packages/core/src/repowise/core/ingestion/call_resolver.py","provenance":"extracted_rationale"},{"comment":"What a language resolves that the language-neutral tiers cannot. ``free`` runs after the same-file tier and before the import tiers; ``member`` runs before every receiver strategy; ``member_fallback`` runs after all of them, so a strategy there only ever sees a call nothing else claimed and can only add an edge. All three stop at the first hit. Strategies are named rather than bound so a probe can substitute one.","evidence_refs":[{"content_id":"fa671bfea3e99da6733e","id":"ev_edb4dc3ce42f43aa3355","kind":"file_content","line":108,"path":"packages/core/src/repowise/core/ingestion/call_resolver.py","provenance":"extracted_rationale","range":[108,115],"repository":"default","source":"live_code_rationale","source_kind":"code_comment","verification":"exact","verification_basis":"live"}],"lines":[108,115],"matched_terms":[],"path":"packages/core/src/repowise/core/ingestion/call_resolver.py","provenance":"extracted_rationale"},{"comment":"Kinds that can never be the callee of a call, used to keep the bare-name Tier 3 index from offering a data member as a function. This is deliberately NOT the complement of ``_FUNCTION_KINDS``. Measured over the corpus, plenty of non-function kinds are legitimately called: ``class`` is a constructor in python/java/c#/typescript; ``variable`` is both a rust tuple ``enum_variant`` (309 grounded call edges on goose) and a typescript const whose initialiser is not syntactically a function, such as a factory result or a ``.bind()`` handle (2,173 on zod); ``type_alias`` is a Go conversion. Denying by function-ness would delete thousands of real edges. ``property`` is the one kind in the whole of ``language_configs.py`` that means \"data member\" and nothing else: it is emitted by exactly one mapping, rust's ``field_declaration``. Every other language spells its fields ``variable``, which is why this fix cannot be extended to them \u2014 there a field is indistinguishable from a callable value by kind alone.","evidence_refs":[{"content_id":"8ac00a8632e2a7726d77","id":"ev_603ed9ddc8822602b80c","kind":"file_content","line":132,"path":"packages/core/src/repowise/core/ingestion/call_resolver.py","provenance":"extracted_rationale","range":[132,143],"repository":"default","source":"live_code_rationale","source_kind":"code_comment","verification":"exact","verification_basis":"live"}],"lines":[132,143],"matched_terms":[],"path":"packages/core/src/repowise/core/ingestion/call_resolver.py","provenance":"extracted_rationale"}],"code_rationale_emitted":5,"code_rationale_omitted":49,"code_rationale_reduced_reason":"construction_cap","code_rationale_total":54,"code_rationale_truncated":true,"decisions":[],"episodes":[{"evidence":"commit 0cbe36f70f0d, 2026-08-30, changed 10 files together","evidence_refs":[{"commit":"0cbe36f70f0db2dfeddf23d56960506f8872deb6","id":"ev_0c1fdfbf06526d42573a","kind":"commit","provenance":"historical","repository":"default","source":"episode","source_kind":"episode","verification_basis":"historical"}],"kind":"code_fix","provenance":"historical","recorded":"fix(dead-code): detect JSX prop-guard dead code (#1554) (#1570)","scope":["packages/core/src/repowise/core/analysis/dead_code/analyzer.py","packages/core/src/repowise/core/analysis/dead_code/jsx_prop_guards.py","packages/core/src/repowise/core/ingestion/call_resolver.py","packages/core/src/repowise/core/ingestion/graph/_rehydrate.py","packages/core/src/repowise/core/ingestion/graph/_resolvers.py","packages/core/src/repowise/core/ingestion/models.py","packages/core/src/repowise/core/ingestion/parser.py","tests/unit/dead_code/_helpers.py","tests/unit/dead_code/test_jsx_prop_guard_dead_code.py","tests/unit/ingestion/test_graph_rehydrate.py"],"still_true":"recorded 2026-08-30 at 0cbe36f70f0d; 10 commits have touched its scope since","subject":"0cbe36f70f0db2dfeddf23d56960506f8872deb6","tier":"git"}],"episodes_emitted":1,"episodes_omitted":20,"episodes_reduced_reason":"construction_cap_and_response_budget","episodes_total":21,"episodes_truncated":true,"git_archaeology":{"cross_references":[],"file_commits":[{"author":"Contributor 19","date":"2026-09-04T18:15:43+00:00","evidence_refs":[{"commit":"9af0b5f9ca6564bf23be01c50828ad49e25ef060","id":"ev_a42e829967a6e860c041","kind":"commit","provenance":"historical","repository":"default","source":"archaeology:file_commits","source_kind":"archaeology:file_commits","verification_basis":"historical"}],"message":"feat(languages): parse F# to a full AST and move it to Good (#2133)","provenance":"historical","sha":"9af0b5f9"}],"file_commits_emitted":1,"file_commits_omitted":33,"file_commits_reduced_reason":"construction_cap_and_response_budget","file_commits_total":34,"file_commits_truncated":true,"git_log":[{"author":"Contributor 19","commit":"9af0b5f9ca6564bf23be01c50828ad49e25ef060","date":"2026-09-04","evidence_refs":[{"commit":"9af0b5f9ca6564bf23be01c50828ad49e25ef060","id":"ev_a42e829967a6e860c041","kind":"commit","provenance":"historical","repository":"default","source":"archaeology:git_log","source_kind":"archaeology:git_log","verification_basis":"historical"}],"message":"feat(languages): parse F# to a full AST and move it to Good (#2133)","provenance":"historical","sha":"9af0b5f9ca65","source":"git_log_follow"},{"author":"Contributor 19","commit":"01e50e2f8475888541745fcbb0d40dd016f77476","date":"2026-09-04","evidence_refs":[{"commit":"01e50e2f8475888541745fcbb0d40dd016f77476","id":"ev_39e60b3a5fcdf4065a36","kind":"commit","provenance":"historical","repository":"default","source":"archaeology:git_log","source_kind":"archaeology:git_log","verification_basis":"historical"}],"message":"feat(languages): parse Elixir to a full AST and move it to Good (#2127)","provenance":"historical","sha":"01e50e2f8475","source":"git_log_follow"},{"author":"Contributor 20","commit":"0cbe36f70f0db2dfeddf23d56960506f8872deb6","date":"2026-08-30","evidence_refs":[{"commit":"0cbe36f70f0db2dfeddf23d56960506f8872deb6","id":"ev_0c1fdfbf06526d42573a","kind":"commit","provenance":"historical","repository":"default","source":"archaeology:git_log","source_kind":"archaeology:git_log","verification_basis":"historical"}],"message":"fix(dead-code): detect JSX prop-guard dead code (#1554) (#1570)","provenance":"historical","sha":"0cbe36f70f0d","source":"git_log_follow"},{"author":"Contributor 19","commit":"58403ddb69490d0d605ad93b3d6a94d61aadbb51","date":"2026-08-26","evidence_refs":[{"commit":"58403ddb69490d0d605ad93b3d6a94d61aadbb51","id":"ev_a162f4fe7b64b188a5a7","kind":"commit","provenance":"historical","repository":"default","source":"archaeology:git_log","source_kind":"archaeology:git_log","verification_basis":"historical"}],"message":"fix(ingestion): refuse a data member on the import-merged tier (#1925)","provenance":"historical","sha":"58403ddb6949","source":"git_log_follow"},{"author":"Contributor 19","commit":"f97ced7a4c7badf3879921b8d42c900753695ce6","date":"2026-08-25","evidence_refs":[{"commit":"f97ced7a4c7badf3879921b8d42c900753695ce6","id":"ev_4b18c964f408fa622c84","kind":"commit","provenance":"historical","repository":"default","source":"archaeology:git_log","source_kind":"archaeology:git_log","verification_basis":"historical"}],"message":"fix(ingestion): resolve a call to an overload set instead of refusing it (#1923)","provenance":"historical","sha":"f97ced7a4c7b","source":"git_log_follow"},{"author":"Contributor 19","commit":"127e0f1ec4aab7033c5ef1139a0762b1d50a15ac","date":"2026-08-25","evidence_refs":[{"commit":"127e0f1ec4aab7033c5ef1139a0762b1d50a15ac","id":"ev_90dca2153133ec4557c0","kind":"commit","provenance":"historical","repository":"default","source":"archaeology:git_log","source_kind":"archaeology:git_log","verification_basis":"historical"}],"message":"feat(ingestion): extract C++ in-class method declarations (#1921)","provenance":"historical","sha":"127e0f1ec4aa","source":"git_log_follow"},{"author":"Contributor 19","commit":"0c9faff85da640782783e1f9a1371f1c257ce5aa","date":"2026-08-25","evidence_refs":[{"commit":"0c9faff85da640782783e1f9a1371f1c257ce5aa","id":"ev_c5df10bf3bef8ae640b5","kind":"commit","provenance":"historical","repository":"default","source":"archaeology:git_log","source_kind":"archaeology:git_log","verification_basis":"historical"}],"message":"feat(ingestion): type C++ receivers from their declarations (#1919)","provenance":"historical","sha":"0c9faff85da6","source":"git_log_follow"},{"author":"Contributor 19","commit":"354269f101dd81be3a681e1e122c17d4b8c81bbc","date":"2026-08-25","evidence_refs":[{"commit":"354269f101dd81be3a681e1e122c17d4b8c81bbc","id":"ev_df55cb0a222f001ebcd4","kind":"commit","provenance":"historical","repository":"default","source":"archaeology:git_log","source_kind":"archaeology:git_log","verification_basis":"historical"}],"message":"fix(ingestion): resolve C++ scoped calls against their qualifier (#1915)","provenance":"historical","sha":"354269f101dd","source":"git_log_follow"},{"author":"Contributor 19","commit":"08e493b8f932296fc572def1873a6431b3023404","date":"2026-08-23","evidence_refs":[{"commit":"08e493b8f932296fc572def1873a6431b3023404","id":"ev_d3d093332515aa05cb6e","kind":"commit","provenance":"historical","repository":"default","source":"archaeology:git_log","source_kind":"archaeology:git_log","verification_basis":"historical"}],"message":"fix(graph): a java chain rooted at an external type is not a bare-name call (#1897)","provenance":"historical","sha":"08e493b8f932","source":"git_log_follow"},{"author":"Contributor 19","commit":"330ad6fa13caa842d816b836349bcbe6403e5c79","date":"2026-08-23","evidence_refs":[{"commit":"330ad6fa13caa842d816b836349bcbe6403e5c79","id":"ev_1acf1dcd8778ada4188b","kind":"commit","provenance":"historical","repository":"default","source":"archaeology:git_log","source_kind":"archaeology:git_log","verification_basis":"historical"}],"message":"fix(graph): stop the repo-wide receiver tier answering for foreign types (#1893)","provenance":"historical","sha":"330ad6fa13ca","source":"git_log_follow"},{"author":"Contributor 19","commit":"d7bd394ca894e0cd68ed2fd429a8c3fa9ff34c5a","date":"2026-08-23","evidence_refs":[{"commit":"d7bd394ca894e0cd68ed2fd429a8c3fa9ff34c5a","id":"ev_a47485b7ddc68ba5486d","kind":"commit","provenance":"historical","repository":"default","source":"archaeology:git_log","source_kind":"archaeology:git_log","verification_basis":"historical"}],"message":"fix(graph): a rust macro invocation is not a function call (#1885)","provenance":"historical","sha":"d7bd394ca894","source":"git_log_follow"}],"git_log_emitted":11,"git_log_omitted":19,"git_log_reduced_reason":"construction_cap_and_response_budget","git_log_total":30,"git_log_truncated":true,"provenance":"historical","summary":"No architectural decisions found for packages/core/src/repowise/core/ingestion/call_resolver.py, but git archaeology recovered 34 direct commit(s), 0 cross-reference(s), and 30 git log result(s). Review these to understand the intent behind this code.","triggered":true},"mode":"path","omission_marker":"[repowise#9fcc901ca410: 369 lines omitted (~2722 tokens); restore: repowise expand 9fcc901ca410]","origin_story":{"age_days":20,"author_commit_pct":0.9412,"available":true,"contributors":[{"commit_count":32,"email":"[email protected]","first_commit_ts":1786882824,"last_commit_ts":1788545743,"name":"Contributor 19"},{"commit_count":1,"email":"[email protected]","first_commit_ts":1788086763,"last_commit_ts":1788086763,"name":"Contributor 20"},{"commit_count":1,"email":"[email protected]","first_commit_ts":1787414540,"last_commit_ts":1787414540,"name":"Contributor 23"}],"first_commit":"2026-08-16","key_commits":[{"author":"Contributor 19","body":"tree-sitter-fsharp 0.3.11 replaces the regex tier for .fs and .fsx.\nModules, namespaces, let bindings including each `and` continuation,\nrecords, unions, classes, interfaces, members and exceptions become\nsymbols; `///` comments become docstrings; `inherit` and\n`interface ... with` become heritage edges. Signature files stay on the\nimport-only path: one grammar per language cannot select the signature\ngrammar, and the implementation grammar mis-parses them.\n\nImports keep the existing resolver and its .fsproj compile-order leg;\n`open` now carries the wildcard sentinel, which is what it means. A bare\nname in F# is lexically scoped, so the resolver refuses the global-unique\ntier for it and merges names only through `open`; an uppercase unqualified\ncallee is a union case or constructor, not a call site.\n\nA registry-parity test pins that every non-passthrough language has a\ngrammar, a query file and a config, and a pipeline-worker test drives the\nreal parse entry point over a .fs file.\n\nNo health markers yet. Docs","date":"2026-09-04T18:15:43+00:00","evidence_refs":[{"commit":"9af0b5f9ca6564bf23be01c50828ad49e25ef060","id":"ev_a42e829967a6e860c041","kind":"commit","provenance":"historical","repository":"default","source":"origin","source_kind":"origin","verification_basis":"historical"}],"message":"feat(languages): parse F# to a full AST and move it to Good (#2133)","pr_number":2133,"provenance":"historical","sha":"9af0b5f9"},{"author":"Contributor 19","body":"tree-sitter-elixir 0.3.5 replaces the regex tier for .ex and .exs.\ndefmodule, def, defp, defmacro, defguard, defdelegate and defprotocol\nbecome symbols, defimpl becomes an impl symbol named for the module the\ncompiler generates, and @doc / @moduledoc become docstrings. Every one\nof those is a call node in this grammar, so the kind, the parent module\nand the definition-head filter are read from the call's target keyword\nin four small language-gated blocks beside the Pascal and Dart ones.\n\nImports keep the existing resolver: alias, import, require and use yield\none import per named module, including each member of alias Foo.{Bar,\nBaz}, and the resolver's reach is unchanged. Call edges resolve within a\nmodule and through receivers. A bare name in Elixir is lexically scoped,\nso the resolver refuses the global-unique tier for it and merges names\nonly from wildcard imports; alias, require and use bind a module name,\nnever a function name.\n\nNo heritage edges (use and @behaviour are not inheritance) and no health\nmar","date":"2026-09-04T15:42:58+00:00","evidence_refs":[{"commit":"01e50e2f8475888541745fcbb0d40dd016f77476","id":"ev_39e60b3a5fcdf4065a36","kind":"commit","provenance":"historical","repository":"default","source":"origin","source_kind":"origin","verification_basis":"historical"}],"message":"feat(languages): parse Elixir to a full AST and move it to Good (#2127)","pr_number":2127,"provenance":"historical","sha":"01e50e2f"},{"author":"Contributor 20","date":"2026-08-30T10:46:03+00:00","evidence_refs":[{"commit":"0cbe36f70f0db2dfeddf23d56960506f8872deb6","id":"ev_0c1fdfbf06526d42573a","kind":"commit","provenance":"historical","repository":"default","source":"origin","source_kind":"origin","verification_basis":"historical"}],"message":"fix(dead-code): detect JSX prop-guard dead code (#1554) (#1570)","pr_number":1554,"provenance":"historical","sha":"0cbe36f7"},{"author":"Contributor 19","date":"2026-08-25T18:42:09+00:00","evidence_refs":[{"commit":"58403ddb69490d0d605ad93b3d6a94d61aadbb51","id":"ev_a162f4fe7b64b188a5a7","kind":"commit","provenance":"historical","repository":"default","source":"origin","source_kind":"origin","verification_basis":"historical"}],"message":"fix(ingestion): refuse a data member on the import-merged tier (#1925)","pr_number":1925,"provenance":"historical","sha":"58403ddb"},{"author":"Contributor 19","body":"`_global_symbols` holds one entry per declaration, so a method written as\nan overload set is several rows under one symbol id. Tier 3's\nglobal-unique rung gated on `len(candidates) == 1` and read that as an\nambiguity that does not exist: C#'s `AddRetry` is two rows and one\nsymbol, and the call reached nothing.\n\nCollapsing by symbol id is not the candidate filtering this rung already\nrefuses on purpose. A name that a field and a method both declare still\nhas two distinct ids and stays refused.\n\nThe collapsed answer is tried after the implicit-receiver tier rather\nthan in place of the row count. Ahead of it, it answered sites the\ncaller's own class hierarchy already answered, moving 1,027 edges in one\nrepository off `enclosing_inherited` at 0.90 confidence onto this rung at\n0.50 for the same target. Behind it, it can only add an edge.\n\nA getter and its setter are also two declarations under one id, which\nmade an attribute look like a unique callable and bound a local\n`router(...)` parameter invocation to it. Re","date":"2026-08-25T16:53:58+00:00","evidence_refs":[{"commit":"f97ced7a4c7badf3879921b8d42c900753695ce6","id":"ev_4b18c964f408fa622c84","kind":"commit","provenance":"historical","repository":"default","source":"origin","source_kind":"origin","verification_basis":"historical"}],"message":"fix(ingestion): resolve a call to an overload set instead of refusing it (#1923)","pr_number":1923,"provenance":"historical","sha":"f97ced7a"}],"key_commits_emitted":5,"key_commits_omitted":29,"key_commits_reduced_reason":"construction_cap","key_commits_total":34,"key_commits_truncated":true,"last_commit":"2026-09-04","linked_decisions":[],"primary_author":"Contributor 19","provenance":"historical","summary":"Created ~2026-08-16, last modified 2026-09-04 (20 days old). Primary author: Contributor 19 (34 total commits). Earliest key commit: \"fix(cpp): attach a call edge to the definition, not the header declaration (#1626)\" by Contributor 19 on 2026-08-16T12:20:24+00:00. Contributors: Contributor 19, Contributor 20, Contributor 23.","total_commits":34},"path":"packages/core/src/repowise/core/ingestion/call_resolver.py","truncated":true},"list_repos:default":{"_meta":{"completeness":{"capped":false},"contract_version":1,"embedder_degraded":false,"response_budget":{"limit_chars":24000,"serialized_chars":462,"tier":"default"}},"default_repo":"default","hint":"This MCP server is serving a single repo; omit repo unless a tool asks for it.","repos":[{"absolute_path":"/repo","alias":"default","is_default":true,"path":"/repo"}],"workspace":false,"workspace_root":null},"search_codebase:limit-5":{"_meta":{"completeness":{"capped":false},"contract_version":1,"embedder_degraded":false,"index_age_days":0,"indexed_commit":"920d1c973d64","replaced_tokens":2000,"response_budget":{"limit_chars":24000,"serialized_chars":3288,"tier":"default"},"tokens_saved":1162},"candidates":[{"path":"packages/server/src/repowise/server/schemas/repository.py"},{"path":"packages/api-client/src/types/repository.ts"},{"path":"packages/core/src/repowise/core/persistence/crud/repository.py"},{"path":"packages/core/src/repowise/core/persistence/_interfaces/_meta.py"},{"path":"packages/core/alembic/versions/0046_wiki_symbols_repo_path_index.py"}],"results":[{"confidence_score":1.0,"page_type":"file_page","relevance_score":3.958,"snippet":"# packages/server/src/repowise/server/schemas/repository.py\n\n## Overview\n\nRepository request/response models.\n\nIt exposes 9 public symbols and depends on 2 other files.\n\n## Public API\n\n| Symbol | Kind","sources":["fts","vector"],"target_path":"packages/server/src/repowise/server/schemas/repository.py","title":"File: packages/server/src/repowise/server/schemas/repository.py"},{"confidence_score":1.0,"page_type":"file_page","relevance_score":3.951,"snippet":"# packages/api-client/src/types/repository.ts\n\n## Overview\n\nTypes module repository defining RepoCreate, RepoUpdate, RepoResponse. `packages/api-client/src/types/repository.ts` is a typescript source","sources":["fts","vector"],"target_path":"packages/api-client/src/types/repository.ts","title":"File: packages/api-client/src/types/repository.ts"},{"confidence_score":0.94,"file":"packages/core/src/repowise/core/persistence/crud/repository.py","page_id":"symbol_spotlight:packages/core/src/repowise/core/persistence/crud/repository.py::upsert_repository","page_type":"symbol_spotlight","relevance_score":3.727,"snippet":"# packages.core.src.repowise.core.persistence.crud.repository.upsert_repository\n\n**Kind:** function (async) | **Defined in:** `packages/core/src/repowise/core/persistence/crud/repository.py` | **Estim","sources":["fts","vector"],"symbol_id":"packages/core/src/repowise/core/persistence/crud/repository.py::upsert_repository","target_path":"packages/core/src/repowise/core/persistence/crud/repository.py","title":"Symbol: packages.core.src.repowise.core.persistence.crud.repository.upsert_repository"},{"confidence_score":0.67,"page_type":"file_page","relevance_score":2.647,"snippet":"# packages/core/src/repowise/core/persistence/_interfaces/_meta.py\n\n## Overview\n\nIndexStore mixin: repository, generation jobs, pages, chat, webhooks.\n\nThis mixin covers the \"meta\" surface \u2014 the top-l","sources":["fts"],"target_path":"packages/core/src/repowise/core/persistence/_interfaces/_meta.py","title":"File: packages/core/src/repowise/core/persistence/_interfaces/_meta.py"},{"confidence_score":0.66,"page_type":"file_page","relevance_score":2.601,"snippet":"# packages/core/alembic/versions/0046_wiki_symbols_repo_path_index.py\n\n## Overview\n\nIndex `wiki_symbols` on `(repository_id, file_path)`.\n\nEvery file-scoped symbol lookup joins on this pair, but the o","sources":["fts"],"target_path":"packages/core/alembic/versions/0046_wiki_symbols_repo_path_index.py","title":"File: packages/core/alembic/versions/0046_wiki_symbols_repo_path_index.py"}]},"search_codebase:limit-50":{"_meta":{"completeness":{"capped":true,"reason":"response_budget","shown":19,"total":100},"contract_version":1,"embedder_degraded":false,"index_age_days":0,"indexed_commit":"920d1c973d64","omitted":{"refs":["repowise#1cb22af443b7","repowise#5fe350551fca"],"restore":"Run `repowise expand <ref>` from the repo, or call get_symbol(\"repowise#<ref>\", query=...) to retrieve the omitted content.","tokens":6176},"replaced_tokens":5600,"response_budget":{"limit_chars":24000,"serialized_chars":12869,"tier":"default"},"state":{"truncated":true},"targets":["packages/core/alembic/versions/0051_graph_nodes_repo_type_index.py","packages/core/src/repowise/core/persistence/_interfaces/_meta.py","packages/server/src/repowise/server/schemas/repository.py","packages/api-client/src/types/repository.ts","packages/core/src/repowise/core/workspace/repo_index.py","packages/core/alembic/versions/0046_wiki_symbols_repo_path_index.py","packages/core/src/repowise/core/persistence/crud/repository.py","packages/core/src/repowise/core/workspace/repo_index.py","packages/core/src/repowise/core/persistence/crud/repository.py","packages/core/src/repowise/core/persistence/_interfaces/_graph_records.py","packages/core/src/repowise/core/pipeline/full_index.py","packages/core/src/repowise/core/persistence/_interfaces/_analysis.py","packages/core/src/repowise/core/persistence/models.py","packages/core/src/repowise/core/persistence/crud/repository.py","packages/core/src/repowise/core/persistence/stores/_sql_meta.py","packages/core/src/repowise/core/persistence/crud/repository.py","packages/core/src/repowise/core/persistence/crud/git.py","packages/core/src/repowise/core/persistence/crud/repository.py","packages/core/src/repowise/core/persistence/_interfaces/index_store.py"],"tokens_saved":2296},"candidates_emitted":0,"candidates_reduced_reason":"response_budget","candidates_total":50,"omission_marker":"[repowise#5fe350551fca: 273 lines omitted (~3223 tokens); restore: repowise expand 5fe350551fca]","results":[{"confidence_score":1.0,"page_type":"file_page","relevance_score":4.345,"snippet":"# packages/core/alembic/versions/0051_graph_nodes_repo_type_index.py\n\n## Overview\n\nIndex `graph_nodes` on `(repository_id, node_type)`.\n\n`node_type == \"file\"` is the most-issued predicate on this tabl","sources":["fts","vector"],"target_path":"packages/core/alembic/versions/0051_graph_nodes_repo_type_index.py","title":"File: packages/core/alembic/versions/0051_graph_nodes_repo_type_index.py"},{"confidence_score":0.99,"page_type":"file_page","relevance_score":4.298,"snippet":"# packages/core/src/repowise/core/persistence/_interfaces/_meta.py\n\n## Overview\n\nIndexStore mixin: repository, generation jobs, pages, chat, webhooks.\n\nThis mixin covers the \"meta\" surface \u2014 the top-l","sources":["fts","vector"],"target_path":"packages/core/src/repowise/core/persistence/_interfaces/_meta.py","title":"File: packages/core/src/repowise/core/persistence/_interfaces/_meta.py"},{"confidence_score":0.92,"page_type":"file_page","relevance_score":3.983,"snippet":"# packages/server/src/repowise/server/schemas/repository.py\n\n## Overview\n\nRepository request/response models.\n\nIt exposes 9 public symbols and depends on 2 other files.\n\n## Public API\n\n| Symbol | Kind","sources":["fts","vector"],"target_path":"packages/server/src/repowise/server/schemas/repository.py","title":"File: packages/server/src/repowise/server/schemas/repository.py"},{"confidence_score":0.92,"page_type":"file_page","relevance_score":3.977,"snippet":"# packages/api-client/src/types/repository.ts\n\n## Overview\n\nTypes module repository defining RepoCreate, RepoUpdate, RepoResponse. `packages/api-client/src/types/repository.ts` is a typescript source","sources":["fts","vector"],"target_path":"packages/api-client/src/types/repository.ts","title":"File: packages/api-client/src/types/repository.ts"},{"confidence_score":0.91,"file":"packages/core/src/repowise/core/workspace/repo_index.py","page_id":"symbol_spotlight:packages/core/src/repowise/core/workspace/repo_index.py::open_repo_index","page_type":"symbol_spotlight","relevance_score":3.951,"snippet":"# packages.core.src.repowise.core.workspace.repo_index.open_repo_index\n\n**Kind:** function (async) | **Defined in:** `packages/core/src/repowise/core/workspace/repo_index.py` | **Estimated complexity:","sources":["fts","vector"],"symbol_id":"packages/core/src/repowise/core/workspace/repo_index.py::open_repo_index","target_path":"packages/core/src/repowise/core/workspace/repo_index.py","title":"Symbol: packages.core.src.repowise.core.workspace.repo_index.open_repo_index"},{"confidence_score":0.87,"page_type":"file_page","relevance_score":3.801,"snippet":"# packages/core/alembic/versions/0046_wiki_symbols_repo_path_index.py\n\n## Overview\n\nIndex `wiki_symbols` on `(repository_id, file_path)`.\n\nEvery file-scoped symbol lookup joins on this pair, but the o","sources":["fts","vector"],"target_path":"packages/core/alembic/versions/0046_wiki_symbols_repo_path_index.py","title":"File: packages/core/alembic/versions/0046_wiki_symbols_repo_path_index.py"},{"confidence_score":0.86,"file":"packages/core/src/repowise/core/persistence/crud/repository.py","page_id":"symbol_spotlight:packages/core/src/repowise/core/persistence/crud/repository.py::upsert_repository","page_type":"symbol_spotlight","relevance_score":3.75,"snippet":"# packages.core.src.repowise.core.persistence.crud.repository.upsert_repository\n\n**Kind:** function (async) | **Defined in:** `packages/core/src/repowise/core/persistence/crud/repository.py` | **Estim","sources":["fts","vector"],"symbol_id":"packages/core/src/repowise/core/persistence/crud/repository.py::upsert_repository","target_path":"packages/core/src/repowise/core/persistence/crud/repository.py","title":"Symbol: packages.core.src.repowise.core.persistence.crud.repository.upsert_repository"},{"confidence_score":0.75,"page_type":"file_page","relevance_score":3.246,"snippet":"# packages/core/src/repowise/core/workspace/repo_index.py\n\n## Overview\n\nRead-only index access for the cross-repo hooks.\n\nThe hooks run immediately after ingestion writes each repo's\n`.repowise/wiki.d","sources":["fts","vector"],"target_path":"packages/core/src/repowise/core/workspace/repo_index.py","title":"File: packages/core/src/repowise/core/workspace/repo_index.py"},{"confidence_score":0.74,"file":"packages/core/src/repowise/core/persistence/crud/repository.py","page_id":"symbol_spotlight:packages/core/src/repowise/core/persistence/crud/repository.py::get_repository","page_type":"symbol_spotlight","relevance_score":3.225,"snippet":"# packages.core.src.repowise.core.persistence.crud.repository.get_repository\n\n**Kind:** function (async) | **Defined in:** `packages/core/src/repowise/core/persistence/crud/repository.py` | **Estimate","sources":["fts","vector"],"symbol_id":"packages/core/src/repowise/core/persistence/crud/repository.py::get_repository","target_path":"packages/core/src/repowise/core/persistence/crud/repository.py","title":"Symbol: packages.core.src.repowise.core.persistence.crud.repository.get_repository"},{"confidence_score":0.73,"page_type":"file_page","relevance_score":3.183,"snippet":"# packages/core/src/repowise/core/persistence/_interfaces/_graph_records.py\n\n## Overview\n\nIndexStore mixin: relational graph rows, external systems, symbols.\n\nThe \"graph records\" surface of `IndexStor","sources":["fts","vector"],"target_path":"packages/core/src/repowise/core/persistence/_interfaces/_graph_records.py","title":"File: packages/core/src/repowise/core/persistence/_interfaces/_graph_records.py"},{"confidence_score":0.71,"page_type":"file_page","relevance_score":3.082,"snippet":"# packages/core/src/repowise/core/pipeline/full_index.py\n\n## Overview\n\nFull index-only pipeline run + persistence for a single repo.\n\nThe \"index this repo from scratch\" step shared by `repowise worksp","sources":["fts","vector"],"target_path":"packages/core/src/repowise/core/pipeline/full_index.py","title":"File: packages/core/src/repowise/core/pipeline/full_index.py"},{"confidence_score":0.71,"page_type":"file_page","relevance_score":3.069,"snippet":"# packages/core/src/repowise/core/persistence/_interfaces/_analysis.py\n\n## Overview\n\nIndexStore mixin: git metadata, dead code, decisions, health, coverage.\n\nThe \"analysis\" surface of IndexStore \u2014 any","sources":["fts","vector"],"target_path":"packages/core/src/repowise/core/persistence/_interfaces/_analysis.py","title":"File: packages/core/src/repowise/core/persistence/_interfaces/_analysis.py"},{"confidence_score":0.66,"file":"packages/core/src/repowise/core/persistence/models.py","page_id":"symbol_spotlight:packages/core/src/repowise/core/persistence/models.py::Repository","page_type":"symbol_spotlight","relevance_score":2.875,"snippet":"# Repository\n\n**Kind:** class | **Defined in:** `packages/core/src/repowise/core/persistence/models.py` | **Estimated complexity:** 1\n\n```\nclass Repository\n```\n\n## Overview\n\n`Repository` is a class de","sources":["fts","vector"],"symbol_id":"packages/core/src/repowise/core/persistence/models.py::Repository","target_path":"packages/core/src/repowise/core/persistence/models.py","title":"Symbol: packages/core/src/repowise/core/persistence/models.py::Repository"},{"confidence_score":0.65,"file":"packages/core/src/repowise/core/persistence/crud/repository.py","page_id":"symbol_spotlight:packages/core/src/repowise/core/persistence/crud/repository.py::delete_repository","page_type":"symbol_spotlight","relevance_score":2.831,"snippet":"# packages.core.src.repowise.core.persistence.crud.repository.delete_repository\n\n**Kind:** function (async) | **Defined in:** `packages/core/src/repowise/core/persistence/crud/repository.py` | **Estim","sources":["fts","vector"],"symbol_id":"packages/core/src/repowise/core/persistence/crud/repository.py::delete_repository","target_path":"packages/core/src/repowise/core/persistence/crud/repository.py","title":"Symbol: packages.core.src.repowise.core.persistence.crud.repository.delete_repository"},{"confidence_score":0.65,"page_type":"file_page","relevance_score":2.827,"snippet":"ore/src/repowise/core/persistence/stores/_sql_meta.py\n\n## Overview\n\nMeta-domain delegations for `SqlIndexStore`.\n\nEach method here is a one-to-one delegation to `crud`. Split out from\n`sql_index_store","sources":["fts","vector"],"target_path":"packages/core/src/repowise/core/persistence/stores/_sql_meta.py","title":"File: packages/core/src/repowise/core/persistence/stores/_sql_meta.py"},{"confidence_score":0.65,"page_type":"file_page","relevance_score":2.817,"snippet":"# packages/core/src/repowise/core/persistence/crud/repository.py\n\n## Overview\n\nCRUD operations for the repository domain (repowise persistence layer).\n\nSplit out of the former monolithic `crud.py`; `c","sources":["fts","vector"],"target_path":"packages/core/src/repowise/core/persistence/crud/repository.py","title":"File: packages/core/src/repowise/core/persistence/crud/repository.py"},{"confidence_score":0.64,"page_type":"file_page","relevance_score":2.76,"snippet":"| --- | --- | --- |\n| `upsert_git_metadata` | function | async def upsert_git_metadata(session, *, repository_id, file_path, **kwargs) -> GitMetadata |\n| `get_git_metadata` | function | async def get","sources":["fts","vector"],"target_path":"packages/core/src/repowise/core/persistence/crud/git.py","title":"File: packages/core/src/repowise/core/persistence/crud/git.py"},{"confidence_score":0.63,"file":"packages/core/src/repowise/core/persistence/crud/repository.py","page_id":"symbol_spotlight:packages/core/src/repowise/core/persistence/crud/repository.py::list_page_ids","page_type":"symbol_spotlight","relevance_score":2.735,"snippet":"# packages.core.src.repowise.core.persistence.crud.repository.list_page_ids\n\n**Kind:** function (async) | **Defined in:** `packages/core/src/repowise/core/persistence/crud/repository.py` | **Estimated","sources":["fts","vector"],"symbol_id":"packages/core/src/repowise/core/persistence/crud/repository.py::list_page_ids","target_path":"packages/core/src/repowise/core/persistence/crud/repository.py","title":"Symbol: packages.core.src.repowise.core.persistence.crud.repository.list_page_ids"},{"confidence_score":0.62,"page_type":"file_page","relevance_score":2.673,"snippet":"# packages/core/src/repowise/core/persistence/_interfaces/index_store.py\n\n## Overview\n\nIndexStore \u2014 aggregate pluggable CRUD facade.\n\n`IndexStore` combines three domain mixins:\n\n- `MetaIndexStore` (re","sources":["fts","vector"],"target_path":"packages/core/src/repowise/core/persistence/_interfaces/index_store.py","title":"File: packages/core/src/repowise/core/persistence/_interfaces/index_store.py"}],"results_emitted":19,"results_reduced_reason":"response_budget","results_total":50,"truncated":true}}\ No newline at end of filediff --git a/tests/unit/cli/test_tool_bridge.py b/tests/unit/cli/test_tool_bridge.pyindex ff2e1d900..1292ddbbe 100644--- a/tests/unit/cli/test_tool_bridge.py+++ b/tests/unit/cli/test_tool_bridge.py@@ -76,10 +76,11 @@ def _answer_only(result: dict) -> dict:"""The tool's own payload, minus the budget envelope the bridge stamps.A bridged call is budgeted the way the MCP middleware budgets an MCP call,- so every response gains ``_meta.response_budget``. What must not change is- the answer the tool returned.+ so every response gains ``_meta.response_budget`` and ``_meta.completeness``.+ What must not change is the answer the tool returned."""- meta = {k: v for k, v in (result.get("_meta") or {}).items() if k != "response_budget"}+ stamped = {"response_budget", "completeness"}+ meta = {k: v for k, v in (result.get("_meta") or {}).items() if k not in stamped}answer = {k: v for k, v in result.items() if k != "_meta"}if meta:answer["_meta"] = metadiff --git a/tests/unit/server/mcp/test_response_budget_contracts.py b/tests/unit/server/mcp/test_response_budget_contracts.pyindex 8faa84a52..27d984396 100644--- a/tests/unit/server/mcp/test_response_budget_contracts.py+++ b/tests/unit/server/mcp/test_response_budget_contracts.py@@ -580,3 +580,107 @@ def test_recorded_shapes_cover_the_tools_that_can_be_exercised() -> None:# generate_refactoring_code needs a stored plan, which the recorded index# had none of. Reported as not measured rather than assumed bounded.assert set(shapes) == set(_TOOL_MODULES) - {"generate_refactoring_code"}+++ "tool",+ [+ "get_context",+ "get_risk",+ "get_change_risk",+ "get_answer",+ "get_why",+ "get_overview",+ "get_health",+ ],+)+def test_completeness_sums_what_the_budget_dropped(+ setup_mcp: str, tmp_path: Path, monkeypatch: pytest.MonkeyPatch, tool: str+) -> None:+ """One stamp answers "is this everything", without walking every counter."""+ import repowise.server.mcp_server as mcp_mod++ repo = tmp_path / tool+ (repo / ".repowise").mkdir(parents=True)+ monkeypatch.setattr(mcp_mod, "_repo_path", str(repo))+ result = _enforce(tool, _payload(tool, 15_000))++ completeness = result["_meta"]["completeness"]+ assert completeness["capped"] is True+ assert completeness["reason"] == "response_budget"+ assert completeness["shown"] < completeness["total"]+++ "tool",+ [+ "get_context",+ "get_risk",+ "get_change_risk",+ "get_answer",+ "get_why",+ "get_overview",+ "get_health",+ ],+)+def test_completeness_reports_an_untouched_response_as_whole(+ setup_mcp: str, tmp_path: Path, monkeypatch: pytest.MonkeyPatch, tool: str+) -> None:+ """A response that lost nothing says so, and claims no reason for a loss."""+ import repowise.server.mcp_server as mcp_mod++ repo = tmp_path / tool+ (repo / ".repowise").mkdir(parents=True)+ monkeypatch.setattr(mcp_mod, "_repo_path", str(repo))+ result = _enforce(tool, _payload(tool, 0))++ completeness = result["_meta"]["completeness"]+ assert completeness["capped"] is False+ assert "reason" not in completeness+++def test_completeness_names_the_pass_that_dropped_the_most() -> None:+ """Two passes reduced this response; the reason names the heavier one."""+ payload = {+ "rows": [{"id": 1}],+ "rows_total": 5,+ "rows_emitted": 1,+ "rows_reduced_reason": "construction_cap_and_response_budget",+ "others": [{"id": 2}],+ "others_total": 3,+ "others_emitted": 1,+ "others_reduced_reason": "construction_cap",+ }+ result = _enforce("get_overview", payload)++ assert result["_meta"]["completeness"] == {+ "capped": True,+ "shown": 2,+ "total": 8,+ "reason": "construction_cap_and_response_budget",+ }+++def test_completeness_claims_no_reason_when_no_pass_recorded_one() -> None:+ """A tool that flags its own truncation is not the budget's doing."""+ result = _enforce("get_symbol", {"source": "def f(): ...", "truncated": True})++ assert result["_meta"]["completeness"] == {"capped": True}+++def test_floor_names_only_the_graph_counts_the_response_carries() -> None:+ """A count absent from the payload is not claimed as a floor."""+ payload = {+ "directive": {"summary": "review"},+ "targets": [{"target": "src/a.py", "dependents_count": 3, "impact_surface_total": 9}],+ "_meta": {"contract_version": 1},+ }+ result = _enforce("get_risk", payload)++ assert result["_meta"]["floor"] == ["dependents_count", "impact_surface_total"]+++def test_a_tool_with_no_graph_counts_claims_no_floor() -> None:+ result = _enforce("get_overview", _payload("get_overview", 0))++ assert "floor" not in result["_meta"]diff --git a/tests/unit/server/mcp/test_token_calibration.py b/tests/unit/server/mcp/test_token_calibration.pynew file mode 100644index 000000000..f2619ba99--- /dev/null+++ b/tests/unit/server/mcp/test_token_calibration.py@@ -0,0 +1,76 @@+"""The token estimator's error against a real tokenizer, on recorded responses.++The MCP host caps a tool result in tokens and spills an over-cap result to a+sidecar file the agent has to read back. The budget is declared in characters,+so :func:`estimate_response_tokens` is what converts between the two, and an+estimate that runs low is the failure that costs a caller the extra read.++The rates were fitted on this same corpus, so these bounds are a regression+guard rather than evidence that they generalise to an unrecorded payload.+"""++from __future__ import annotations++import json+from pathlib import Path+from typing import Any++import pytest++from repowise.server.mcp_server._budget.budgeter import estimate_response_tokens++#: Budgeted payloads recorded by ``scripts/measure_mcp_response_sizes.py+#: --responses`` against an indexed repository. Regenerate when a tool's+#: payload changes shape.+_RESPONSES_FIXTURE = (+ Path(__file__).resolve().parents[3]+ / "fixtures"+ / "mcp"+ / "token_calibration_responses.json"+)++#: Mean absolute percentage error the rate table has to hold across the corpus.+_MAX_MEAN_ERROR = 0.10++#: No single payload may hide behind the mean.+_MAX_SINGLE_ERROR = 0.15++#: Undercounting is the error that costs a caller a read, so it is held+#: tighter than the symmetric bound.+_MAX_UNDERCOUNT = 0.12++[email protected](scope="module")+def errors() -> dict[str, float]:+ """Signed relative error per recorded response, estimate against tokenizer."""+ tiktoken = pytest.importorskip(+ "tiktoken", reason="ships transitively with litellm; run `uv sync`"+ )+ try:+ encoding = tiktoken.get_encoding("o200k_base")+ except Exception as exc: # pragma: no cover - cold vocab cache, no network+ pytest.skip(f"o200k_base unavailable: {exc}")+ payloads: dict[str, Any] = json.loads(_RESPONSES_FIXTURE.read_text(encoding="utf-8"))+ assert payloads, "the recorded corpus is empty"+ measured = {}+ for name, payload in payloads.items():+ wire = json.dumps(payload, separators=(",", ":"), default=str)+ actual = len(encoding.encode(wire))+ measured[name] = (estimate_response_tokens(payload) - actual) / actual+ return measured+++def test_estimate_holds_its_mean_error_across_recorded_responses(+ errors: dict[str, float],+) -> None:+ mean = sum(abs(error) for error in errors.values()) / len(errors)++ assert mean <= _MAX_MEAN_ERROR, f"mean error {mean:.3f}: {errors}"+++def test_no_single_recorded_response_is_mis_estimated(errors: dict[str, float]) -> None:+ outside = {name: error for name, error in errors.items() if abs(error) > _MAX_SINGLE_ERROR}+ under = {name: error for name, error in errors.items() if error < -_MAX_UNDERCOUNT}++ assert not outside, f"outside +/-{_MAX_SINGLE_ERROR}: {outside}"+ assert not under, f"undercounted past -{_MAX_UNDERCOUNT}: {under}"