Skip to content

Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.

release: v0.43.0 (#1612)

Raghav Chamadiya81ed144c282d
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json
index e7ff8505e..fbcebee78 100644
--- a/.claude-plugin/marketplace.json
+++ b/.claude-plugin/marketplace.json
@@ -14,7 +14,7 @@
"name": "repowise",
"source": "./plugins/claude-code",
"description": "Codebase intelligence for Claude Code. Indexes your repo into five layers (Graph, Git, Docs, Decisions, Code Health) and gives Claude deep understanding of architecture, ownership, hotspots, decisions, and defect risk — fewer greps, fewer file reads, lower cost per query.",
- "version": "0.42.0",
+ "version": "0.43.0",
"category": "productivity",
"keywords": [
"codebase",
diff --git a/README.md b/README.md
index efb6ca7ea..12c9277e7 100644
--- a/README.md
+++ b/README.md
@@ -128,7 +128,7 @@ queryable from the CLI, the MCP tools, and the local dashboard.
| Layer | What it gives you | Edge |
|---|---|---|
-| **◈ Graph** | Dependency graph across 18 languages · file + symbol nodes · 3-tier call resolution · Leiden communities · PageRank and execution flows · route→handler edges across 22 frameworks | A real graph most tools never build |
+| **◈ Graph** | Dependency graph across 19 languages · file + symbol nodes · 3-tier call resolution · Leiden communities · PageRank and execution flows · route→handler edges across 22 frameworks | A real graph most tools never build |
| **◈ Git** | Hotspots (decayed churn + activity floors) · ownership % · co-change pairs (hidden coupling) · bus factor · which files actually get bug-fixed, and how recently | Behavioural signals static analysis cannot see |
| **◈ Docs** | A generated wiki page per module and file · rebuilt incrementally every commit · freshness and confidence scoring · hybrid search (full-text + vector) · selectable style and output language | Stays current instead of rotting |
| **◈ Decisions** | Architectural decisions mined from five sources, evidence-backed, each traced to a verbatim source span and stamped exact / fuzzy / unverified | **★ Captured nowhere else** |
@@ -404,7 +404,7 @@ the orchestrators. Full matrix and the contributor recipe:
## Supported languages
-**18 languages parsed to AST · 13 at the Full tier · framework-aware across all of them.**
+**19 languages parsed to AST · 13 at the Full tier · framework-aware across all of them.**
<p>
<strong>Full tier &nbsp;</strong>
@@ -428,6 +428,7 @@ the orchestrators. Full matrix and the contributor recipe:
<img src="https://img.shields.io/badge/Swift-F05138?style=flat-square&logo=swift&logoColor=white" alt="Swift" />
<img src="https://img.shields.io/badge/PHP-777BB4?style=flat-square&logo=php&logoColor=white" alt="PHP" />
<img src="https://img.shields.io/badge/Dart-0175C2?style=flat-square&logo=dart&logoColor=white" alt="Dart" />
+ <img src="https://img.shields.io/badge/Delphi-EE1F35?style=flat-square&logo=delphi&logoColor=white" alt="Object Pascal / Delphi" />
&nbsp;<strong>· Partial &nbsp;</strong>
<img src="https://img.shields.io/badge/Luau-00A2FF?style=flat-square&logo=lua&logoColor=white" alt="Luau" />
</p>
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 0b2456efd..8107290b7 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -11,31 +11,89 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+---
+
+## [0.43.0] — 2026-08-15
+
+The through-line this cycle is a number meaning what it says. Change risk scored the size of the diff and presented it as danger. `get_answer` could return `confidence: high` beside `retrieval_quality: weak`, with a note that asserted dominance and denied it in the same sentence. `get_why` answered every question, including the ones its store knew nothing about. The dashboard summed dead exports across a side project and a monorepo. Six surfaces each computed hotspot health their own way and none of them agreed. Each of those is fixed by giving the answer one owner and reporting the reason alongside it. `repowise risk` now leads with the bug-fix history of the files a change touches, an answer's confidence note quotes the test that earned it, and a question the decision store cannot answer gets a redirect instead of the three closest records.
+
+The second theme is what a keyless install gets. `get_answer` with embeddings but no LLM key used to return a ranked file list and nothing else, though the evidence around it (live symbol bodies, candidate justifications, rationale comments) needs no provider at all. It builds all of that now, and rates its retrieval instead of only doubting itself. `init` also stopped losing an API key supplied through the environment, which is the path agents and CI take.
+
+Underneath, the graph got a good deal more honest: the edge-type vocabulary is now true and enforced, dependency answers stopped including containment and co-change rows, and "can execution start here" has one owner instead of four.
+
+### Added
+
+- **Object Pascal / Delphi support** (Good tier), taking the language count to 19. Symbols, imports, heritage, and a call graph that handles the parenless calls Pascal is written with. Verified against a 151-file real Delphi codebase. (#1353)
+- **Dead code detects deprecation annotations.** `@Deprecated`, `[Obsolete]`, `@deprecated` and their language siblings now feed a finding's confidence. (#1472)
+- **`repowise decision add` records from flags.** A flag per field, and no prompting at all once `--title` and `--decision` are both present, so a script or an agent with no terminal can record one. `--format json` returns the id to pass back to `confirm` or `show`. Flag-driven records land `proposed` where the prompts record `active`. (#1566)
+- **Record a decision from the web UI.** The decisions page had no way to start a record and an empty state that sent you to a terminal. It now has a form, reachable even on a repo with no decisions yet. (#1567)
+- **`GET /api/repos/summary`** returns every repository's headline figures in one call, replacing the `2N+1` requests the multi-repo dashboard used to make. Flat in the number of repos: six queries at 1 repo, six at 26. (#1577)
+- **`repowise workspace scan --exclude`**, plus a bulk decline, so a scan of a large tree does not have to be answered repo by repo. (#1591)
+
### Changed
-- **Default OpenAI model is now `gpt-5.6-luna`** (was `gpt-5.4-nano`). Same input
- price ($0.20/MTok), cheaper output ($1.20 vs $1.25), so it gets its own pricing
- rows rather than an alias, and nano stays selectable on its own rate. The
- 5.6 family also changed its reasoning ladder: `minimal` is gone and `xhigh` is
- new, so `--reasoning minimal` is now rejected up front for these models instead
- of failing as a 400 on the first live call. Despite what the model docs say,
- the API also rejects `max` for 5.6 (verified live against both `gpt-5.6-luna`
- and `gpt-5.6-sol`), so it is not offered.
+- **`repowise risk` and `get_change_risk` lead with fix history, not the score.** The 0-10 score restates the size of the diff: scoring by lines added alone reproduces it to within 0.16 points, and on 47 within-repo pairs across four repos it ranked the dangerous change above the boring one in none of them. The response now leads with `fix_history`, the recency-weighted bug-fix record of the files the change touches, which files carry it, and where that sits among the repo's own fix-bearing files. Ranking by that alone gets 46 of the same 47 pairs. It comes from one `git log` walk, so it needs no index and no coverage data. The score is kept and reported as what it measures, diff size and spread, named in `score_measures`. Model constants are unchanged. (#1593)
+- **Change-risk numbers say what they are.** `probability` is gone (it was `score / 10` with extra decimals). The absolute band is now `fallback_band` and appears only when there was no baseline to rank against. A new `score_unit` states that the scale is calibrated on individual commits, so a squash-merged PR or a `base..head` range reads high by construction. `nf`/`nd`/`ns` are no longer reported as drivers: their coefficients are collinearity with diff size, so as an explanation they contradicted themselves. (#1583)
+- **Default OpenAI model is now `gpt-5.6-luna`** (was `gpt-5.4-nano`). Same input price ($0.20/MTok), cheaper output ($1.20 vs $1.25), so it gets its own pricing rows rather than an alias, and nano stays selectable on its own rate. The 5.6 family also changed its reasoning ladder: `minimal` is gone and `xhigh` is new, so `--reasoning minimal` is rejected up front for these models instead of failing as a 400 on the first live call. Despite what the model docs say, the API also rejects `max` for 5.6 (verified live against both `gpt-5.6-luna` and `gpt-5.6-sol`), so it is not offered. (#1594)
+- **`get_answer` serves real evidence with no LLM key.** An install with embeddings and no provider got a ranked file list and nothing else, though none of what it lost needs a provider: bodies are read live off disk at the indexed anchors. It now builds `symbol_bodies`, `best_guesses` and `code_rationale`, cites the paths they came from, and names one next action. It also rates the retrieval rather than only reporting `confidence: low`. On 26 paired questions, `symbol_bodies` went from 2/26 to 11/26 keyless. (#1508, #1576)
+- **The per-file symbol budget is spent on the question.** When a retrieved file held more symbols than its budget, hydration kept a prefix sorted by line number, so the bigger the file the stronger the top-of-file bias and the less reachable the symbol you asked about. Symbols are now scored against the question's terms for selection. The kept slice is still served in document order. (#1597)
+- **`get_why` ranks by question vocabulary and refuses when nothing matches.** Search mode answered every question: over twenty questions on an indexed repo, none of the eight unanswerable ones was refused, each costing 11k to 15k characters to answer wrongly. Ranking is now the share of the question's vocabulary a record carries, weighted by term rarity, and a miss returns an empty list with the tool that fits the question's shape. Average response 12,492 characters down to 5,624. The right record now ranks first on all twelve answerable questions, up from none. (#1558)
+- **`get_why` search payloads roughly halved.** Natural-language mode was the only one of the three with no caps at all, at 27k to 35k characters against a 32k transport budget, so two of five probe questions were over the ceiling outright, where the host rejects rather than truncates. One embedding per call instead of two, `affected_files` clamped to a head plus a total, restatements collapsed on cited evidence, and three whole records rather than eight thinned ones. Now 12k to 16k characters, latency down 11% to 29%. (#1555)
+- **`get_why` answers about its `--target` / `targets`.** It chose the health dashboard before looking at the targets, so naming a file and asking nothing returned the repo-wide summary. Targets are read first now: one target is path mode, several get a card each. (#1566)
+- **The multi-repo dashboard puts the repositories back at the centre.** Four metric cards over a repo list becomes a repository list as the subject, ordered by attention rather than last write, each row carrying its health band and a marker only when something needs doing. The aggregates that legitimately add moved to a stat ribbon. `file_count` was counting symbol nodes as files, about 10x too large, and is fixed at the source, so the chat empty state gets it too. (#1577, #1578)
+- **The workspace pages are on the design language.** All four are server-rendered again with filter and selection state in URL params, so a filtered view is linkable. Figures that summed things which do not add were deleted rather than restyled: an averaged coupling heuristic over a truncated list, an "Unmatched" count computed over one page of 200 rows and presented as a workspace total, a breakdown whose sum equalled the total it broke down, and an unweighted average of per-repo coverage percentages. Contract figures now come from the diagnostics endpoint, which knows the denominators, and the table states its bound. (#1582)
+- **The VS Code extension is on the current design language.** Two local `scoreColor` copies called anything at or above 7.5 healthy-green while the canonical bands start at 8, so a file's score printed green beside a map colouring it amber. Both copies are gone. High-contrast themes now get a real high-contrast treatment instead of falling through to the ordinary ramps, and the health, settings, decisions and risk views take the shared components. (#1575)
+- **`--no-editor-setup` means no editor setup.** It gated only machine-wide MCP registration, so there was no combination of flags that indexed a repo without writing `.mcp.json`, `.claude/CLAUDE.md`, `.vscode/mcp.json` and `.vscode/extensions.json` into it. Now one switch means one thing: only `.repowise/` is touched. `init` also ends by naming the files it actually wrote, sourced from the writers rather than a hardcoded list. Note for CI: `REPOWISE_SKIP_EDITOR_SETUP=1` is the same switch, so a harness exporting it to protect a global config will stop getting `.mcp.json`. (#1572)
+- **The init screens are one system.** The banner's wordmark ran a colour ramp whose jitter exceeded its own gradient, so what shipped was orange static in the first thing a user sees. It is one brand colour now. Four panels that are not objects you act on lose their border, the palette is closed to the declared colours, and the completion panel names two commands instead of up to seven. (#1571)
+- **Generation progress splits paid work from free.** One bar counted 4,229 items where about 4,134 were template renders and 95 were model calls, so it reached 97% in minutes and then sat there, indistinguishable from a hang. Each cost tier gets its own total, the free bar finishes and hides, and persistence gets a bar instead of an indeterminate spinner. (#1599, #1607)
+- **Degraded phases are visible on a normal run.** The CLI pins core logging to ERROR unless `--verbose`, so whole phases could fail (the parse pool dying back to one process, a checkpoint not reaching disk) and print nothing. Those now render through the progress channel, including on a non-TTY, and are collected into `state.json` as `degraded`, the way `update` already reports one, with key-shaped text redacted on the way in. (#1599)
+- **The Codex hook stopped waking on every prompt.** It registered `UserPromptSubmit` with no matcher and returned the same static note `SessionStart` had already delivered, so an agentic turn paid one process start per prompt to repeat a block the agent was already holding. The event is retired, and existing installs are migrated rather than left behind, since the merge into `.codex/hooks.json` is additive and reinstalling would have repaired nothing. (#1549)
+- **Hotspot health has one owner, computed live.** Six surfaces answered the question and disagreed. `get_overview` and `repowise status` averaged the top 25% of files by size rather than churn, differing from the persisted KPI on all 42 local indexes with a median gap of 2.67 points of 10. Two dashboard routes read a snapshot that goes stale after `repowise update`, and `get_health` did not return the number at all. `None` now means "this repo has no hotspot files", kept distinct from a low score. (#1552)
+- **The edge-type vocabulary is true and enforced.** The `EdgeType` declaration was decorative: it listed three types nothing emits and omitted four that producers emit constantly (6,750 rows), and thirteen modules each kept a private set written against it. Shared families replace all of them, with an AST guard test over every call site. Cycle detection gains 6,153 edges it never matched, and a file reachable only through a dynamic import could previously be reported dead. (#1516, #1518)
+- **Dependency answers read dependency edges.** `graph_edges` also holds containment (`defines`, `has_method`) and the temporal `co_changes` relation, and several graph reads loaded every row and presented the result as dependencies. 43.7% of the rows the file-dependencies panel read were neither, and 34,570 of this repo's 34,808 symbols listed their own declaring file or class as a caller. Each site now names the view it wants, and degree counts are scoped to whatever is displayed beside them. (#1531)
+- **"Can execution start here" has one owner, decided at ingestion.** Four implementations disagreed, so one file could lead the orientation list and be absent from the curated one. The flag is also what exempts a file from dead-code detection, so a name-only guess was a file nothing could ever report: 1,151 flags are withdrawn across 42 indexes and exactly one file becomes a new dead-code candidate. Entry-point lists on three remaining surfaces now use the shared ranking rather than PageRank, which rewards fan-in and floats a package-root barrel above the real front door. (#1533, #1547, #1556, #1559)
+- **Workspace contracts are read from the parsed index.** Extraction re-derived route tables with regexes after ingestion had already parsed the same files. Python HTTP providers now come from the symbols ingestion produced, so a route cannot be picked up from a comment or lost for having an empty path, and the regex dialects stay reachable for every language with no AST tier. Five extractors that each walked the repo now share one walk: 45.2s down to 14.7-17.9s, 13,889 file reads down to 3,216, contracts and links unchanged. (#1581)
+- **HTTP client wrappers are confirmed from the parse, not from their names.** The JS dialect decided a call was a service call by matching the callee's name against `fetch|request|http|api|ajax|rest|rpc`, which invents contracts for functions merely named that way and misses every wrapper that is not. A symbol is now confirmed by its body issuing a sink call, within a 2-hop budget. Measured on one frontend API layer: 12 contracts to 162. Unresolvable paths are counted and reported, never guessed. (#1585)
+- **A workspace commit re-extracts only the repos that changed.** `changed_repos` was accepted and never read. Reuse is validated rather than trusted (carried forward only when the alias is unchanged, HEAD matches the stamp, the tree is clean and the contract config is unchanged), and every way of disagreeing resolves toward re-extraction. Cross-repo analysis and contract extraction now run concurrently, and each of the five phases logs its duration. (#1596)
+- **Truncated lists carry their true totals** for cycles, co-change pairs and per-edge evidence, after the architecture score turned out to be computed from a capped cycle count, so 500 cycles scored the same as 50. Conformance and breaking-change reports are stamped when they run, so a report that never ran no longer renders as a clean bill of health. Contract extraction reports its coverage from counts it was already recording. (#1591)
+- **Dead-code confidence tiers have one owner.** Eleven more literal `0.7`/`0.4` comparisons and caps now read the shared constants, with a guard test outlawing the shapes that kept recurring. Behaviour-preserving, measured over 42 indexed repositories: 3,930 findings both sides, none moving. Risk factors also render as words rather than API slugs, so a tooltip reads "configuration, runtime-loaded web asset" instead of "config, asset". (#1561, #1574)
+- **`get_answer`'s internals are split into named modules.** `answer.py` had grown to 2,805 lines doing every job in the tool at once. Pure moves: no logic, ordering, threshold or payload change. (#1510, #1584)
### Fixed
-- **`init` now persists an API key supplied through the environment.** Key
- persistence used to hang off the interactive key *prompt*, so
- `repowise init --provider openai --yes` with `OPENAI_API_KEY` already exported
- indexed fine and wrote `provider:` to `config.yaml`, but left no
- `.repowise/.env`, and `repowise mcp` against that repo then answered
- `degraded: "no-llm-provider"` with retrieval-only output. Scripted init is the
- primary path for agents and CI, so a run that succeeds now leaves a repo whose
- MCP server can actually answer. The key that indexed the repo is saved, with a
- one-line notice naming the file; `--no-save-key` (or `REPOWISE_NO_SAVE_KEY=1`)
- opts out, and answering No at the interactive prompt still wins. Covers
- `init`, workspace init and `workspace add`. The `.gitignore` entry is now
- written *before* the key, so a failure cannot leave a committable secret.
+- **Inline decision markers stopped matching ordinary prose.** The keyword matched case-insensitively, so a wrapped sentence beginning "# decision: ..." and a test label reading "# Rejected: nothing to extract" became the only two "decisions" a fresh index of this repository produced, one of them a mid-sentence fragment attached to twenty files. The keyword is now capitalised like `TODO:`. Markers past the fifth in a file were also silently dropped, and a source that failed was indistinguishable from a source that honestly found nothing. Failures are now reported as warnings naming the source and the error. (#1610)
+- **A confidence note is written from the reason the grade was reached.** `get_answer` could return `confidence: high` beside `retrieval_quality: weak`, with a note claiming "clearly dominates (dominance ratio 1.00x)", a ratio of 1.00x being a tie. Dominance had two owners that disagree in a real window. There is one now, so `retrieval_quality: weak` means exactly "not dominant", and each note quotes the test that actually earned the grade. Answer-grounding can no longer earn `high` over a weak retrieval unless you opt in. (#1605)
+- **A stray delimiter no longer hides the rest of a file.** The masking walk behind `withheld_symbols` discarded and re-walked when a template literal was left open at end of file, but triple-quoted runs and block comments got no such treatment. Either one left open masked every line below it, and the note then described a smaller set of withheld symbols than the payload had withheld. A stored symbol end line is also clamped to the live file, so a body served whole can no longer be flagged as cut with a continuation pointing past the last line. (#1580)
+- **`repowise search` and `ask` stopped falling back to keyless embeddings** on a repo indexed with a real key in the same shell, reporting no semantic search against an index full of 1536-wide vectors. The CLI had no key resolver at all and never read `<repo>/.repowise/.env`, the file `init` writes the key to, so the MCP server and the CLI disagreed about the same directory. The degraded message also names where it looked, instead of telling a user to set a variable whose value is already on disk. (#1599)
+- **`init` persists an API key supplied through the environment.** Key persistence hung off the interactive key *prompt*, so `repowise init --provider openai --yes` with `OPENAI_API_KEY` exported indexed fine but left no `.repowise/.env`, and `repowise mcp` against that repo answered `degraded: "no-llm-provider"`. The key that indexed the repo is now saved, with a one-line notice naming the file. `--no-save-key` (or `REPOWISE_NO_SAVE_KEY=1`) opts out, and answering No at the prompt still wins. Covers `init`, workspace init and `workspace add`. `.gitignore` is written *before* the key, so a failure cannot leave a committable secret. (#1595)
+- **The chat window never streams with nothing to show.** A turn that ended without a terminal event left the composer spinning forever with no reason printed. The stream never settled when the reader ended early, an unknown-conversation failure was sent without the `type` field the client switches on, and the send never handed its `AbortSignal` to `fetch`, so a cancelled turn left the POST running and a database session open. (#1586)
+- **The `module_page` prompt stopped tripping its own validator.** It asked the model to ground claims in "the supplied material", which is a literal match for one of the artifact rules, so a page that echoed the instruction's own wording was rejected and thrown away with its tokens already spent. Reworded, with a guard asserting no prompt or template matches any rule, plus one corrective re-ask so a paid-for page is not simply lost. Symbol spotlight pages also bound their importer list: three pages on this repo were about 46.6k characters, of which 45.7k was the list, so the tail fell outside the embedding window and the pages were searchable only by their first few hundred importers. (#1606)
+- **The knowledge graph rebuilds when the builder changes**, not only when the graph does. The fingerprint measured node, edge and community counts, which hold still while the builder changes underneath them, so a store kept serving an artifact built before six edge types were admitted. (#1592)
+- **Truncated agent-facing lists are ranked before they are cut.** Stale decisions, proposals awaiting review and ungoverned hotspots were appended in scan order, so "your ten stale decisions" meant ten arbitrary ones. Six generation lists and the transitive-affected walk behind `get_risk`'s `will_break` had the same shape. (#1590, #1598)
+- **Change-risk correctness.** Uncommitted work is scored when the tree is dirty instead of silently scoring the previous commit. Merge commits are read against their first parent, so `impacted_tests` and `prior_fixes` are no longer empty for a merged PR the same response says touched several files. A failed author lookup reports unknown rather than `0`, which the model priced as risk. The 200-commit baseline walk is now cached whole rather than per scored commit, and self-exclusion works for the default `HEAD` target, which had been ranking against itself. (#1583, #1589)
+- **Cached pickles under `.repowise/` are HMAC-sealed before unpickling**, so a crafted cache file committed into a repository cannot execute code during `init` or `update` (CWE-502). (#1439)
+- **`REPOWISE_EMBEDDING_TIMEOUT` is honoured by every embedder.** Only the Ollama one read it. openai, gemini and openrouter hardcoded 10s, and an expired batch is not retried: it is reported once as "N/N items failed to embed" while the run exits 0. A malformed value now warns and falls back instead of silently downgrading the run to a keyless 8-wide store. (#1475)
+- **`kimi-for-coding` models are sent `temperature=1`**, the only value that endpoint accepts. Every request through the kimi provider failed validation, which surfaced in `repowise generate` as every page silently falling back to a structural stub. (#1323)
+- **A failed schema-reconcile statement stops being permanent.** The walk aborted on the first raise, so every table ordered after the victim was never reached, on that call or any later one, and 13 read paths swallow the error, so a half-migrated store was reached silently. It continues past a failure now and re-raises once the walk is done. (#1509)
+- **`repowise update`'s up-to-date self-heal runs under the single-flight lock** (#1528), and the lock never reports `acquired` with no lock file on disk (#1524). The sync baseline is preserved when HEAD is unavailable (#1521).
+- **`repowise dead-code --format json` emits valid JSON.** The banner and two notices went to stdout ahead of the payload. (#1441)
+- **C# generic type arguments resolve** (#1550), and literal dynamic-import namespace use is tracked (#1548).
+- **Chat tooling matches the real surface.** The `get_context` include schema listed blocks that do not exist and omitted two that do (#1477), and `get_why` results render in chat artifacts instead of coming back blank (#1478).
+- **Dismiss dismisses.** The button sent `deprecated`, which is re-derived on every re-extraction, so dismissing a wrong proposal did not stick, which is the one thing the button exists to prevent. The shared status union gained `dismissed`, and the table gained the filter without which a dismissal is a one-way door. (#1567)
+- **Docker standalone output path** corrected for the monorepo layout. (#1562)
+- **`python -m repowise.cli.main` runs** instead of exiting 0 with no output. (#1591)
+
+### Documentation
+
+- `docs/layers/CHANGE_RISK.md` rewritten around fix history, including what the keyword-based fix classifier misses and why the ranking set is a falsification test rather than an accuracy estimate. (#1593)
+- Dead-code docs corrected against the code: the git-age ladder has six rungs and was documented as three, `safe_to_delete` omitted its runtime-load condition, the risk-factor token list read as complete while being partial, and `ARCHITECTURE.md` promised a whitelist file no code reads. (#1559, #1574)
+- Workspace docs drop a pom.xml scanning claim and an OpenAPI field-level breaking-change claim, neither of which is implemented, and document the socket extractor. (#1591)
+- Object Pascal added to `docs/layers/LANGUAGE_SUPPORT.md` with its known gaps. (#1353)
+- A dead-code CLI walkthrough, corrected hook event lists, and the editor-files architecture doc brought back in line with the current queries. (#1549, #1556)
+
+### Dependencies
+
+- Adds `tree-sitter-pascal` for Object Pascal support. (#1353)
---
diff --git a/packages/cli/src/repowise/cli/__init__.py b/packages/cli/src/repowise/cli/__init__.py
index ee70dacaf..a29f64073 100644
--- a/packages/cli/src/repowise/cli/__init__.py
+++ b/packages/cli/src/repowise/cli/__init__.py
@@ -16,4 +16,4 @@ from repowise.cli._stdio import _ensure_utf8_stdio
# is already UTF-8.
_ensure_utf8_stdio()
-__version__ = "0.42.0"
+__version__ = "0.43.0"
diff --git a/packages/cli/src/repowise/cli/agent_targets/_data/codex_prompts/repowise-decision.md b/packages/cli/src/repowise/cli/agent_targets/_data/codex_prompts/repowise-decision.md
index 22f282099..60342175b 100644
--- a/packages/cli/src/repowise/cli/agent_targets/_data/codex_prompts/repowise-decision.md
+++ b/packages/cli/src/repowise/cli/agent_targets/_data/codex_prompts/repowise-decision.md
@@ -24,7 +24,12 @@ sources and tracks them for staleness and conflicts. This command drives the
- **show** — `repowise decision show <id>` — full record: rationale, evidence
spans, status, and the supersession lineage.
- **add** — `repowise decision add` — guided interactive capture (~90s). Use when
- the user makes a decision during the session and wants it recorded.
+ the user makes a decision during the session and wants it recorded. With both
+ `--title` and `--decision` it records without prompting and prints the id
+ (`--format json` to parse it back), which is the form to use with no terminal.
+ The rest are optional: `--context`, `--rationale`, `--alternative`,
+ `--consequence`, `--affects`, `--tag`, the last four repeatable. A flag-driven
+ record lands `proposed` for a person to `confirm`.
- **confirm** — `repowise decision confirm` — review decisions auto-proposed from
git history and accept or reject them.
- **deprecate / dismiss** — `repowise decision deprecate <id>` (optionally
@@ -35,5 +40,6 @@ sources and tracks them for staleness and conflicts. This command drives the
- For *querying* why code looks the way it does mid-task, prefer the `get_why`
MCP tool (the `architectural-decisions` skill) — it returns lineage and an
alignment score. This command is for *managing* the decision records themselves.
-- `add` and `confirm` are interactive; tell the user when a step needs their input.
+- `confirm` is interactive, and so is `add` unless you pass `--title` and
+ `--decision`; tell the user when a step needs their input.
- If unsure of an exact subcommand or flag, run `repowise decision --help`.
diff --git a/packages/cli/src/repowise/cli/agent_targets/_data/codex_prompts/repowise-init.md b/packages/cli/src/repowise/cli/agent_targets/_data/codex_prompts/repowise-init.md
index 802758b56..0af30b418 100644
--- a/packages/cli/src/repowise/cli/agent_targets/_data/codex_prompts/repowise-init.md
+++ b/packages/cli/src/repowise/cli/agent_targets/_data/codex_prompts/repowise-init.md
@@ -96,11 +96,22 @@ Git:
--follow-renames Track files across renames (slower but more accurate history)
Editor integration:
- --editor-setup / Register (default) or skip the global MCP server entry
- --no-editor-setup and Claude Code hooks in ~/.claude/settings.json and
- Claude Desktop's config, plus the distill rewrite-hook
- offer. There is one 'repowise' MCP entry per config, so
- a later init from another repo repoints it. See Step 3b.
+ --editor-setup / Wire repowise into your editors (default), or skip it
+ --no-editor-setup entirely. Covers both halves: the machine-wide config
+ (~/.claude/settings.json, Claude Desktop's config, the
+ Claude Code hooks, the distill rewrite-hook offer) and
+ the project-local files (.mcp.json, .claude/CLAUDE.md,
+ .vscode/mcp.json, .vscode/extensions.json). With
+ --no-editor-setup only .repowise/ is touched. There is
+ one 'repowise' MCP entry per machine-wide config, so a
+ later init from another repo repoints it. See Step 3b.
+
+Keys:
+ --save-key / Save the provider key this run authenticated with to
+ --no-save-key .repowise/.env (gitignored, owner-only). Default: on,
+ so the MCP server can answer later without the shell
+ that set it. Use --no-save-key in CI or on a shared
+ machine.
Output:
--no-claude-md Don't generate/update CLAUDE.md
@@ -122,8 +133,10 @@ Then ask if they want you to construct a command or if they'll handle it.
Every path reaches this step. It is about the repo, not the provider.
By default `init` registers repowise as the user's global MCP server, in
-`~/.claude/settings.json` and Claude Desktop's config. There is **one**
-`repowise` key in each file, so this repo replaces whatever repo is registered
+`~/.claude/settings.json` and Claude Desktop's config, and writes four
+project-local files into the repo (`.mcp.json`, `.claude/CLAUDE.md`,
+`.vscode/mcp.json`, `.vscode/extensions.json`). There is **one** `repowise` key
+in each machine-wide config, so this repo replaces whatever repo is registered
now. That is the right default for the repo someone actually works in, and the
wrong one for a checkout that is about to disappear.
@@ -138,9 +151,11 @@ Also add it if the user says they don't want their editor or MCP setup touched.
Do **not** infer that from "just index it" or "don't ask me questions" — those
are about prompts, not config.
-The index, the wiki, and every project-local file are identical either way.
-Only the machine-wide registration is skipped, and it can be done later by
-re-running `repowise init` in that repo without the flag.
+The index and the wiki are identical either way. What the flag skips is both
+the machine-wide registration and the four project-local files, so with it only
+`.repowise/` is touched. (`.repowise/mcp.json` is still written: it is what
+`repowise mcp .` prints, and it is how you opt back in.) Either half can be
+done later by re-running `repowise init` in that repo without the flag.
Whichever you pick, say which in one line so the user can correct you.
@@ -218,10 +233,11 @@ After init completes successfully:
3. Tell the user:
- "Repowise has indexed your codebase. The MCP tools are now active — I can answer questions about your architecture, ownership, dependencies, and more."
**Only if you did not pass `--no-editor-setup`.** With that flag nothing was
- registered, so say instead: "The index is built. I did not register it as
- your global MCP server (this looked like a temporary checkout). The
- repowise plugin's tools still work here; to make this the repo the MCP
- server points at, re-run `repowise init` without `--no-editor-setup`."
+ registered and nothing was written into the repo outside `.repowise/`, so
+ say instead: "The index is built. I did not register it as your global MCP
+ server and wrote no editor files into the repo (this looked like a
+ temporary checkout). The repowise plugin's tools still work here; to wire
+ it up properly, re-run `repowise init` without `--no-editor-setup`."
- "Try asking me something like 'how does the auth module work?' or 'what depends on utils.py?'"
- "Run `/prompts:repowise-status` anytime to check the health of your index."
- "Run `/prompts:repowise-update` after making code changes to keep the wiki in sync."
diff --git a/packages/cli/src/repowise/cli/agent_targets/_data/codex_prompts/repowise-risk.md b/packages/cli/src/repowise/cli/agent_targets/_data/codex_prompts/repowise-risk.md
index 044cac2d0..656fa02a7 100644
--- a/packages/cli/src/repowise/cli/agent_targets/_data/codex_prompts/repowise-risk.md
+++ b/packages/cli/src/repowise/cli/agent_targets/_data/codex_prompts/repowise-risk.md
@@ -4,28 +4,33 @@ description: Score the defect risk of a change — a commit or a base..head rang
# Repowise Risk
-Score a *change* (not a file) for defect risk. Repowise reads the diff shape —
-lines added/deleted, files, directories, subsystems, change entropy, and author
-familiarity — and returns a 0–10 score with an attributable driver breakdown.
-Pure git + learned constants: no LLM, no network. A natural pre-merge / PR gate.
+Score a *change* (not a file) for defect risk. The response leads with
+`fix_history`: the recency-weighted bug-fix record of the files the change
+touches, which of them carry it, and where that sits among the repo's own
+fix-bearing files. The 0–10 score sits beside it and measures diff size and
+spread (named in `score_measures`) rather than danger, so read the fix history
+first. Pure git + learned constants: no LLM, no network. A natural pre-merge /
+PR gate.
## Steps
1. If `.repowise/` doesn't exist: "This repo isn't indexed yet. Run `/prompts:repowise-init` first." Stop.
2. Resolve the target from `$ARGUMENTS`, run `repowise risk`, and present the
- score, level, and top drivers — calling out *why* it's risky (e.g. wide
- diffusion across subsystems, low author familiarity).
+ fix history first (which files keep breaking, and the repo-relative
+ percentile), then the score and its drivers.
## Choosing the revspec
-- No args → `repowise risk` (scores `HEAD`)
+- No args → `repowise risk` (scores uncommitted work, or `HEAD` when the tree is clean)
- A commit SHA → `repowise risk <sha>`
- A range / PR / branch → `repowise risk <base>..<head>` (e.g. `repowise risk main..HEAD`)
Useful flags:
- `--ext .py,.ts` — only count changes in those file types
- `-x, --exclude <pattern>` — gitignore-style pattern to drop from the diff (repeatable; also honors a `.riskignore` file)
-- `--format json` — machine-readable score + features + drivers
+- `--format json` — machine-readable fix history + score + features + drivers
+- `--baseline <n>` — how many recent commits to rank the change against (0 disables)
+- `-t, --target <path>` — score what history says about named files instead of a change (repeatable; reads the index)
- `--path <dir>` — point at a different git repo
## How this differs from the other risk views
diff --git a/packages/cli/src/repowise/cli/agent_targets/_data/codex_prompts/repowise-why.md b/packages/cli/src/repowise/cli/agent_targets/_data/codex_prompts/repowise-why.md
index b79cecc8f..f884c726d 100644
--- a/packages/cli/src/repowise/cli/agent_targets/_data/codex_prompts/repowise-why.md
+++ b/packages/cli/src/repowise/cli/agent_targets/_data/codex_prompts/repowise-why.md
@@ -24,8 +24,10 @@ command **queries** why something is shaped a certain way.
- File path (governing decisions + origin story) → `repowise why src/api/auth.py`
- Target-anchored search → `repowise why "why the retry cap?" --target src/api/client.py`
(`--target` is repeatable)
-- No args → `repowise why` (decision-health dashboard: stale / proposed /
- ungoverned hotspots)
+- `--target` with no question → answers about those files: one target behaves
+ like passing the path, several get a card each
+- No args and no target → `repowise why` (decision-health dashboard: stale /
+ proposed / ungoverned hotspots)
- Machine-readable / raw payload → `--format json` / `--full`
```
@@ -40,8 +42,13 @@ tool-adapter commands.
## Notes
-- Falls back to git archaeology when a path has no decisions, so it is never
- empty — call that out so the user knows it is reconstructed, not recorded.
+- A *path* falls back to git archaeology when it has no decisions, so it is
+ never empty — call that out so the user knows it is reconstructed, not
+ recorded.
+- A *question* the store cannot answer comes back with no decisions, one
+ sentence on why, and a pointer to the tool that fits the question's shape.
+ Relay the redirect rather than filling the gap: an empty result there means
+ the decision store has nothing, not that the question is unanswerable.
- For *managing* ADR records (add / confirm / deprecate), use
`/prompts:repowise-decision`.
- Before contradicting an existing decision, surface it to the user first.
diff --git a/packages/core/src/repowise/core/__init__.py b/packages/core/src/repowise/core/__init__.py
index 1306e417b..a529fc1ba 100644
--- a/packages/core/src/repowise/core/__init__.py
+++ b/packages/core/src/repowise/core/__init__.py
@@ -6,4 +6,4 @@ generation engine. This is the heart of repowise — all other packages depend o
Namespace package: repowise.core is part of the repowise namespace.
"""
-__version__ = "0.42.0"
+__version__ = "0.43.0"
diff --git a/packages/core/src/repowise/core/upgrade/_data/CHANGELOG.md b/packages/core/src/repowise/core/upgrade/_data/CHANGELOG.md
index 0b2456efd..8107290b7 100644
--- a/packages/core/src/repowise/core/upgrade/_data/CHANGELOG.md
+++ b/packages/core/src/repowise/core/upgrade/_data/CHANGELOG.md
@@ -11,31 +11,89 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+---
+
+## [0.43.0] — 2026-08-15
+
+The through-line this cycle is a number meaning what it says. Change risk scored the size of the diff and presented it as danger. `get_answer` could return `confidence: high` beside `retrieval_quality: weak`, with a note that asserted dominance and denied it in the same sentence. `get_why` answered every question, including the ones its store knew nothing about. The dashboard summed dead exports across a side project and a monorepo. Six surfaces each computed hotspot health their own way and none of them agreed. Each of those is fixed by giving the answer one owner and reporting the reason alongside it. `repowise risk` now leads with the bug-fix history of the files a change touches, an answer's confidence note quotes the test that earned it, and a question the decision store cannot answer gets a redirect instead of the three closest records.
+
+The second theme is what a keyless install gets. `get_answer` with embeddings but no LLM key used to return a ranked file list and nothing else, though the evidence around it (live symbol bodies, candidate justifications, rationale comments) needs no provider at all. It builds all of that now, and rates its retrieval instead of only doubting itself. `init` also stopped losing an API key supplied through the environment, which is the path agents and CI take.
+
+Underneath, the graph got a good deal more honest: the edge-type vocabulary is now true and enforced, dependency answers stopped including containment and co-change rows, and "can execution start here" has one owner instead of four.
+
+### Added
+
+- **Object Pascal / Delphi support** (Good tier), taking the language count to 19. Symbols, imports, heritage, and a call graph that handles the parenless calls Pascal is written with. Verified against a 151-file real Delphi codebase. (#1353)
+- **Dead code detects deprecation annotations.** `@Deprecated`, `[Obsolete]`, `@deprecated` and their language siblings now feed a finding's confidence. (#1472)
+- **`repowise decision add` records from flags.** A flag per field, and no prompting at all once `--title` and `--decision` are both present, so a script or an agent with no terminal can record one. `--format json` returns the id to pass back to `confirm` or `show`. Flag-driven records land `proposed` where the prompts record `active`. (#1566)
+- **Record a decision from the web UI.** The decisions page had no way to start a record and an empty state that sent you to a terminal. It now has a form, reachable even on a repo with no decisions yet. (#1567)
+- **`GET /api/repos/summary`** returns every repository's headline figures in one call, replacing the `2N+1` requests the multi-repo dashboard used to make. Flat in the number of repos: six queries at 1 repo, six at 26. (#1577)
+- **`repowise workspace scan --exclude`**, plus a bulk decline, so a scan of a large tree does not have to be answered repo by repo. (#1591)
+
### Changed
-- **Default OpenAI model is now `gpt-5.6-luna`** (was `gpt-5.4-nano`). Same input
- price ($0.20/MTok), cheaper output ($1.20 vs $1.25), so it gets its own pricing
- rows rather than an alias, and nano stays selectable on its own rate. The
- 5.6 family also changed its reasoning ladder: `minimal` is gone and `xhigh` is
- new, so `--reasoning minimal` is now rejected up front for these models instead
- of failing as a 400 on the first live call. Despite what the model docs say,
- the API also rejects `max` for 5.6 (verified live against both `gpt-5.6-luna`
- and `gpt-5.6-sol`), so it is not offered.
+- **`repowise risk` and `get_change_risk` lead with fix history, not the score.** The 0-10 score restates the size of the diff: scoring by lines added alone reproduces it to within 0.16 points, and on 47 within-repo pairs across four repos it ranked the dangerous change above the boring one in none of them. The response now leads with `fix_history`, the recency-weighted bug-fix record of the files the change touches, which files carry it, and where that sits among the repo's own fix-bearing files. Ranking by that alone gets 46 of the same 47 pairs. It comes from one `git log` walk, so it needs no index and no coverage data. The score is kept and reported as what it measures, diff size and spread, named in `score_measures`. Model constants are unchanged. (#1593)
+- **Change-risk numbers say what they are.** `probability` is gone (it was `score / 10` with extra decimals). The absolute band is now `fallback_band` and appears only when there was no baseline to rank against. A new `score_unit` states that the scale is calibrated on individual commits, so a squash-merged PR or a `base..head` range reads high by construction. `nf`/`nd`/`ns` are no longer reported as drivers: their coefficients are collinearity with diff size, so as an explanation they contradicted themselves. (#1583)
+- **Default OpenAI model is now `gpt-5.6-luna`** (was `gpt-5.4-nano`). Same input price ($0.20/MTok), cheaper output ($1.20 vs $1.25), so it gets its own pricing rows rather than an alias, and nano stays selectable on its own rate. The 5.6 family also changed its reasoning ladder: `minimal` is gone and `xhigh` is new, so `--reasoning minimal` is rejected up front for these models instead of failing as a 400 on the first live call. Despite what the model docs say, the API also rejects `max` for 5.6 (verified live against both `gpt-5.6-luna` and `gpt-5.6-sol`), so it is not offered. (#1594)
+- **`get_answer` serves real evidence with no LLM key.** An install with embeddings and no provider got a ranked file list and nothing else, though none of what it lost needs a provider: bodies are read live off disk at the indexed anchors. It now builds `symbol_bodies`, `best_guesses` and `code_rationale`, cites the paths they came from, and names one next action. It also rates the retrieval rather than only reporting `confidence: low`. On 26 paired questions, `symbol_bodies` went from 2/26 to 11/26 keyless. (#1508, #1576)
+- **The per-file symbol budget is spent on the question.** When a retrieved file held more symbols than its budget, hydration kept a prefix sorted by line number, so the bigger the file the stronger the top-of-file bias and the less reachable the symbol you asked about. Symbols are now scored against the question's terms for selection. The kept slice is still served in document order. (#1597)
+- **`get_why` ranks by question vocabulary and refuses when nothing matches.** Search mode answered every question: over twenty questions on an indexed repo, none of the eight unanswerable ones was refused, each costing 11k to 15k characters to answer wrongly. Ranking is now the share of the question's vocabulary a record carries, weighted by term rarity, and a miss returns an empty list with the tool that fits the question's shape. Average response 12,492 characters down to 5,624. The right record now ranks first on all twelve answerable questions, up from none. (#1558)
+- **`get_why` search payloads roughly halved.** Natural-language mode was the only one of the three with no caps at all, at 27k to 35k characters against a 32k transport budget, so two of five probe questions were over the ceiling outright, where the host rejects rather than truncates. One embedding per call instead of two, `affected_files` clamped to a head plus a total, restatements collapsed on cited evidence, and three whole records rather than eight thinned ones. Now 12k to 16k characters, latency down 11% to 29%. (#1555)
+- **`get_why` answers about its `--target` / `targets`.** It chose the health dashboard before looking at the targets, so naming a file and asking nothing returned the repo-wide summary. Targets are read first now: one target is path mode, several get a card each. (#1566)
+- **The multi-repo dashboard puts the repositories back at the centre.** Four metric cards over a repo list becomes a repository list as the subject, ordered by attention rather than last write, each row carrying its health band and a marker only when something needs doing. The aggregates that legitimately add moved to a stat ribbon. `file_count` was counting symbol nodes as files, about 10x too large, and is fixed at the source, so the chat empty state gets it too. (#1577, #1578)
+- **The workspace pages are on the design language.** All four are server-rendered again with filter and selection state in URL params, so a filtered view is linkable. Figures that summed things which do not add were deleted rather than restyled: an averaged coupling heuristic over a truncated list, an "Unmatched" count computed over one page of 200 rows and presented as a workspace total, a breakdown whose sum equalled the total it broke down, and an unweighted average of per-repo coverage percentages. Contract figures now come from the diagnostics endpoint, which knows the denominators, and the table states its bound. (#1582)
+- **The VS Code extension is on the current design language.** Two local `scoreColor` copies called anything at or above 7.5 healthy-green while the canonical bands start at 8, so a file's score printed green beside a map colouring it amber. Both copies are gone. High-contrast themes now get a real high-contrast treatment instead of falling through to the ordinary ramps, and the health, settings, decisions and risk views take the shared components. (#1575)
+- **`--no-editor-setup` means no editor setup.** It gated only machine-wide MCP registration, so there was no combination of flags that indexed a repo without writing `.mcp.json`, `.claude/CLAUDE.md`, `.vscode/mcp.json` and `.vscode/extensions.json` into it. Now one switch means one thing: only `.repowise/` is touched. `init` also ends by naming the files it actually wrote, sourced from the writers rather than a hardcoded list. Note for CI: `REPOWISE_SKIP_EDITOR_SETUP=1` is the same switch, so a harness exporting it to protect a global config will stop getting `.mcp.json`. (#1572)
+- **The init screens are one system.** The banner's wordmark ran a colour ramp whose jitter exceeded its own gradient, so what shipped was orange static in the first thing a user sees. It is one brand colour now. Four panels that are not objects you act on lose their border, the palette is closed to the declared colours, and the completion panel names two commands instead of up to seven. (#1571)
+- **Generation progress splits paid work from free.** One bar counted 4,229 items where about 4,134 were template renders and 95 were model calls, so it reached 97% in minutes and then sat there, indistinguishable from a hang. Each cost tier gets its own total, the free bar finishes and hides, and persistence gets a bar instead of an indeterminate spinner. (#1599, #1607)
+- **Degraded phases are visible on a normal run.** The CLI pins core logging to ERROR unless `--verbose`, so whole phases could fail (the parse pool dying back to one process, a checkpoint not reaching disk) and print nothing. Those now render through the progress channel, including on a non-TTY, and are collected into `state.json` as `degraded`, the way `update` already reports one, with key-shaped text redacted on the way in. (#1599)
+- **The Codex hook stopped waking on every prompt.** It registered `UserPromptSubmit` with no matcher and returned the same static note `SessionStart` had already delivered, so an agentic turn paid one process start per prompt to repeat a block the agent was already holding. The event is retired, and existing installs are migrated rather than left behind, since the merge into `.codex/hooks.json` is additive and reinstalling would have repaired nothing. (#1549)
+- **Hotspot health has one owner, computed live.** Six surfaces answered the question and disagreed. `get_overview` and `repowise status` averaged the top 25% of files by size rather than churn, differing from the persisted KPI on all 42 local indexes with a median gap of 2.67 points of 10. Two dashboard routes read a snapshot that goes stale after `repowise update`, and `get_health` did not return the number at all. `None` now means "this repo has no hotspot files", kept distinct from a low score. (#1552)
+- **The edge-type vocabulary is true and enforced.** The `EdgeType` declaration was decorative: it listed three types nothing emits and omitted four that producers emit constantly (6,750 rows), and thirteen modules each kept a private set written against it. Shared families replace all of them, with an AST guard test over every call site. Cycle detection gains 6,153 edges it never matched, and a file reachable only through a dynamic import could previously be reported dead. (#1516, #1518)
+- **Dependency answers read dependency edges.** `graph_edges` also holds containment (`defines`, `has_method`) and the temporal `co_changes` relation, and several graph reads loaded every row and presented the result as dependencies. 43.7% of the rows the file-dependencies panel read were neither, and 34,570 of this repo's 34,808 symbols listed their own declaring file or class as a caller. Each site now names the view it wants, and degree counts are scoped to whatever is displayed beside them. (#1531)
+- **"Can execution start here" has one owner, decided at ingestion.** Four implementations disagreed, so one file could lead the orientation list and be absent from the curated one. The flag is also what exempts a file from dead-code detection, so a name-only guess was a file nothing could ever report: 1,151 flags are withdrawn across 42 indexes and exactly one file becomes a new dead-code candidate. Entry-point lists on three remaining surfaces now use the shared ranking rather than PageRank, which rewards fan-in and floats a package-root barrel above the real front door. (#1533, #1547, #1556, #1559)
+- **Workspace contracts are read from the parsed index.** Extraction re-derived route tables with regexes after ingestion had already parsed the same files. Python HTTP providers now come from the symbols ingestion produced, so a route cannot be picked up from a comment or lost for having an empty path, and the regex dialects stay reachable for every language with no AST tier. Five extractors that each walked the repo now share one walk: 45.2s down to 14.7-17.9s, 13,889 file reads down to 3,216, contracts and links unchanged. (#1581)
+- **HTTP client wrappers are confirmed from the parse, not from their names.** The JS dialect decided a call was a service call by matching the callee's name against `fetch|request|http|api|ajax|rest|rpc`, which invents contracts for functions merely named that way and misses every wrapper that is not. A symbol is now confirmed by its body issuing a sink call, within a 2-hop budget. Measured on one frontend API layer: 12 contracts to 162. Unresolvable paths are counted and reported, never guessed. (#1585)
+- **A workspace commit re-extracts only the repos that changed.** `changed_repos` was accepted and never read. Reuse is validated rather than trusted (carried forward only when the alias is unchanged, HEAD matches the stamp, the tree is clean and the contract config is unchanged), and every way of disagreeing resolves toward re-extraction. Cross-repo analysis and contract extraction now run concurrently, and each of the five phases logs its duration. (#1596)
+- **Truncated lists carry their true totals** for cycles, co-change pairs and per-edge evidence, after the architecture score turned out to be computed from a capped cycle count, so 500 cycles scored the same as 50. Conformance and breaking-change reports are stamped when they run, so a report that never ran no longer renders as a clean bill of health. Contract extraction reports its coverage from counts it was already recording. (#1591)
+- **Dead-code confidence tiers have one owner.** Eleven more literal `0.7`/`0.4` comparisons and caps now read the shared constants, with a guard test outlawing the shapes that kept recurring. Behaviour-preserving, measured over 42 indexed repositories: 3,930 findings both sides, none moving. Risk factors also render as words rather than API slugs, so a tooltip reads "configuration, runtime-loaded web asset" instead of "config, asset". (#1561, #1574)
+- **`get_answer`'s internals are split into named modules.** `answer.py` had grown to 2,805 lines doing every job in the tool at once. Pure moves: no logic, ordering, threshold or payload change. (#1510, #1584)
### Fixed
-- **`init` now persists an API key supplied through the environment.** Key
- persistence used to hang off the interactive key *prompt*, so
- `repowise init --provider openai --yes` with `OPENAI_API_KEY` already exported
- indexed fine and wrote `provider:` to `config.yaml`, but left no
- `.repowise/.env`, and `repowise mcp` against that repo then answered
- `degraded: "no-llm-provider"` with retrieval-only output. Scripted init is the
- primary path for agents and CI, so a run that succeeds now leaves a repo whose
- MCP server can actually answer. The key that indexed the repo is saved, with a
- one-line notice naming the file; `--no-save-key` (or `REPOWISE_NO_SAVE_KEY=1`)
- opts out, and answering No at the interactive prompt still wins. Covers
- `init`, workspace init and `workspace add`. The `.gitignore` entry is now
- written *before* the key, so a failure cannot leave a committable secret.
+- **Inline decision markers stopped matching ordinary prose.** The keyword matched case-insensitively, so a wrapped sentence beginning "# decision: ..." and a test label reading "# Rejected: nothing to extract" became the only two "decisions" a fresh index of this repository produced, one of them a mid-sentence fragment attached to twenty files. The keyword is now capitalised like `TODO:`. Markers past the fifth in a file were also silently dropped, and a source that failed was indistinguishable from a source that honestly found nothing. Failures are now reported as warnings naming the source and the error. (#1610)
+- **A confidence note is written from the reason the grade was reached.** `get_answer` could return `confidence: high` beside `retrieval_quality: weak`, with a note claiming "clearly dominates (dominance ratio 1.00x)", a ratio of 1.00x being a tie. Dominance had two owners that disagree in a real window. There is one now, so `retrieval_quality: weak` means exactly "not dominant", and each note quotes the test that actually earned the grade. Answer-grounding can no longer earn `high` over a weak retrieval unless you opt in. (#1605)
+- **A stray delimiter no longer hides the rest of a file.** The masking walk behind `withheld_symbols` discarded and re-walked when a template literal was left open at end of file, but triple-quoted runs and block comments got no such treatment. Either one left open masked every line below it, and the note then described a smaller set of withheld symbols than the payload had withheld. A stored symbol end line is also clamped to the live file, so a body served whole can no longer be flagged as cut with a continuation pointing past the last line. (#1580)
+- **`repowise search` and `ask` stopped falling back to keyless embeddings** on a repo indexed with a real key in the same shell, reporting no semantic search against an index full of 1536-wide vectors. The CLI had no key resolver at all and never read `<repo>/.repowise/.env`, the file `init` writes the key to, so the MCP server and the CLI disagreed about the same directory. The degraded message also names where it looked, instead of telling a user to set a variable whose value is already on disk. (#1599)
+- **`init` persists an API key supplied through the environment.** Key persistence hung off the interactive key *prompt*, so `repowise init --provider openai --yes` with `OPENAI_API_KEY` exported indexed fine but left no `.repowise/.env`, and `repowise mcp` against that repo answered `degraded: "no-llm-provider"`. The key that indexed the repo is now saved, with a one-line notice naming the file. `--no-save-key` (or `REPOWISE_NO_SAVE_KEY=1`) opts out, and answering No at the prompt still wins. Covers `init`, workspace init and `workspace add`. `.gitignore` is written *before* the key, so a failure cannot leave a committable secret. (#1595)
+- **The chat window never streams with nothing to show.** A turn that ended without a terminal event left the composer spinning forever with no reason printed. The stream never settled when the reader ended early, an unknown-conversation failure was sent without the `type` field the client switches on, and the send never handed its `AbortSignal` to `fetch`, so a cancelled turn left the POST running and a database session open. (#1586)
+- **The `module_page` prompt stopped tripping its own validator.** It asked the model to ground claims in "the supplied material", which is a literal match for one of the artifact rules, so a page that echoed the instruction's own wording was rejected and thrown away with its tokens already spent. Reworded, with a guard asserting no prompt or template matches any rule, plus one corrective re-ask so a paid-for page is not simply lost. Symbol spotlight pages also bound their importer list: three pages on this repo were about 46.6k characters, of which 45.7k was the list, so the tail fell outside the embedding window and the pages were searchable only by their first few hundred importers. (#1606)
+- **The knowledge graph rebuilds when the builder changes**, not only when the graph does. The fingerprint measured node, edge and community counts, which hold still while the builder changes underneath them, so a store kept serving an artifact built before six edge types were admitted. (#1592)
+- **Truncated agent-facing lists are ranked before they are cut.** Stale decisions, proposals awaiting review and ungoverned hotspots were appended in scan order, so "your ten stale decisions" meant ten arbitrary ones. Six generation lists and the transitive-affected walk behind `get_risk`'s `will_break` had the same shape. (#1590, #1598)
+- **Change-risk correctness.** Uncommitted work is scored when the tree is dirty instead of silently scoring the previous commit. Merge commits are read against their first parent, so `impacted_tests` and `prior_fixes` are no longer empty for a merged PR the same response says touched several files. A failed author lookup reports unknown rather than `0`, which the model priced as risk. The 200-commit baseline walk is now cached whole rather than per scored commit, and self-exclusion works for the default `HEAD` target, which had been ranking against itself. (#1583, #1589)
+- **Cached pickles under `.repowise/` are HMAC-sealed before unpickling**, so a crafted cache file committed into a repository cannot execute code during `init` or `update` (CWE-502). (#1439)
+- **`REPOWISE_EMBEDDING_TIMEOUT` is honoured by every embedder.** Only the Ollama one read it. openai, gemini and openrouter hardcoded 10s, and an expired batch is not retried: it is reported once as "N/N items failed to embed" while the run exits 0. A malformed value now warns and falls back instead of silently downgrading the run to a keyless 8-wide store. (#1475)
+- **`kimi-for-coding` models are sent `temperature=1`**, the only value that endpoint accepts. Every request through the kimi provider failed validation, which surfaced in `repowise generate` as every page silently falling back to a structural stub. (#1323)
+- **A failed schema-reconcile statement stops being permanent.** The walk aborted on the first raise, so every table ordered after the victim was never reached, on that call or any later one, and 13 read paths swallow the error, so a half-migrated store was reached silently. It continues past a failure now and re-raises once the walk is done. (#1509)
+- **`repowise update`'s up-to-date self-heal runs under the single-flight lock** (#1528), and the lock never reports `acquired` with no lock file on disk (#1524). The sync baseline is preserved when HEAD is unavailable (#1521).
+- **`repowise dead-code --format json` emits valid JSON.** The banner and two notices went to stdout ahead of the payload. (#1441)
+- **C# generic type arguments resolve** (#1550), and literal dynamic-import namespace use is tracked (#1548).
+- **Chat tooling matches the real surface.** The `get_context` include schema listed blocks that do not exist and omitted two that do (#1477), and `get_why` results render in chat artifacts instead of coming back blank (#1478).
+- **Dismiss dismisses.** The button sent `deprecated`, which is re-derived on every re-extraction, so dismissing a wrong proposal did not stick, which is the one thing the button exists to prevent. The shared status union gained `dismissed`, and the table gained the filter without which a dismissal is a one-way door. (#1567)
+- **Docker standalone output path** corrected for the monorepo layout. (#1562)
+- **`python -m repowise.cli.main` runs** instead of exiting 0 with no output. (#1591)
+
+### Documentation
+
+- `docs/layers/CHANGE_RISK.md` rewritten around fix history, including what the keyword-based fix classifier misses and why the ranking set is a falsification test rather than an accuracy estimate. (#1593)
+- Dead-code docs corrected against the code: the git-age ladder has six rungs and was documented as three, `safe_to_delete` omitted its runtime-load condition, the risk-factor token list read as complete while being partial, and `ARCHITECTURE.md` promised a whitelist file no code reads. (#1559, #1574)
+- Workspace docs drop a pom.xml scanning claim and an OpenAPI field-level breaking-change claim, neither of which is implemented, and document the socket extractor. (#1591)
+- Object Pascal added to `docs/layers/LANGUAGE_SUPPORT.md` with its known gaps. (#1353)
+- A dead-code CLI walkthrough, corrected hook event lists, and the editor-files architecture doc brought back in line with the current queries. (#1549, #1556)
+
+### Dependencies
+
+- Adds `tree-sitter-pascal` for Object Pascal support. (#1353)
---
diff --git a/packages/server/src/repowise/server/__init__.py b/packages/server/src/repowise/server/__init__.py
index e042830fa..acdf77ed4 100644
--- a/packages/server/src/repowise/server/__init__.py
+++ b/packages/server/src/repowise/server/__init__.py
@@ -7,4 +7,4 @@ Provides:
- Background job scheduler (APScheduler)
"""
-__version__ = "0.42.0"
+__version__ = "0.43.0"
diff --git a/plugins/claude-code/.claude-plugin/plugin.json b/plugins/claude-code/.claude-plugin/plugin.json
index 599b3204b..96b4f94f9 100644
--- a/plugins/claude-code/.claude-plugin/plugin.json
+++ b/plugins/claude-code/.claude-plugin/plugin.json
@@ -1,7 +1,7 @@
{
"name": "repowise",
"description": "Codebase intelligence for Claude Code. Indexes your codebase into five layers (Graph, Git, Docs, Decisions, Code Health) and exposes them through eleven task-shaped MCP tools — so Claude understands architecture, ownership, hotspots, why code is built the way it is, and where the defect risk lives.",
- "version": "0.42.0",
+ "version": "0.43.0",
"author": {
"name": "Repowise",
"email": "[email protected]",
diff --git a/plugins/claude-code/CHANGELOG.md b/plugins/claude-code/CHANGELOG.md
index 89b95483f..91df0fad9 100644
--- a/plugins/claude-code/CHANGELOG.md
+++ b/plugins/claude-code/CHANGELOG.md
@@ -2,6 +2,27 @@
All notable changes to the Repowise Claude Code plugin are documented here.
+## 0.43.0
+
+### Changed
+- `/repowise:risk` documents what the command now leads with: the bug-fix
+ history of the files a change touches, with the 0-10 score reported beside it
+ as a measure of diff size and spread rather than a verdict on danger. Also
+ records that omitting the revspec scores uncommitted work when the tree is
+ dirty, and adds `--baseline` and `-t/--target` (#1583, #1593).
+- `/repowise:init` describes `--no-editor-setup` as what it now does: it skips
+ the four project-local files (`.mcp.json`, `.claude/CLAUDE.md`,
+ `.vscode/mcp.json`, `.vscode/extensions.json`) as well as the machine-wide
+ registration, so only `.repowise/` is touched. Adds `--save-key` /
+ `--no-save-key` (#1572, #1595).
+- `/repowise:decision` documents the flag-driven form of `decision add`, which
+ records without prompting once `--title` and `--decision` are both present and
+ is the form to use with no terminal (#1566).
+- `/repowise:why` documents that `--target` with no question now answers about
+ those files instead of falling through to the health dashboard, and that a
+ question the store cannot answer returns a redirect rather than the closest
+ records (#1558, #1566).
+
## 0.42.0
### Changed
diff --git a/plugins/claude-code/commands/decision.md b/plugins/claude-code/commands/decision.md
index 9e819ca05..908bb6c07 100644
--- a/plugins/claude-code/commands/decision.md
+++ b/plugins/claude-code/commands/decision.md
@@ -25,7 +25,12 @@ sources and tracks them for staleness and conflicts. This command drives the
- **show** — `repowise decision show <id>` — full record: rationale, evidence
spans, status, and the supersession lineage.
- **add** — `repowise decision add` — guided interactive capture (~90s). Use when
- the user makes a decision during the session and wants it recorded.
+ the user makes a decision during the session and wants it recorded. With both
+ `--title` and `--decision` it records without prompting and prints the id
+ (`--format json` to parse it back), which is the form to use with no terminal.
+ The rest are optional: `--context`, `--rationale`, `--alternative`,
+ `--consequence`, `--affects`, `--tag`, the last four repeatable. A flag-driven
+ record lands `proposed` for a person to `confirm`.
- **confirm** — `repowise decision confirm` — review decisions auto-proposed from
git history and accept or reject them.
- **deprecate / dismiss** — `repowise decision deprecate <id>` (optionally
@@ -36,5 +41,6 @@ sources and tracks them for staleness and conflicts. This command drives the
- For *querying* why code looks the way it does mid-task, prefer the `get_why`
MCP tool (the `architectural-decisions` skill) — it returns lineage and an
alignment score. This command is for *managing* the decision records themselves.
-- `add` and `confirm` are interactive; tell the user when a step needs their input.
+- `confirm` is interactive, and so is `add` unless you pass `--title` and
+ `--decision`; tell the user when a step needs their input.
- If unsure of an exact subcommand or flag, run `repowise decision --help`.
diff --git a/plugins/claude-code/commands/init.md b/plugins/claude-code/commands/init.md
index a5a770df3..3c0c339c6 100644
--- a/plugins/claude-code/commands/init.md
+++ b/plugins/claude-code/commands/init.md
@@ -97,11 +97,22 @@ Git:
--follow-renames Track files across renames (slower but more accurate history)
Editor integration:
- --editor-setup / Register (default) or skip the global MCP server entry
- --no-editor-setup and Claude Code hooks in ~/.claude/settings.json and
- Claude Desktop's config, plus the distill rewrite-hook
- offer. There is one 'repowise' MCP entry per config, so
- a later init from another repo repoints it. See Step 3b.
+ --editor-setup / Wire repowise into your editors (default), or skip it
+ --no-editor-setup entirely. Covers both halves: the machine-wide config
+ (~/.claude/settings.json, Claude Desktop's config, the
+ Claude Code hooks, the distill rewrite-hook offer) and
+ the project-local files (.mcp.json, .claude/CLAUDE.md,
+ .vscode/mcp.json, .vscode/extensions.json). With
+ --no-editor-setup only .repowise/ is touched. There is
+ one 'repowise' MCP entry per machine-wide config, so a
+ later init from another repo repoints it. See Step 3b.
+
+Keys:
+ --save-key / Save the provider key this run authenticated with to
+ --no-save-key .repowise/.env (gitignored, owner-only). Default: on,
+ so the MCP server can answer later without the shell
+ that set it. Use --no-save-key in CI or on a shared
+ machine.
Output:
--no-claude-md Don't generate/update CLAUDE.md
@@ -123,8 +134,10 @@ Then ask if they want you to construct a command or if they'll handle it.
Every path reaches this step. It is about the repo, not the provider.
By default `init` registers repowise as the user's global MCP server, in
-`~/.claude/settings.json` and Claude Desktop's config. There is **one**
-`repowise` key in each file, so this repo replaces whatever repo is registered
+`~/.claude/settings.json` and Claude Desktop's config, and writes four
+project-local files into the repo (`.mcp.json`, `.claude/CLAUDE.md`,
+`.vscode/mcp.json`, `.vscode/extensions.json`). There is **one** `repowise` key
+in each machine-wide config, so this repo replaces whatever repo is registered
now. That is the right default for the repo someone actually works in, and the
wrong one for a checkout that is about to disappear.
@@ -139,9 +152,11 @@ Also add it if the user says they don't want their editor or MCP setup touched.
Do **not** infer that from "just index it" or "don't ask me questions" — those
are about prompts, not config.
-The index, the wiki, and every project-local file are identical either way.
-Only the machine-wide registration is skipped, and it can be done later by
-re-running `repowise init` in that repo without the flag.
+The index and the wiki are identical either way. What the flag skips is both
+the machine-wide registration and the four project-local files, so with it only
+`.repowise/` is touched. (`.repowise/mcp.json` is still written: it is what
+`repowise mcp .` prints, and it is how you opt back in.) Either half can be
+done later by re-running `repowise init` in that repo without the flag.
Whichever you pick, say which in one line so the user can correct you.
@@ -219,10 +234,11 @@ After init completes successfully:
3. Tell the user:
- "Repowise has indexed your codebase. The MCP tools are now active — I can answer questions about your architecture, ownership, dependencies, and more."
**Only if you did not pass `--no-editor-setup`.** With that flag nothing was
- registered, so say instead: "The index is built. I did not register it as
- your global MCP server (this looked like a temporary checkout). The
- repowise plugin's tools still work here; to make this the repo the MCP
- server points at, re-run `repowise init` without `--no-editor-setup`."
+ registered and nothing was written into the repo outside `.repowise/`, so
+ say instead: "The index is built. I did not register it as your global MCP
+ server and wrote no editor files into the repo (this looked like a
+ temporary checkout). The repowise plugin's tools still work here; to wire
+ it up properly, re-run `repowise init` without `--no-editor-setup`."
- "Try asking me something like 'how does the auth module work?' or 'what depends on utils.py?'"
- "Run `/repowise:status` anytime to check the health of your index."
- "Run `/repowise:update` after making code changes to keep the wiki in sync."
diff --git a/plugins/claude-code/commands/risk.md b/plugins/claude-code/commands/risk.md
index 9bd712090..33e3ff1a9 100644
--- a/plugins/claude-code/commands/risk.md
+++ b/plugins/claude-code/commands/risk.md
@@ -5,28 +5,33 @@ allowed-tools: Bash, Read
# Repowise Risk
-Score a *change* (not a file) for defect risk. Repowise reads the diff shape —
-lines added/deleted, files, directories, subsystems, change entropy, and author
-familiarity — and returns a 0–10 score with an attributable driver breakdown.
-Pure git + learned constants: no LLM, no network. A natural pre-merge / PR gate.
+Score a *change* (not a file) for defect risk. The response leads with
+`fix_history`: the recency-weighted bug-fix record of the files the change
+touches, which of them carry it, and where that sits among the repo's own
+fix-bearing files. The 0–10 score sits beside it and measures diff size and
+spread (named in `score_measures`) rather than danger, so read the fix history
+first. Pure git + learned constants: no LLM, no network. A natural pre-merge /
+PR gate.
## Steps
1. If `.repowise/` doesn't exist: "This repo isn't indexed yet. Run `/repowise:init` first." Stop.
2. Resolve the target from `$ARGUMENTS`, run `repowise risk`, and present the
- score, level, and top drivers — calling out *why* it's risky (e.g. wide
- diffusion across subsystems, low author familiarity).
+ fix history first (which files keep breaking, and the repo-relative
+ percentile), then the score and its drivers.
## Choosing the revspec
-- No args → `repowise risk` (scores `HEAD`)
+- No args → `repowise risk` (scores uncommitted work, or `HEAD` when the tree is clean)
- A commit SHA → `repowise risk <sha>`
- A range / PR / branch → `repowise risk <base>..<head>` (e.g. `repowise risk main..HEAD`)
Useful flags:
- `--ext .py,.ts` — only count changes in those file types
- `-x, --exclude <pattern>` — gitignore-style pattern to drop from the diff (repeatable; also honors a `.riskignore` file)
-- `--format json` — machine-readable score + features + drivers
+- `--format json` — machine-readable fix history + score + features + drivers
+- `--baseline <n>` — how many recent commits to rank the change against (0 disables)
+- `-t, --target <path>` — score what history says about named files instead of a change (repeatable; reads the index)
- `--path <dir>` — point at a different git repo
## How this differs from the other risk views
diff --git a/plugins/claude-code/commands/why.md b/plugins/claude-code/commands/why.md
index 36de0b5cb..7415ef430 100644
--- a/plugins/claude-code/commands/why.md
+++ b/plugins/claude-code/commands/why.md
@@ -25,8 +25,10 @@ command **queries** why something is shaped a certain way.
- File path (governing decisions + origin story) → `repowise why src/api/auth.py`
- Target-anchored search → `repowise why "why the retry cap?" --target src/api/client.py`
(`--target` is repeatable)
-- No args → `repowise why` (decision-health dashboard: stale / proposed /
- ungoverned hotspots)
+- `--target` with no question → answers about those files: one target behaves
+ like passing the path, several get a card each
+- No args and no target → `repowise why` (decision-health dashboard: stale /
+ proposed / ungoverned hotspots)
- Machine-readable / raw payload → `--format json` / `--full`
```
@@ -41,8 +43,13 @@ tool-adapter commands.
## Notes
-- Falls back to git archaeology when a path has no decisions, so it is never
- empty — call that out so the user knows it is reconstructed, not recorded.
+- A *path* falls back to git archaeology when it has no decisions, so it is
+ never empty — call that out so the user knows it is reconstructed, not
+ recorded.
+- A *question* the store cannot answer comes back with no decisions, one
+ sentence on why, and a pointer to the tool that fits the question's shape.
+ Relay the redirect rather than filling the gap: an empty result there means
+ the decision store has nothing, not that the question is unanswerable.
- For *managing* ADR records (add / confirm / deprecate), use
`/repowise:decision`.
- Before contradicting an existing decision, surface it to the user first.
diff --git a/plugins/codex/.codex-plugin/plugin.json b/plugins/codex/.codex-plugin/plugin.json
index 37cff3ca5..3939b216f 100644
--- a/plugins/codex/.codex-plugin/plugin.json
+++ b/plugins/codex/.codex-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "codex",
- "version": "0.5.0",
+ "version": "0.6.0",
"description": "Repowise codebase intelligence for Codex.",
"author": {
"name": "Repowise",
diff --git a/plugins/shared/commands/decision.md b/plugins/shared/commands/decision.md
index c5083fbde..f567915e5 100644
--- a/plugins/shared/commands/decision.md
+++ b/plugins/shared/commands/decision.md
@@ -26,7 +26,12 @@ sources and tracks them for staleness and conflicts. This command drives the
- **show** — `repowise decision show <id>` — full record: rationale, evidence
spans, status, and the supersession lineage.
- **add** — `repowise decision add` — guided interactive capture (~90s). Use when
- the user makes a decision during the session and wants it recorded.
+ the user makes a decision during the session and wants it recorded. With both
+ `--title` and `--decision` it records without prompting and prints the id
+ (`--format json` to parse it back), which is the form to use with no terminal.
+ The rest are optional: `--context`, `--rationale`, `--alternative`,
+ `--consequence`, `--affects`, `--tag`, the last four repeatable. A flag-driven
+ record lands `proposed` for a person to `confirm`.
- **confirm** — `repowise decision confirm` — review decisions auto-proposed from
git history and accept or reject them.
- **deprecate / dismiss** — `repowise decision deprecate <id>` (optionally
@@ -37,5 +42,6 @@ sources and tracks them for staleness and conflicts. This command drives the
- For *querying* why code looks the way it does mid-task, prefer the `get_why`
MCP tool (the `architectural-decisions` skill) — it returns lineage and an
alignment score. This command is for *managing* the decision records themselves.
-- `add` and `confirm` are interactive; tell the user when a step needs their input.
+- `confirm` is interactive, and so is `add` unless you pass `--title` and
+ `--decision`; tell the user when a step needs their input.
- If unsure of an exact subcommand or flag, run `repowise decision --help`.
diff --git a/plugins/shared/commands/init.md b/plugins/shared/commands/init.md
index ddde87a49..ddb074188 100644
--- a/plugins/shared/commands/init.md
+++ b/plugins/shared/commands/init.md
@@ -98,11 +98,22 @@ Git:
--follow-renames Track files across renames (slower but more accurate history)
Editor integration:
- --editor-setup / Register (default) or skip the global MCP server entry
- --no-editor-setup and Claude Code hooks in ~/.claude/settings.json and
- Claude Desktop's config, plus the distill rewrite-hook
- offer. There is one 'repowise' MCP entry per config, so
- a later init from another repo repoints it. See Step 3b.
+ --editor-setup / Wire repowise into your editors (default), or skip it
+ --no-editor-setup entirely. Covers both halves: the machine-wide config
+ (~/.claude/settings.json, Claude Desktop's config, the
+ Claude Code hooks, the distill rewrite-hook offer) and
+ the project-local files (.mcp.json, .claude/CLAUDE.md,
+ .vscode/mcp.json, .vscode/extensions.json). With
+ --no-editor-setup only .repowise/ is touched. There is
+ one 'repowise' MCP entry per machine-wide config, so a
+ later init from another repo repoints it. See Step 3b.
+
+Keys:
+ --save-key / Save the provider key this run authenticated with to
+ --no-save-key .repowise/.env (gitignored, owner-only). Default: on,
+ so the MCP server can answer later without the shell
+ that set it. Use --no-save-key in CI or on a shared
+ machine.
Output:
--no-claude-md Don't generate/update CLAUDE.md
@@ -124,8 +135,10 @@ Then ask if they want you to construct a command or if they'll handle it.
Every path reaches this step. It is about the repo, not the provider.
By default `init` registers repowise as the user's global MCP server, in
-`~/.claude/settings.json` and Claude Desktop's config. There is **one**
-`repowise` key in each file, so this repo replaces whatever repo is registered
+`~/.claude/settings.json` and Claude Desktop's config, and writes four
+project-local files into the repo (`.mcp.json`, `.claude/CLAUDE.md`,
+`.vscode/mcp.json`, `.vscode/extensions.json`). There is **one** `repowise` key
+in each machine-wide config, so this repo replaces whatever repo is registered
now. That is the right default for the repo someone actually works in, and the
wrong one for a checkout that is about to disappear.
@@ -140,9 +153,11 @@ Also add it if the user says they don't want their editor or MCP setup touched.
Do **not** infer that from "just index it" or "don't ask me questions" — those
are about prompts, not config.
-The index, the wiki, and every project-local file are identical either way.
-Only the machine-wide registration is skipped, and it can be done later by
-re-running `repowise init` in that repo without the flag.
+The index and the wiki are identical either way. What the flag skips is both
+the machine-wide registration and the four project-local files, so with it only
+`.repowise/` is touched. (`.repowise/mcp.json` is still written: it is what
+`repowise mcp .` prints, and it is how you opt back in.) Either half can be
+done later by re-running `repowise init` in that repo without the flag.
Whichever you pick, say which in one line so the user can correct you.
@@ -220,10 +235,11 @@ After init completes successfully:
3. Tell the user:
- "Repowise has indexed your codebase. The MCP tools are now active — I can answer questions about your architecture, ownership, dependencies, and more."
**Only if you did not pass `--no-editor-setup`.** With that flag nothing was
- registered, so say instead: "The index is built. I did not register it as
- your global MCP server (this looked like a temporary checkout). The
- repowise plugin's tools still work here; to make this the repo the MCP
- server points at, re-run `repowise init` without `--no-editor-setup`."
+ registered and nothing was written into the repo outside `.repowise/`, so
+ say instead: "The index is built. I did not register it as your global MCP
+ server and wrote no editor files into the repo (this looked like a
+ temporary checkout). The repowise plugin's tools still work here; to wire
+ it up properly, re-run `repowise init` without `--no-editor-setup`."
- "Try asking me something like 'how does the auth module work?' or 'what depends on utils.py?'"
- "Run `{{cmd:status}}` anytime to check the health of your index."
- "Run `{{cmd:update}}` after making code changes to keep the wiki in sync."
diff --git a/plugins/shared/commands/risk.md b/plugins/shared/commands/risk.md
index b3474d97f..0a81d6c8e 100644
--- a/plugins/shared/commands/risk.md
+++ b/plugins/shared/commands/risk.md
@@ -6,28 +6,33 @@ frontmatter: |
# Repowise Risk
-Score a *change* (not a file) for defect risk. Repowise reads the diff shape —
-lines added/deleted, files, directories, subsystems, change entropy, and author
-familiarity — and returns a 0–10 score with an attributable driver breakdown.
-Pure git + learned constants: no LLM, no network. A natural pre-merge / PR gate.
+Score a *change* (not a file) for defect risk. The response leads with
+`fix_history`: the recency-weighted bug-fix record of the files the change
+touches, which of them carry it, and where that sits among the repo's own
+fix-bearing files. The 0–10 score sits beside it and measures diff size and
+spread (named in `score_measures`) rather than danger, so read the fix history
+first. Pure git + learned constants: no LLM, no network. A natural pre-merge /
+PR gate.
## Steps
1. If `.repowise/` doesn't exist: "This repo isn't indexed yet. Run `{{cmd:init}}` first." Stop.
2. Resolve the target from `$ARGUMENTS`, run `repowise risk`, and present the
- score, level, and top drivers — calling out *why* it's risky (e.g. wide
- diffusion across subsystems, low author familiarity).
+ fix history first (which files keep breaking, and the repo-relative
+ percentile), then the score and its drivers.
## Choosing the revspec
-- No args → `repowise risk` (scores `HEAD`)
+- No args → `repowise risk` (scores uncommitted work, or `HEAD` when the tree is clean)
- A commit SHA → `repowise risk <sha>`
- A range / PR / branch → `repowise risk <base>..<head>` (e.g. `repowise risk main..HEAD`)
Useful flags:
- `--ext .py,.ts` — only count changes in those file types
- `-x, --exclude <pattern>` — gitignore-style pattern to drop from the diff (repeatable; also honors a `.riskignore` file)
-- `--format json` — machine-readable score + features + drivers
+- `--format json` — machine-readable fix history + score + features + drivers
+- `--baseline <n>` — how many recent commits to rank the change against (0 disables)
+- `-t, --target <path>` — score what history says about named files instead of a change (repeatable; reads the index)
- `--path <dir>` — point at a different git repo
## How this differs from the other risk views
diff --git a/plugins/shared/commands/why.md b/plugins/shared/commands/why.md
index 10ed7b9d6..d7cf26588 100644
--- a/plugins/shared/commands/why.md
+++ b/plugins/shared/commands/why.md
@@ -26,8 +26,10 @@ command **queries** why something is shaped a certain way.
- File path (governing decisions + origin story) → `repowise why src/api/auth.py`
- Target-anchored search → `repowise why "why the retry cap?" --target src/api/client.py`
(`--target` is repeatable)
-- No args → `repowise why` (decision-health dashboard: stale / proposed /
- ungoverned hotspots)
+- `--target` with no question → answers about those files: one target behaves
+ like passing the path, several get a card each
+- No args and no target → `repowise why` (decision-health dashboard: stale /
+ proposed / ungoverned hotspots)
- Machine-readable / raw payload → `--format json` / `--full`
```
@@ -42,8 +44,13 @@ tool-adapter commands.
## Notes
-- Falls back to git archaeology when a path has no decisions, so it is never
- empty — call that out so the user knows it is reconstructed, not recorded.
+- A *path* falls back to git archaeology when it has no decisions, so it is
+ never empty — call that out so the user knows it is reconstructed, not
+ recorded.
+- A *question* the store cannot answer comes back with no decisions, one
+ sentence on why, and a pointer to the tool that fits the question's shape.
+ Relay the redirect rather than filling the gap: an empty result there means
+ the decision store has nothing, not that the question is unanswerable.
- For *managing* ADR records (add / confirm / deprecate), use
`{{cmd:decision}}`.
- Before contradicting an existing decision, surface it to the user first.
diff --git a/pyproject.toml b/pyproject.toml
index 395f81853..10693eb0c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "repowise"
-version = "0.42.0"
+version = "0.43.0"
description = "The codebase intelligence layer for your AI coding agent — dependency graph, git history, dead code, decisions, and code health, exposed over MCP"
readme = "README.md"
requires-python = ">=3.11"
diff --git a/server.json b/server.json
index 297c7476d..e09d53b40 100644
--- a/server.json
+++ b/server.json
@@ -8,12 +8,12 @@
"source": "github"
},
"websiteUrl": "https://www.repowise.dev",
- "version": "0.42.0",
+ "version": "0.43.0",
"packages": [
{
"registryType": "pypi",
"identifier": "repowise",
- "version": "0.42.0",
+ "version": "0.43.0",
"transport": {
"type": "stdio"
},
diff --git a/uv.lock b/uv.lock
index 6eea466a4..4cffb2ab3 100644
--- a/uv.lock
+++ b/uv.lock
@@ -3051,7 +3051,7 @@ wheels = [
[[package]]
name = "repowise"
-version = "0.42.0"
+version = "0.43.0"
source = { editable = "." }
dependencies = [
{ name = "aiosqlite" },
@@ -3090,6 +3090,7 @@ dependencies = [
{ name = "tree-sitter-javascript" },
{ name = "tree-sitter-kotlin" },
{ name = "tree-sitter-luau" },
+ { name = "tree-sitter-pascal" },
{ name = "tree-sitter-php" },
{ name = "tree-sitter-python" },
{ name = "tree-sitter-ruby" },
@@ -3184,6 +3185,7 @@ requires-dist = [
{ name = "tree-sitter-javascript", specifier = ">=0.23,<1" },
{ name = "tree-sitter-kotlin", specifier = ">=1,<2" },
{ name = "tree-sitter-luau", specifier = ">=1.2,<2" },
+ { name = "tree-sitter-pascal", specifier = ">=0.11,<1" },
{ name = "tree-sitter-php", specifier = ">=0.23,<1" },
{ name = "tree-sitter-python", specifier = ">=0.23,<1" },
{ name = "tree-sitter-ruby", specifier = ">=0.23,<1" },
@@ -4123,6 +4125,26 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/1a/df/db574405f592f1f4f039dc83db8545d634b68481ce0c457bbab26e155a4a/tree_sitter_luau-1.2.0-cp39-abi3-win_arm64.whl", hash = "sha256:37e9a2e2dd9795800c98c160eabcfed9a90a25a80e2f207658902b0444a40440", size = 31300, upload-time = "2024-12-22T22:42:45.64Z" },
]
+[[package]]
+name = "tree-sitter-pascal"
+version = "0.11.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/89/89/cb9ce7f7e9a119a3d518020c387fb994f8f6cac07a3f796fbb3409b506fb/tree_sitter_pascal-0.11.0.tar.gz", hash = "sha256:7d4da59b8c0b2ff9a32181562eed25c8ba13a6c8bbca2cb895e10f5344708dba", size = 293593, upload-time = "2026-07-01T03:53:16.47Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/9a/74/621a4d1690e224de4ae00fb90304469bd96c1ae25bd7a8eabb95f9809b90/tree_sitter_pascal-0.11.0-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:7a8c2bb6ab958cea7390e18ed28f4535ca24ba110eae0449d5a77c294844d45a", size = 238019, upload-time = "2026-07-01T03:53:01.704Z" },
+ { url = "https://files.pythonhosted.org/packages/1e/36/8660f400b1c42714f345fc0afae295be2fafec51531d199b7c6e2387881e/tree_sitter_pascal-0.11.0-cp38-abi3-macosx_10_9_x86_64.whl", hash = "sha256:bccb2d757c17820cdcfaa760bac1df4caa6278e1e2334d6956e0f9c31c6e8f4a", size = 125475, upload-time = "2026-07-01T03:53:03.182Z" },
+ { url = "https://files.pythonhosted.org/packages/7e/1e/06f87ce971119b6a6c1682a0647cad9774463ae9c68faa8c016d8c10d30f/tree_sitter_pascal-0.11.0-cp38-abi3-macosx_11_0_arm64.whl", hash = "sha256:ed50bb16a8469a54ae365f51dac046a3247e2efbab203269a8d737fa816b11a6", size = 132345, upload-time = "2026-07-01T03:53:04.643Z" },
+ { url = "https://files.pythonhosted.org/packages/00/b6/e37df67cc704f9c19531c858835396366d39790e71114fa181929b0dba00/tree_sitter_pascal-0.11.0-cp38-abi3-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:3ec2ca83d1e01a1eaf7711d6392947058c64302562f987be5c0bcf7e185d0dbd", size = 157887, upload-time = "2026-07-01T03:53:05.849Z" },
+ { url = "https://files.pythonhosted.org/packages/aa/81/9e21b0199e86078ca4763ab4bc68fa6e1a3e625e168dee9fdcf27455d09f/tree_sitter_pascal-0.11.0-cp38-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:ab7557a05400f2841b18d000997453dadff09c2830bd48313cf4264bab018bbe", size = 153629, upload-time = "2026-07-01T03:53:06.99Z" },
+ { url = "https://files.pythonhosted.org/packages/20/34/947ae7c72eac8363e3de08f2a1e2f992beeb6afb27daca939443438e4614/tree_sitter_pascal-0.11.0-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:543717086ae596aa1895c6151230e45f78ed20a69b9c1ab83a5d5950db068381", size = 153629, upload-time = "2026-07-01T03:53:08.138Z" },
+ { url = "https://files.pythonhosted.org/packages/14/05/6b103890fdb63c57fb89650ece51333852e0ee8a4a3ef0966168acebfad4/tree_sitter_pascal-0.11.0-cp38-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:e317158e32c6e19ab75fe8664b48c48d71e757f6e2f8de0996eba63583d4ea55", size = 152709, upload-time = "2026-07-01T03:53:09.386Z" },
+ { url = "https://files.pythonhosted.org/packages/46/6e/ef2c893744b4d53f53113f7ca5bf3016afed6ced3db82ae7d3a42a2faf72/tree_sitter_pascal-0.11.0-cp38-abi3-musllinux_1_2_i686.whl", hash = "sha256:ab2e43d9a4d30ee482322a41f7f12ca2f40b4f0ee1771646329fe57a6a6a29ba", size = 157179, upload-time = "2026-07-01T03:53:10.501Z" },
+ { url = "https://files.pythonhosted.org/packages/0f/bf/5b64986483183667c086c6612185a03f3de2408f81b6bac49b60fa45c187/tree_sitter_pascal-0.11.0-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:b545e3b7a20fc7f7ce346e0fc598120a90b980adf050357946b7b00d2a81f875", size = 152117, upload-time = "2026-07-01T03:53:11.842Z" },
+ { url = "https://files.pythonhosted.org/packages/18/80/3553a1c89441a8f78daedd6182580db4df234b6b4ddd0e9d18ac9a2f7385/tree_sitter_pascal-0.11.0-cp38-abi3-win32.whl", hash = "sha256:c898d8c2771c5da47dbab20aea1d99e3aca8878a90e24db0a5558619ac8ad5c5", size = 124205, upload-time = "2026-07-01T03:53:12.969Z" },
+ { url = "https://files.pythonhosted.org/packages/19/96/695db7513510ea4fedb5e4e9b47011bf309253715c5eb9892c71486312e6/tree_sitter_pascal-0.11.0-cp38-abi3-win_amd64.whl", hash = "sha256:99346d54c928d42c820c0aa262f6acbf4fb2856d69016f1df11f834f681b45e0", size = 124349, upload-time = "2026-07-01T03:53:14.082Z" },
+ { url = "https://files.pythonhosted.org/packages/45/ad/e5381365ed5b247cad2e047682b081ccbb79f84bb5c1b48642ef3385f1d3/tree_sitter_pascal-0.11.0-cp38-abi3-win_arm64.whl", hash = "sha256:9d22b974a47765f1c98629338d82d1df89c35c270a73f08dda8fbd49538e32d4", size = 124914, upload-time = "2026-07-01T03:53:15.191Z" },
+]
+
[[package]]
name = "tree-sitter-php"
version = "0.24.1"