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.40.0 (#1396)

Raghav Chamadiya9e5c7e994d60
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json
index 9b2070a16..b93933ac2 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.39.0",
+ "version": "0.40.0",
"category": "productivity",
"keywords": [
"codebase",
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index f8d0039e5..f2a1924d2 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -9,6 +9,91 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
---
+## [0.40.0] — 2026-08-10
+
+The big one this cycle is a new kind of record. Repowise already told you what the code is and what history says about it; it had no way to say what has happened to a repository: that this directory is a separate checkout, that a console script is shadowed, that this bug was fixed in this commit and nothing in its scope has moved since. Episodes are those records: dated, bound to the files they touch, derived from the walk and the git pass that already run, and checkable against git rather than decayed by a curve. They are read by `get_answer`, `get_why`, `get_risk` and `get_context`, and served over HTTP for the dashboard.
+
+Alongside it: a keyless index stops ranking on vectors that carry no signal, which was roughly 40% of every search window; the health dashboard ranks by how much a file actually lost rather than by a score that clamps; `repowise watch` indexes the working tree, so it finally updates anything it watches; an incremental `update` prunes deleted files and can no longer strand the commits a failed step skipped; and the update path got about ten seconds faster on a large checkout.
+
+Two authentication and file-access holes in the local server are closed. If you have ever run `repowise serve` on anything other than the default loopback bind, read the Security section first.
+
+### Security
+- **`repowise serve --host 0.0.0.0` no longer serves an unauthenticated API to the network.** The auth layer decided whether a request could skip the API key by reading `REPOWISE_HOST` to tell a loopback bind from an exposed one, and nothing on the CLI path ever set it. So the server bound the world while auth read "127.0.0.1" and let every request through, and the fail-closed branch for an exposed bind was unreachable code. The decision now comes from the request's peer address, so an exposed server fails closed however it was started and whatever the environment claims. Separately, the bundled web UI bound the wildcard while the API stayed on loopback: the UI rewrites `/api/*` to the API over localhost, so a UI on `0.0.0.0` handed the whole API to the network on the UI's port with every proxied request looking local, even at the default `--host 127.0.0.1`. The UI now takes the API's bind. One residual is known and warned about at startup: with an explicit `--host 0.0.0.0` and no key configured, that proxy still fronts the API. Setting a key makes the proxied path 401. (#1391)
+- **`/file-content` serves only files the indexer recorded.** Its one guard was containment in the repository root, and `.repowise/.env` (your provider API keys) and `.git/config` sit inside that root, so any caller who could reach the endpoint could read them by path. It now applies the same three-table existence test `GET /files/{path}` already used, and denies `.git/` and `.repowise/` outright. Only those two directories are denied by name, because the traverser does walk other dot-paths and `.github/workflows/ci.yml` is a legitimately indexed file. Both callers, the web file page and the VS Code architecture view, only ever requested paths from the indexed file list. (#1393)
+
+### Added
+- **Episodes: a dated, scoped record of what has happened to a repository.** Three tiers. Structural facts are derived at index time from the walk that already runs, with no history, no transcripts and no API key: nested git repositories, an editable install shadowing a console script, configuration that changes what a command does, a tree that is not formatter-clean (#1317). Git episodes are bug-fix commits whose diff changes production code, each carrying the author's own account, the files that moved together, and a birth commit that makes "does this still hold" a question git can answer (#1324). Session episodes record each agent session in its own words, bound to the files its tool calls touched; they are per-machine and never leave it (#1325). A session outlives the transcript it came from, which agents prune on a schedule nobody sets, and episode bodies are full-text searchable (#1331). (#1325, #1331)
+- **`get_answer` appends a recorded fact that disagrees with its answer.** It reasons from the code as it is now, so asked whether to run the declared formatter before committing, it reads a format target out of the build files and says yes, while the checkout's own record says the tree is not formatter-clean and a repo-wide run would produce a large unrelated diff. A scoped, still-current record now rides alongside the answer as a dated quotation. Three conditions, all required, or the payload is byte-identical to before. (#1318)
+- **`get_why` answers "what happened here" from episodes,** beside decisions, git archaeology and rationale comments. `get_risk` and `get_context` carry an `episodes` count on their cards. Both surfaces serve only the tiers that describe the repository, so two people asking one question of one repo get one answer. (#1333)
+- **Episodes over HTTP.** Four routes under `/api/repos/{repo_id}/episodes` (a paged list, grouped counts, a per-file lookup and a detail route), plus the TypeScript contract and API client. Only shareable tiers cross the wire, reading never creates the store, and no list route shells out to git. (#1346)
+- **A decision is bound to the directories it governs, and its staleness is measured rather than modelled.** Module linkage was the first path segment of each affected file, so in a `packages/` layout almost every record claimed "packages" or "tests". Staleness is now the fraction of a record's files that have been committed to since it was recorded, not a formula fitted to one repository that needed 15 commits in 90 days before it moved at all. Records naming no file are counted separately as unscoped, because they cannot be asked the question. (#1322)
+- **Unchanged re-reads collapse to a notice.** On PostToolUse Read, when the same range was served this session, no Edit came between and the bytes hash the same, the payload is replaced by a short line naming the earlier read. Opt-in via `hooks.read_reread`, default off. A file whose content differs is served in full plus a line saying it changed on disk and not through an edit in this session, which is something nothing else in the session can discover. (#1362)
+- **A failed path is answered with the file the index says you meant.** On PostToolUseFailure, when the basename resolves to exactly one indexed file still on disk, repowise names it. Everything else is silence: an ambiguous basename, a directory target, a path in another checkout, a failure the agent already answered itself. (#1336)
+- **`repowise saved` reports the net trade, and can report a loss.** It counted credits only and structurally could not show one. Debits are priced as they are actually paid: the CLAUDE.md block and the MCP schema are resident, so they are re-read on every API call, and the amplification is measured from real cache reads rather than assumed. Costs that local data cannot compute are named in the output rather than dropped. (#1362)
+- **A Codex session transcript adapter,** on the harness-agnostic transcript layer the shared session code was refactored onto. (#1277, #1316)
+- **Every embedding provider verifies the width of the vectors it gets back.** (#1305)
+- **`/repowise:security` in the Claude Code plugin,** exposing full-history secret scanning. (#1107)
+- **`repowise watch --index-only`,** so a watched docs repo does not mean a model call per save. (#1363)
+
+### Changed
+- **The generated CLAUDE.md / AGENTS.md block is about 30% smaller.** It is resident in the prompt prefix, so it is re-read on every API call rather than paid once; measured on one local corpus that amplification is 50.4x at a median 299 calls, which made the block the largest single cost repowise imposes on a session. Only the static half is cut. 5,788 of its 10,350 characters were identical in every repository repowise has ever indexed. Every section derived from your tree is untouched, all ten tool rows stay, and so do the argument shapes and the response fields an agent needs to call a tool correctly. (#1382)
+- **The augment hook no longer fires on shell commands.** Across one 287-session corpus, Bash and PowerShell were 8,942 of 17,441 hook invocations (51%) and produced 64 emissions (0.7%). The cost is process start, paid before repowise reads the payload, so no gate inside the handler could avoid it. SessionStart already carries the freshness line; what is given up is a mid-session commit going unflagged until the next session. Installed machines narrow themselves without a re-init. (#1382)
+- **The skeleton-nudge Read hook is retired.** It was the loudest surface in the system and it never changed behaviour: replaying 516 firings across 203 sessions, a structure call followed 11.4% of nudges against an 11.9% unconditioned base rate, and a second exposure read the same as the first. It was also answering the wrong reads. 53.3% of firings followed a ranged Read, which is advice to be more targeted handed to a read that already was. The replacement surface covers the case by serving the skeleton instead of describing it. (#1339)
+- **The Decisions page says what it actually knows.** It led with the size of its review queue, so the largest number on screen pointed at unreviewed guesses. The confirmed count leads now. Conflicts is gone (it rendered from a table holding zero rows on every repository). Most-governed-files is gone (81% of the links it ranked belonged to proposed records, under a heading that read like established governance). Staleness is a count rather than a percentage, and a new "About this checkout" section carries the structural facts, which is the only part of the page that says anything on a repository indexed an hour ago. (#1352)
+- **Health's `module` is the package boundary, not a graph community label.** The column held two vocabularies with nothing saying which one a row carried, and which one you got depended on which code path last wrote it. 41.5% of this repo's rows named a directory the file is not in. Go, Maven, Ruby, sbt, Clojure and Erlang monorepos get real package attribution for the first time, corrected in place on `repowise update` rather than requiring a re-index. (#1359, #1366)
+- **Health findings split test material into its own bucket.** At the default limit a quarter of the most-read list described the test suite. `top_findings` and `findings` carry production findings, `test_findings` carries the rest, and the two totals partition the whole open set. Bucketed rather than excluded: a thrashing test suite is a real signal, just not the same question as where the defect risk is. KPIs deliberately keep test files, since tests score better than production code and dropping them would lower every repo's headline with no defect having been found. (#1361)
+- **`get_health`'s directive stops promising a fix it does not have.** It names one file, states the dominant reason, and pointed at the refactoring block as the way to fix it. Nothing emits a plan for a coverage gap, which is the dominant cause on 10 of the 10 worst files here, so the directive named coverage and returned plans for complexity and duplication. It now carries `plan_addresses_reason` and, when false, a note naming the unaddressed cause. (#1358)
+- **`repowise health` honours the config's exclude patterns.** (#1366)
+
+### Fixed
+- **A keyless index stops ranking on its own vectors.** Keyless mode is documented as full-text-only in four places and the code never implemented it: the no-key embedder's 8-dimensional vectors were fused into rankings at full weight. They carry no signal: every component is non-negative, so two unrelated strings score 0.750 cosine on average and never below 0.207. The consequences were measured: the relevance floor written to stop unrelated pages surfacing was cleared by 100% of them and never fired, about 40% of every `search_codebase` top-5 was noise, `get_answer`'s confidence was corrupted along with its ranking, and decision dedup merged an unrelated new decision into an existing one 100% of the time past 50 records. (#1378)
+- **Two more keyless vector reads, and the confidence grade underneath them.** `repowise search --mode semantic` built its own store inline, so the first sweep never reached it and it rendered a window of nearest-neighbour noise with the full-text fallback sitting unused below. Separately, `get_answer`'s agreement lift required the full-text and vector legs to concur, which a keyless index can never do, so every keyless answer was graded by the gate that signal exists to correct. The symbol leg becomes the second opinion, on a stricter tie. Also: `--embedder ollama` against a stopped Ollama now says so instead of indexing silently without semantic retrieval. (#1380)
+- **A keyless wiki stops warning about every page it has.** One confidence value meant two things, a page whose provider call failed and the deterministic page a keyless or `--no-prose` run renders on purpose, and the reader turned it into a banner telling you to verify the content against the source. On a keyless index that banner landed on the repository overview and every subsystem page, about pages assembled entirely from the parse, the import graph and git history. The two cases are separated, and the reader keys on the failure marker rather than the number, so an already-published wiki reads correctly without a re-index. (#1383)
+- **`repowise watch` indexes the working tree, so it actually updates.** It fired an update on every save, and that update diffed `last_sync_commit..HEAD`, and on a repo you are actively editing there are no new commits, so the diff was empty by definition and every run printed "Already up to date". The watcher has therefore never indexed anything it watched. Also: events are filtered through the traversal blocklist so a build no longer means thousands of triggers, the files repowise itself rewrites can no longer make each update schedule the next, both ends of an atomic-save rename are considered, updates are serialised, the lock is released between runs, and reverted edits are undone in the index. (#1363)
+- **A config change no longer advances the sync pointer past commits it never indexed.** `update` took the config-changed branch, re-scored health and returned early, skipping the git re-index, then saved `last_sync_commit: head`. The next run reported "Already up to date" and those commits' churn, ownership and co-change were lost until a manual `--full`. (#1360)
+- **An incremental `update` prunes deleted files.** Deleting a file tombstoned its wiki page and left everything else: graph nodes and edges, metrics, symbols, health findings, dead-code and security findings, git metadata. MCP, search and the graph kept serving symbols for a file that no longer existed. Liveness is asked of things independent of the parse, so a transient read failure or an antivirus scan cannot look like a deletion, and a prune that would take more than half a table is refused and reported instead of applied. (#1377)
+- **A degraded update no longer strands the commits it skipped.** Every persist step degrades into a report, then the pointer moved to head regardless, so a failed step took its commit range with it permanently. A failure now records a repair marker holding the previous pointer, and the next update widens its diff base back to it. (#1377)
+- **Dead code persists the repo-wide verdict an update already computed.** The analysis was always repo-wide; its result was then filtered to the change set, discarding exactly the findings the change had just caused. Drop the last import of a module and that module becomes dead, and it is not in the change set. Widening the write alone would have made things worse, because the analyzer saw no git metadata for unchanged files and an empty record reads as "no commits in 90 days", so the fix also feeds it the stored per-file git fields. A dismissed finding is no longer resurrected. (#1389)
+- **A cohesive Go package is no longer reported as a circular dependency.** Files in one Go package reference each other with no import statement, so several passes synthesise file-level edges to keep reachability honest, and cycle detection read those as dependencies. Never Go-only: every `foo.h`/`foo.c` pair was a guaranteed two-file cycle and C# partial classes formed an all-pairs ring. Cycles before to after: gitleaks 1 to 0, osv-scanner 16 to 0, syft 16 to 0, hugo 10 (largest 571 files) to 0. Existing indexes converge on `repowise update`. (#1354)
+- **The worst-files lists rank by how much a file lost, not by a score that clamps at 1.0.** Thirty files sit at exactly the floor here, so every list sorted on score came back in path order and this repo's actual worst file landed at position 27, invisible at the default limit. Fixed once in the crud layer, so REST, MCP and hosted inherit one answer. A payload's headline and the list printed directly beneath it also disagreed about which file was worst; both now read one ordering. (#1342)
+- **A file at the score floor can show movement, and the trend stops hiding improvements.** Snapshots persist the clamped value, so 28 of 29 floored files had a flat 1.0 series while carrying 9 to 13 points of deduction. The per-file movement list also sorted ascending and sliced to 50, making it the 50 biggest drops. Also repairs a migration chain that had two revisions declaring the same id. (#1364)
+- **The health file drawer shows the line on file-level findings.** The `function:line` anchor was gated on a function name, so all 1,057 `error_handling` findings here rendered with no line and nothing to click: 34 rows on one file, identical in every visible field, because the drawer was withholding the one field that told them apart. A file-level biomarker that repeats now gets its own group, with a `capped` chip when the scorer is holding that category at its ceiling. (#1344)
+- **`get_health`'s `only` projection stops dropping the totals.** `only=["modules"]` at `limit=50` returned 50 of 116 with nothing saying so, breaking the tool's own promise that truncation is never silent. `include` and `only` were also two vocabularies for the same blocks, so `only=["biomarkers"]` projected away the block it had just switched on; those are aliases now. `limit=0` means none rather than clamping up to one. (#1361)
+- **`get_health` stops returning 4.7MB.** `include=["biomarkers"]` with no targets was the one ranked list with no cap, serving all 10,349 open findings, enough to overflow an agent's context and return nothing usable. Capped, with `findings_total` alongside. The dimension filter also ran over the finished response, so `include=["biomarkers","performance"]` came back empty while the total reported everything, which reads as "no performance risk in this repo". (#1337)
+- **The coverage tab's badge no longer reports one module.** A single `limit` was capping two unrelated things, a page of files and the repo's covered-directory count, so the badge, which asks for one row because it wants a cheap response, was told the repo had one module. A `?file_path=` request had the same defect from the other side. (#1356)
+- **The code-health map's churn lens paints the data it has.** It requested churn with no limit, so the server's default of 300 applied and about 1,700 of 2,000 nodes rendered as the no-data swatch. (#1342)
+- **`hook stats`, `hook rewrite status`, `doctor` and the `saved` tip report what a surface is doing, not what it once did.** Retired surfaces kept computing rates over denominators that had stopped growing and rendered identically to live ones; they are labelled and dimmed, with a `retired` flag in `--json`. "Installed" was keyed on the hook command, so an entry whose matcher names a tool the agent has since renamed was reported as working; presence and reach are separate answers now and the verdict is three-state. `repowise saved` priced tokens at a hardcoded model while the costs endpoint priced the same ledger at the detected one, understating an Opus session by two thirds. (#1343)
+- **An injected decision nothing could disagree with no longer counts as followed.** "Followed" was the else branch of the contradiction test, so a session that mined no correction handed out a positive verdict for free: 100 followed, 0 contradicted, and none of the 100 from a session holding any correction. Those rows settle with no verdict now. The supply side had the matching hole. The correction gate only fired on a message that opened with a pushback lead, finding 62 corrections across 436 transcripts against 260 for the same words at sentence start. (#1335)
+- **A marker decision is verified against its own span.** Every marker in a file had its context joined into one blob handed to every decision drawn from that file, so a decision from marker 1 could be stamped `exact` against marker 3's words, and all of them inherited the first marker's line. Staleness was also scored against one run's change set, so on an incremental update decisions over untouched files went maximally stale for not having been touched: 13 of 19 rows here read 1.00 and now 1 does. Existing rows correct themselves on the next update. (#1315)
+- **Three refactoring-plan fields stop reporting constants as measurements.** `suggested_name` was unconditionally null on all 854 stored `extract_method` plans while a sibling detector computed one; `blast_radius` was a hardcoded `{"callers_count": 0}` indistinguishable from a measured zero; and `suggested_site` mixed a graph community label with a filesystem path under generic keys, which is how a helper got named after the repository itself. (#1374)
+- **`get_why` no longer wedges the session.** It never returned on a repo with git-tier episodes: 300s with no response and one `git rev-list` still running, with the agent's whole MCP session stuck behind it. Three git spawns did not pass `stdin=DEVNULL`, so under the stdio transport the child inherits the server's JSON-RPC stdin and can hold it open indefinitely, and the `timeout=` on each call is not the backstop it looks like, since on Windows the re-entered `communicate()` blocks on threads the killed child still holds. (#1395)
+- **`doctor` stops reporting resume stubs as drift.** A stub awaiting `--resume` is held out of the vector store deliberately, because the vector is what tells the next `init --resume` the page is done, so counting it as a missing vector pointed people at `--repair`, which embedded the stub and silently burned the retry. It is surfaced on the row as "N stub(s) awaiting --resume" rather than hidden behind "in sync". Alongside it: `init` suggested `repowise decisions`, which is not a command, and blamed "provider failures" for pages its own artifact check had rejected; `dead-code` printed a raw dict; and `reindex` relabelled its progress bar "Indexing decisions..." on a repo with no decisions. (#1395)
+- **`status` and `doctor` query the configured database when there is no local `wiki.db`.** (#1320)
+- **A transient PyPI failure no longer pins the update check to "unknown" for 24 hours.** The failed result was written into the TTL cache, and the next call inside the window saw a cached `None` and skipped the live fetch. (#1330)
+- **Resume no longer redoes finished phases on a repo with more than 100 pipeline jobs.** The completed-phase readers took the default row limit, so the set was silently truncated and prior git-history, centrality and decision-extraction work was repeated. (#1329)
+- **The Read line count is correct for output ending in a newline,** which had been overstating by one and feeding both the nudge gate and the served-read windows. (#1328)
+- **`get_risk` and `search_codebase` fit their schema budget again.** (#1334)
+
+### Performance
+- **The update prologue stops paying four repeated costs.** Assessing the store no longer imports lancedb on a keyless repo (1.517s to 0.036s), the tech-stack scan is memoized on the root manifests' stat signature instead of running twice per update, the deterministic page persist no longer rebuilds a page tree its caller rebuilds immediately after, and `init` stamps the re-score cadence it satisfied so the first update does not score every file again. A post-commit hook runs this path on every commit, so all of it was charged per commit. (#1376)
+- **Lifetime churn folds onto an anchor instead of re-walking history.** Every update ran `git log --shortstat` over the entire history to move a number by one commit's worth of lines: 2.5s on a 2,216-commit checkout, 13.3s on a 9,335-commit one, growing with every commit anyone makes. Now 0.34s and 0.19s, byte-identical output, with a full re-walk every 100 commits to bound the drift that no ancestry check can see. Also fixes a timestamp parser that made a related backfill re-select the same rows forever, because strict ISO 8601 spells a zero offset `Z` and only `+00:00` was understood. (#1379)
+- **An update stops rewriting the graph rows it did not change.** A one-file change arrived as tens of thousands of rewrites of rows that had not moved: 1.9s on a 15k-node checkout, 11.3s on a 63k-node one. Centrality values compare with a tolerance, because the kernels are not bit-stable across processes and exact equality would rewrite every node to store noise. End to end on a real store, 2.10s to 0.48s and 12.73s to 8.81s, with row-for-row parity. (#1381)
+- **Dead-code analysis is four times faster.** All 579 never-flag globs were joined into one alternation with every branch tried at position 0, most beginning `.*`, which was 12.8s of an 18.1s cold analysis. Bucketing patterns by their end-anchored tail takes hugo from 3.10s to 0.72s and PowerToys from 25.29s to 5.71s, with identical findings. (#1389)
+- **The public health badge stops reading the whole dataset to render one float:** 358.2ms to 19.8ms. `wiki_symbols` also gained an index able to seek by file, taking a 400-path lookup from 33.3ms to 11.7ms. (#1351)
+- **`/health/overview` stops reading both health tables twice** (554.3ms to 376.4ms, and 2.2MB of snapshot JSON to zero), and `/overview-summary` stops loading the full retained snapshot history as entities to read three scalars off it. Both fixed a real defect on the way: the overview summary reported one recent fix for every flagged file, disagreeing with the health dashboard on the same page. (#1350, #1356)
+- **`/health/refactoring-targets` stops shipping every file's findings.** It built and serialized findings for all 2,411 files before slicing to the limit, then discarded about 90%: 1.16MB to 190KB at the limit the UI sends. Both consumers sit behind a click and now fetch on demand. (#1345)
+- **Query-time exclusion is compiled once per repo instead of per row,** 1,442ms to 3ms warm on a dashboard call, on a path shared by every MCP tool. `health_findings` gained the index it never had, taking a file-scoped lookup from 8.8ms to 0.1ms. (#1337)
+- **A Glob that ripgrep gave up on is answered from the index** instead of costing twenty seconds and returning nothing. (#1362)
+- **Read state is partitioned per session,** which fixes every Read hook surface being near-useless in subagents: a sidechain runs under a different session id from its parent, and the per-repo state file was keyed on session id and reset whenever it changed, so parent and subagent wiped each other's state on every Read. (#1362)
+
+### Documentation
+- **The README leads with the numbers.** Its strongest evidence was in its smallest text, under a headline that was a feature list. It now opens with the three results at size: first of six on finding the right files (0.876 against the next tool's 0.610 on a sealed 42-instance split), 31.6% fewer output tokens from the agent, and 97% fewer tokens to load a commit, plus the line that keeps what the strip cannot hold, including that we are the slowest indexer in the field. BENCHMARKS.md opens with a scoreboard and charts instead of forty-five lines of essay about why the page is built the way it is; the essay moves to the end as the closing argument. Nothing that runs against us was cut to make room. (#1365)
+- **The benchmarks are rerun on a second and third agent harness, and one claim is retracted.** The page read the "agent used it" column as a design result about how well we had named our tools. It does not support that: repeating an identical Claude Code run with nothing changed on anyone's side moved us from 15 of 15 to 3 of 15, and a competitor from 13 of 15 to 2 of 14, while switching harness moved every tool in the field to 15 of 15. Adoption is a joint property of tool, harness and day, so every figure now travels with its harness and its date. Section 2 leads with the full 48-question Codex run, where every tool actually gets called. (#1319, #1321, #1340)
+- **The code-health marker taxonomy is corrected.** The docs said 25 markers; the registry has 49 detectors across 52 marker ids, of which 26 feed the defect score, 20 the performance pillar, 3 maintainability only and 3 move no score at all. CODE_HEALTH.md is restructured from a reference manual into an argument, with a dozen figures corrected against live code and the bench data. (#1338)
+- **The website's CLI and Claude-plugin pages match the shipped surface,** and a change-risk CLI walkthrough is added to the examples. (#1106, #1177)
+
+---
+
## [0.39.0] — 2026-08-05
A small release. `get_answer` stops handing back bare file paths, the docs sidebar reads as an outline instead of a directory listing, and a store upgraded from 0.37.0 opens again instead of taking the whole wiki down with its search index.
diff --git a/packages/cli/src/repowise/cli/__init__.py b/packages/cli/src/repowise/cli/__init__.py
index 1e5642a14..918063f20 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.39.0"
+__version__ = "0.40.0"
diff --git a/packages/core/src/repowise/core/__init__.py b/packages/core/src/repowise/core/__init__.py
index 9c3d0c20d..9b9073ab5 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.39.0"
+__version__ = "0.40.0"
diff --git a/packages/core/src/repowise/core/upgrade/_data/CHANGELOG.md b/packages/core/src/repowise/core/upgrade/_data/CHANGELOG.md
index f8d0039e5..f2a1924d2 100644
--- a/packages/core/src/repowise/core/upgrade/_data/CHANGELOG.md
+++ b/packages/core/src/repowise/core/upgrade/_data/CHANGELOG.md
@@ -9,6 +9,91 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
---
+## [0.40.0] — 2026-08-10
+
+The big one this cycle is a new kind of record. Repowise already told you what the code is and what history says about it; it had no way to say what has happened to a repository: that this directory is a separate checkout, that a console script is shadowed, that this bug was fixed in this commit and nothing in its scope has moved since. Episodes are those records: dated, bound to the files they touch, derived from the walk and the git pass that already run, and checkable against git rather than decayed by a curve. They are read by `get_answer`, `get_why`, `get_risk` and `get_context`, and served over HTTP for the dashboard.
+
+Alongside it: a keyless index stops ranking on vectors that carry no signal, which was roughly 40% of every search window; the health dashboard ranks by how much a file actually lost rather than by a score that clamps; `repowise watch` indexes the working tree, so it finally updates anything it watches; an incremental `update` prunes deleted files and can no longer strand the commits a failed step skipped; and the update path got about ten seconds faster on a large checkout.
+
+Two authentication and file-access holes in the local server are closed. If you have ever run `repowise serve` on anything other than the default loopback bind, read the Security section first.
+
+### Security
+- **`repowise serve --host 0.0.0.0` no longer serves an unauthenticated API to the network.** The auth layer decided whether a request could skip the API key by reading `REPOWISE_HOST` to tell a loopback bind from an exposed one, and nothing on the CLI path ever set it. So the server bound the world while auth read "127.0.0.1" and let every request through, and the fail-closed branch for an exposed bind was unreachable code. The decision now comes from the request's peer address, so an exposed server fails closed however it was started and whatever the environment claims. Separately, the bundled web UI bound the wildcard while the API stayed on loopback: the UI rewrites `/api/*` to the API over localhost, so a UI on `0.0.0.0` handed the whole API to the network on the UI's port with every proxied request looking local, even at the default `--host 127.0.0.1`. The UI now takes the API's bind. One residual is known and warned about at startup: with an explicit `--host 0.0.0.0` and no key configured, that proxy still fronts the API. Setting a key makes the proxied path 401. (#1391)
+- **`/file-content` serves only files the indexer recorded.** Its one guard was containment in the repository root, and `.repowise/.env` (your provider API keys) and `.git/config` sit inside that root, so any caller who could reach the endpoint could read them by path. It now applies the same three-table existence test `GET /files/{path}` already used, and denies `.git/` and `.repowise/` outright. Only those two directories are denied by name, because the traverser does walk other dot-paths and `.github/workflows/ci.yml` is a legitimately indexed file. Both callers, the web file page and the VS Code architecture view, only ever requested paths from the indexed file list. (#1393)
+
+### Added
+- **Episodes: a dated, scoped record of what has happened to a repository.** Three tiers. Structural facts are derived at index time from the walk that already runs, with no history, no transcripts and no API key: nested git repositories, an editable install shadowing a console script, configuration that changes what a command does, a tree that is not formatter-clean (#1317). Git episodes are bug-fix commits whose diff changes production code, each carrying the author's own account, the files that moved together, and a birth commit that makes "does this still hold" a question git can answer (#1324). Session episodes record each agent session in its own words, bound to the files its tool calls touched; they are per-machine and never leave it (#1325). A session outlives the transcript it came from, which agents prune on a schedule nobody sets, and episode bodies are full-text searchable (#1331). (#1325, #1331)
+- **`get_answer` appends a recorded fact that disagrees with its answer.** It reasons from the code as it is now, so asked whether to run the declared formatter before committing, it reads a format target out of the build files and says yes, while the checkout's own record says the tree is not formatter-clean and a repo-wide run would produce a large unrelated diff. A scoped, still-current record now rides alongside the answer as a dated quotation. Three conditions, all required, or the payload is byte-identical to before. (#1318)
+- **`get_why` answers "what happened here" from episodes,** beside decisions, git archaeology and rationale comments. `get_risk` and `get_context` carry an `episodes` count on their cards. Both surfaces serve only the tiers that describe the repository, so two people asking one question of one repo get one answer. (#1333)
+- **Episodes over HTTP.** Four routes under `/api/repos/{repo_id}/episodes` (a paged list, grouped counts, a per-file lookup and a detail route), plus the TypeScript contract and API client. Only shareable tiers cross the wire, reading never creates the store, and no list route shells out to git. (#1346)
+- **A decision is bound to the directories it governs, and its staleness is measured rather than modelled.** Module linkage was the first path segment of each affected file, so in a `packages/` layout almost every record claimed "packages" or "tests". Staleness is now the fraction of a record's files that have been committed to since it was recorded, not a formula fitted to one repository that needed 15 commits in 90 days before it moved at all. Records naming no file are counted separately as unscoped, because they cannot be asked the question. (#1322)
+- **Unchanged re-reads collapse to a notice.** On PostToolUse Read, when the same range was served this session, no Edit came between and the bytes hash the same, the payload is replaced by a short line naming the earlier read. Opt-in via `hooks.read_reread`, default off. A file whose content differs is served in full plus a line saying it changed on disk and not through an edit in this session, which is something nothing else in the session can discover. (#1362)
+- **A failed path is answered with the file the index says you meant.** On PostToolUseFailure, when the basename resolves to exactly one indexed file still on disk, repowise names it. Everything else is silence: an ambiguous basename, a directory target, a path in another checkout, a failure the agent already answered itself. (#1336)
+- **`repowise saved` reports the net trade, and can report a loss.** It counted credits only and structurally could not show one. Debits are priced as they are actually paid: the CLAUDE.md block and the MCP schema are resident, so they are re-read on every API call, and the amplification is measured from real cache reads rather than assumed. Costs that local data cannot compute are named in the output rather than dropped. (#1362)
+- **A Codex session transcript adapter,** on the harness-agnostic transcript layer the shared session code was refactored onto. (#1277, #1316)
+- **Every embedding provider verifies the width of the vectors it gets back.** (#1305)
+- **`/repowise:security` in the Claude Code plugin,** exposing full-history secret scanning. (#1107)
+- **`repowise watch --index-only`,** so a watched docs repo does not mean a model call per save. (#1363)
+
+### Changed
+- **The generated CLAUDE.md / AGENTS.md block is about 30% smaller.** It is resident in the prompt prefix, so it is re-read on every API call rather than paid once; measured on one local corpus that amplification is 50.4x at a median 299 calls, which made the block the largest single cost repowise imposes on a session. Only the static half is cut. 5,788 of its 10,350 characters were identical in every repository repowise has ever indexed. Every section derived from your tree is untouched, all ten tool rows stay, and so do the argument shapes and the response fields an agent needs to call a tool correctly. (#1382)
+- **The augment hook no longer fires on shell commands.** Across one 287-session corpus, Bash and PowerShell were 8,942 of 17,441 hook invocations (51%) and produced 64 emissions (0.7%). The cost is process start, paid before repowise reads the payload, so no gate inside the handler could avoid it. SessionStart already carries the freshness line; what is given up is a mid-session commit going unflagged until the next session. Installed machines narrow themselves without a re-init. (#1382)
+- **The skeleton-nudge Read hook is retired.** It was the loudest surface in the system and it never changed behaviour: replaying 516 firings across 203 sessions, a structure call followed 11.4% of nudges against an 11.9% unconditioned base rate, and a second exposure read the same as the first. It was also answering the wrong reads. 53.3% of firings followed a ranged Read, which is advice to be more targeted handed to a read that already was. The replacement surface covers the case by serving the skeleton instead of describing it. (#1339)
+- **The Decisions page says what it actually knows.** It led with the size of its review queue, so the largest number on screen pointed at unreviewed guesses. The confirmed count leads now. Conflicts is gone (it rendered from a table holding zero rows on every repository). Most-governed-files is gone (81% of the links it ranked belonged to proposed records, under a heading that read like established governance). Staleness is a count rather than a percentage, and a new "About this checkout" section carries the structural facts, which is the only part of the page that says anything on a repository indexed an hour ago. (#1352)
+- **Health's `module` is the package boundary, not a graph community label.** The column held two vocabularies with nothing saying which one a row carried, and which one you got depended on which code path last wrote it. 41.5% of this repo's rows named a directory the file is not in. Go, Maven, Ruby, sbt, Clojure and Erlang monorepos get real package attribution for the first time, corrected in place on `repowise update` rather than requiring a re-index. (#1359, #1366)
+- **Health findings split test material into its own bucket.** At the default limit a quarter of the most-read list described the test suite. `top_findings` and `findings` carry production findings, `test_findings` carries the rest, and the two totals partition the whole open set. Bucketed rather than excluded: a thrashing test suite is a real signal, just not the same question as where the defect risk is. KPIs deliberately keep test files, since tests score better than production code and dropping them would lower every repo's headline with no defect having been found. (#1361)
+- **`get_health`'s directive stops promising a fix it does not have.** It names one file, states the dominant reason, and pointed at the refactoring block as the way to fix it. Nothing emits a plan for a coverage gap, which is the dominant cause on 10 of the 10 worst files here, so the directive named coverage and returned plans for complexity and duplication. It now carries `plan_addresses_reason` and, when false, a note naming the unaddressed cause. (#1358)
+- **`repowise health` honours the config's exclude patterns.** (#1366)
+
+### Fixed
+- **A keyless index stops ranking on its own vectors.** Keyless mode is documented as full-text-only in four places and the code never implemented it: the no-key embedder's 8-dimensional vectors were fused into rankings at full weight. They carry no signal: every component is non-negative, so two unrelated strings score 0.750 cosine on average and never below 0.207. The consequences were measured: the relevance floor written to stop unrelated pages surfacing was cleared by 100% of them and never fired, about 40% of every `search_codebase` top-5 was noise, `get_answer`'s confidence was corrupted along with its ranking, and decision dedup merged an unrelated new decision into an existing one 100% of the time past 50 records. (#1378)
+- **Two more keyless vector reads, and the confidence grade underneath them.** `repowise search --mode semantic` built its own store inline, so the first sweep never reached it and it rendered a window of nearest-neighbour noise with the full-text fallback sitting unused below. Separately, `get_answer`'s agreement lift required the full-text and vector legs to concur, which a keyless index can never do, so every keyless answer was graded by the gate that signal exists to correct. The symbol leg becomes the second opinion, on a stricter tie. Also: `--embedder ollama` against a stopped Ollama now says so instead of indexing silently without semantic retrieval. (#1380)
+- **A keyless wiki stops warning about every page it has.** One confidence value meant two things, a page whose provider call failed and the deterministic page a keyless or `--no-prose` run renders on purpose, and the reader turned it into a banner telling you to verify the content against the source. On a keyless index that banner landed on the repository overview and every subsystem page, about pages assembled entirely from the parse, the import graph and git history. The two cases are separated, and the reader keys on the failure marker rather than the number, so an already-published wiki reads correctly without a re-index. (#1383)
+- **`repowise watch` indexes the working tree, so it actually updates.** It fired an update on every save, and that update diffed `last_sync_commit..HEAD`, and on a repo you are actively editing there are no new commits, so the diff was empty by definition and every run printed "Already up to date". The watcher has therefore never indexed anything it watched. Also: events are filtered through the traversal blocklist so a build no longer means thousands of triggers, the files repowise itself rewrites can no longer make each update schedule the next, both ends of an atomic-save rename are considered, updates are serialised, the lock is released between runs, and reverted edits are undone in the index. (#1363)
+- **A config change no longer advances the sync pointer past commits it never indexed.** `update` took the config-changed branch, re-scored health and returned early, skipping the git re-index, then saved `last_sync_commit: head`. The next run reported "Already up to date" and those commits' churn, ownership and co-change were lost until a manual `--full`. (#1360)
+- **An incremental `update` prunes deleted files.** Deleting a file tombstoned its wiki page and left everything else: graph nodes and edges, metrics, symbols, health findings, dead-code and security findings, git metadata. MCP, search and the graph kept serving symbols for a file that no longer existed. Liveness is asked of things independent of the parse, so a transient read failure or an antivirus scan cannot look like a deletion, and a prune that would take more than half a table is refused and reported instead of applied. (#1377)
+- **A degraded update no longer strands the commits it skipped.** Every persist step degrades into a report, then the pointer moved to head regardless, so a failed step took its commit range with it permanently. A failure now records a repair marker holding the previous pointer, and the next update widens its diff base back to it. (#1377)
+- **Dead code persists the repo-wide verdict an update already computed.** The analysis was always repo-wide; its result was then filtered to the change set, discarding exactly the findings the change had just caused. Drop the last import of a module and that module becomes dead, and it is not in the change set. Widening the write alone would have made things worse, because the analyzer saw no git metadata for unchanged files and an empty record reads as "no commits in 90 days", so the fix also feeds it the stored per-file git fields. A dismissed finding is no longer resurrected. (#1389)
+- **A cohesive Go package is no longer reported as a circular dependency.** Files in one Go package reference each other with no import statement, so several passes synthesise file-level edges to keep reachability honest, and cycle detection read those as dependencies. Never Go-only: every `foo.h`/`foo.c` pair was a guaranteed two-file cycle and C# partial classes formed an all-pairs ring. Cycles before to after: gitleaks 1 to 0, osv-scanner 16 to 0, syft 16 to 0, hugo 10 (largest 571 files) to 0. Existing indexes converge on `repowise update`. (#1354)
+- **The worst-files lists rank by how much a file lost, not by a score that clamps at 1.0.** Thirty files sit at exactly the floor here, so every list sorted on score came back in path order and this repo's actual worst file landed at position 27, invisible at the default limit. Fixed once in the crud layer, so REST, MCP and hosted inherit one answer. A payload's headline and the list printed directly beneath it also disagreed about which file was worst; both now read one ordering. (#1342)
+- **A file at the score floor can show movement, and the trend stops hiding improvements.** Snapshots persist the clamped value, so 28 of 29 floored files had a flat 1.0 series while carrying 9 to 13 points of deduction. The per-file movement list also sorted ascending and sliced to 50, making it the 50 biggest drops. Also repairs a migration chain that had two revisions declaring the same id. (#1364)
+- **The health file drawer shows the line on file-level findings.** The `function:line` anchor was gated on a function name, so all 1,057 `error_handling` findings here rendered with no line and nothing to click: 34 rows on one file, identical in every visible field, because the drawer was withholding the one field that told them apart. A file-level biomarker that repeats now gets its own group, with a `capped` chip when the scorer is holding that category at its ceiling. (#1344)
+- **`get_health`'s `only` projection stops dropping the totals.** `only=["modules"]` at `limit=50` returned 50 of 116 with nothing saying so, breaking the tool's own promise that truncation is never silent. `include` and `only` were also two vocabularies for the same blocks, so `only=["biomarkers"]` projected away the block it had just switched on; those are aliases now. `limit=0` means none rather than clamping up to one. (#1361)
+- **`get_health` stops returning 4.7MB.** `include=["biomarkers"]` with no targets was the one ranked list with no cap, serving all 10,349 open findings, enough to overflow an agent's context and return nothing usable. Capped, with `findings_total` alongside. The dimension filter also ran over the finished response, so `include=["biomarkers","performance"]` came back empty while the total reported everything, which reads as "no performance risk in this repo". (#1337)
+- **The coverage tab's badge no longer reports one module.** A single `limit` was capping two unrelated things, a page of files and the repo's covered-directory count, so the badge, which asks for one row because it wants a cheap response, was told the repo had one module. A `?file_path=` request had the same defect from the other side. (#1356)
+- **The code-health map's churn lens paints the data it has.** It requested churn with no limit, so the server's default of 300 applied and about 1,700 of 2,000 nodes rendered as the no-data swatch. (#1342)
+- **`hook stats`, `hook rewrite status`, `doctor` and the `saved` tip report what a surface is doing, not what it once did.** Retired surfaces kept computing rates over denominators that had stopped growing and rendered identically to live ones; they are labelled and dimmed, with a `retired` flag in `--json`. "Installed" was keyed on the hook command, so an entry whose matcher names a tool the agent has since renamed was reported as working; presence and reach are separate answers now and the verdict is three-state. `repowise saved` priced tokens at a hardcoded model while the costs endpoint priced the same ledger at the detected one, understating an Opus session by two thirds. (#1343)
+- **An injected decision nothing could disagree with no longer counts as followed.** "Followed" was the else branch of the contradiction test, so a session that mined no correction handed out a positive verdict for free: 100 followed, 0 contradicted, and none of the 100 from a session holding any correction. Those rows settle with no verdict now. The supply side had the matching hole. The correction gate only fired on a message that opened with a pushback lead, finding 62 corrections across 436 transcripts against 260 for the same words at sentence start. (#1335)
+- **A marker decision is verified against its own span.** Every marker in a file had its context joined into one blob handed to every decision drawn from that file, so a decision from marker 1 could be stamped `exact` against marker 3's words, and all of them inherited the first marker's line. Staleness was also scored against one run's change set, so on an incremental update decisions over untouched files went maximally stale for not having been touched: 13 of 19 rows here read 1.00 and now 1 does. Existing rows correct themselves on the next update. (#1315)
+- **Three refactoring-plan fields stop reporting constants as measurements.** `suggested_name` was unconditionally null on all 854 stored `extract_method` plans while a sibling detector computed one; `blast_radius` was a hardcoded `{"callers_count": 0}` indistinguishable from a measured zero; and `suggested_site` mixed a graph community label with a filesystem path under generic keys, which is how a helper got named after the repository itself. (#1374)
+- **`get_why` no longer wedges the session.** It never returned on a repo with git-tier episodes: 300s with no response and one `git rev-list` still running, with the agent's whole MCP session stuck behind it. Three git spawns did not pass `stdin=DEVNULL`, so under the stdio transport the child inherits the server's JSON-RPC stdin and can hold it open indefinitely, and the `timeout=` on each call is not the backstop it looks like, since on Windows the re-entered `communicate()` blocks on threads the killed child still holds. (#1395)
+- **`doctor` stops reporting resume stubs as drift.** A stub awaiting `--resume` is held out of the vector store deliberately, because the vector is what tells the next `init --resume` the page is done, so counting it as a missing vector pointed people at `--repair`, which embedded the stub and silently burned the retry. It is surfaced on the row as "N stub(s) awaiting --resume" rather than hidden behind "in sync". Alongside it: `init` suggested `repowise decisions`, which is not a command, and blamed "provider failures" for pages its own artifact check had rejected; `dead-code` printed a raw dict; and `reindex` relabelled its progress bar "Indexing decisions..." on a repo with no decisions. (#1395)
+- **`status` and `doctor` query the configured database when there is no local `wiki.db`.** (#1320)
+- **A transient PyPI failure no longer pins the update check to "unknown" for 24 hours.** The failed result was written into the TTL cache, and the next call inside the window saw a cached `None` and skipped the live fetch. (#1330)
+- **Resume no longer redoes finished phases on a repo with more than 100 pipeline jobs.** The completed-phase readers took the default row limit, so the set was silently truncated and prior git-history, centrality and decision-extraction work was repeated. (#1329)
+- **The Read line count is correct for output ending in a newline,** which had been overstating by one and feeding both the nudge gate and the served-read windows. (#1328)
+- **`get_risk` and `search_codebase` fit their schema budget again.** (#1334)
+
+### Performance
+- **The update prologue stops paying four repeated costs.** Assessing the store no longer imports lancedb on a keyless repo (1.517s to 0.036s), the tech-stack scan is memoized on the root manifests' stat signature instead of running twice per update, the deterministic page persist no longer rebuilds a page tree its caller rebuilds immediately after, and `init` stamps the re-score cadence it satisfied so the first update does not score every file again. A post-commit hook runs this path on every commit, so all of it was charged per commit. (#1376)
+- **Lifetime churn folds onto an anchor instead of re-walking history.** Every update ran `git log --shortstat` over the entire history to move a number by one commit's worth of lines: 2.5s on a 2,216-commit checkout, 13.3s on a 9,335-commit one, growing with every commit anyone makes. Now 0.34s and 0.19s, byte-identical output, with a full re-walk every 100 commits to bound the drift that no ancestry check can see. Also fixes a timestamp parser that made a related backfill re-select the same rows forever, because strict ISO 8601 spells a zero offset `Z` and only `+00:00` was understood. (#1379)
+- **An update stops rewriting the graph rows it did not change.** A one-file change arrived as tens of thousands of rewrites of rows that had not moved: 1.9s on a 15k-node checkout, 11.3s on a 63k-node one. Centrality values compare with a tolerance, because the kernels are not bit-stable across processes and exact equality would rewrite every node to store noise. End to end on a real store, 2.10s to 0.48s and 12.73s to 8.81s, with row-for-row parity. (#1381)
+- **Dead-code analysis is four times faster.** All 579 never-flag globs were joined into one alternation with every branch tried at position 0, most beginning `.*`, which was 12.8s of an 18.1s cold analysis. Bucketing patterns by their end-anchored tail takes hugo from 3.10s to 0.72s and PowerToys from 25.29s to 5.71s, with identical findings. (#1389)
+- **The public health badge stops reading the whole dataset to render one float:** 358.2ms to 19.8ms. `wiki_symbols` also gained an index able to seek by file, taking a 400-path lookup from 33.3ms to 11.7ms. (#1351)
+- **`/health/overview` stops reading both health tables twice** (554.3ms to 376.4ms, and 2.2MB of snapshot JSON to zero), and `/overview-summary` stops loading the full retained snapshot history as entities to read three scalars off it. Both fixed a real defect on the way: the overview summary reported one recent fix for every flagged file, disagreeing with the health dashboard on the same page. (#1350, #1356)
+- **`/health/refactoring-targets` stops shipping every file's findings.** It built and serialized findings for all 2,411 files before slicing to the limit, then discarded about 90%: 1.16MB to 190KB at the limit the UI sends. Both consumers sit behind a click and now fetch on demand. (#1345)
+- **Query-time exclusion is compiled once per repo instead of per row,** 1,442ms to 3ms warm on a dashboard call, on a path shared by every MCP tool. `health_findings` gained the index it never had, taking a file-scoped lookup from 8.8ms to 0.1ms. (#1337)
+- **A Glob that ripgrep gave up on is answered from the index** instead of costing twenty seconds and returning nothing. (#1362)
+- **Read state is partitioned per session,** which fixes every Read hook surface being near-useless in subagents: a sidechain runs under a different session id from its parent, and the per-repo state file was keyed on session id and reset whenever it changed, so parent and subagent wiped each other's state on every Read. (#1362)
+
+### Documentation
+- **The README leads with the numbers.** Its strongest evidence was in its smallest text, under a headline that was a feature list. It now opens with the three results at size: first of six on finding the right files (0.876 against the next tool's 0.610 on a sealed 42-instance split), 31.6% fewer output tokens from the agent, and 97% fewer tokens to load a commit, plus the line that keeps what the strip cannot hold, including that we are the slowest indexer in the field. BENCHMARKS.md opens with a scoreboard and charts instead of forty-five lines of essay about why the page is built the way it is; the essay moves to the end as the closing argument. Nothing that runs against us was cut to make room. (#1365)
+- **The benchmarks are rerun on a second and third agent harness, and one claim is retracted.** The page read the "agent used it" column as a design result about how well we had named our tools. It does not support that: repeating an identical Claude Code run with nothing changed on anyone's side moved us from 15 of 15 to 3 of 15, and a competitor from 13 of 15 to 2 of 14, while switching harness moved every tool in the field to 15 of 15. Adoption is a joint property of tool, harness and day, so every figure now travels with its harness and its date. Section 2 leads with the full 48-question Codex run, where every tool actually gets called. (#1319, #1321, #1340)
+- **The code-health marker taxonomy is corrected.** The docs said 25 markers; the registry has 49 detectors across 52 marker ids, of which 26 feed the defect score, 20 the performance pillar, 3 maintainability only and 3 move no score at all. CODE_HEALTH.md is restructured from a reference manual into an argument, with a dozen figures corrected against live code and the bench data. (#1338)
+- **The website's CLI and Claude-plugin pages match the shipped surface,** and a change-risk CLI walkthrough is added to the examples. (#1106, #1177)
+
+---
+
## [0.39.0] — 2026-08-05
A small release. `get_answer` stops handing back bare file paths, the docs sidebar reads as an outline instead of a directory listing, and a store upgraded from 0.37.0 opens again instead of taking the whole wiki down with its search index.
diff --git a/packages/server/src/repowise/server/__init__.py b/packages/server/src/repowise/server/__init__.py
index ae32fc305..cd38d37fa 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.39.0"
+__version__ = "0.40.0"
diff --git a/packages/vscode/CHANGELOG.md b/packages/vscode/CHANGELOG.md
index 84d18cd58..d54d174fa 100644
--- a/packages/vscode/CHANGELOG.md
+++ b/packages/vscode/CHANGELOG.md
@@ -7,6 +7,31 @@ is the minimum server version it checks against.
This file starts at 0.7.0. Earlier releases are described in the repository's
release history.
+## 0.8.0
+
+A small release. The webviews compile the shared Repowise UI at build time, so
+these arrived with a rebuild rather than with edits to the extension itself.
+
+### Docs
+
+- The low-confidence banner is gone from pages that were never uncertain. One
+ confidence value meant two things: a page whose provider call failed, and the
+ page an index built without an API key renders deterministically on purpose.
+ On a keyless index the banner therefore landed on the repository overview and
+ every subsystem page, about content assembled entirely from the parse, the
+ import graph and git history. A page that really did lose its prose to a
+ provider error now says so in one line at the end of the content, beside the
+ affordance that fixes it, with no alarm colour. It reads correctly against a
+ wiki published before this change, with no reindex.
+
+### Refactoring
+
+- An extract-helper plan names a directory as its destination. It used to
+ prefer a graph community label, which named a directory the duplicated code
+ did not live in: censused over 963 stored plans, all 905 that carried a label
+ pointed somewhere none of the occurrences were. Plans stored before the fix
+ still render, falling back to the old field only when there is no directory.
+
## 0.7.0
The webviews compile the shared Repowise UI components at build time, so most of
diff --git a/packages/vscode/package.json b/packages/vscode/package.json
index a47d329b8..5af7fe1fb 100644
--- a/packages/vscode/package.json
+++ b/packages/vscode/package.json
@@ -2,7 +2,7 @@
"name": "repowise",
"displayName": "Repowise",
"description": "Know what your change breaks before you push. Health signals, architecture maps, and refactoring plans in your editor, and the same intelligence for your AI agent via MCP. Local and free.",
- "version": "0.7.0",
+ "version": "0.8.0",
"publisher": "repowise-dev",
"license": "AGPL-3.0-or-later",
"homepage": "https://www.repowise.dev",
diff --git a/plugins/claude-code/.claude-plugin/plugin.json b/plugins/claude-code/.claude-plugin/plugin.json
index 039c5d9c6..babb4074f 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 ten 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.39.0",
+ "version": "0.40.0",
"author": {
"name": "Repowise",
"email": "[email protected]",
diff --git a/plugins/claude-code/CHANGELOG.md b/plugins/claude-code/CHANGELOG.md
index 86e64c5a5..34d019130 100644
--- a/plugins/claude-code/CHANGELOG.md
+++ b/plugins/claude-code/CHANGELOG.md
@@ -2,6 +2,26 @@
All notable changes to the Repowise Claude Code plugin are documented here.
+## 0.40.0
+
+### Added
+- `/repowise:security` runs the full-history secret scan. Working-tree scanning
+ already happens during `init` and `update`; this command is for walking git
+ history to find secrets that were later removed. No model call, and re-runs
+ are idempotent (#1107).
+
+### Changed
+- The `PostToolUse` matcher no longer selects `Bash` or `PowerShell`. Across one
+ 287-session corpus those were 51% of all hook invocations and 0.7% of the
+ emissions, and the cost is process start, paid before repowise reads the
+ payload. An installed machine narrows itself on the next CLI invocation
+ without a re-init (#1382).
+- A `PostToolUseFailure` entry is registered, matching
+ `Read|Edit|Write|Grep|Glob|NotebookEdit`. When a failed path's basename
+ resolves to exactly one indexed file still on disk, repowise names it (#1336).
+- Version bump to track the repowise 0.40.0 release. The MCP tool surface is
+ unchanged; the CLI flags the commands document still match the shipped CLI.
+
## 0.39.0
### Changed
diff --git a/plugins/codex/.codex-plugin/plugin.json b/plugins/codex/.codex-plugin/plugin.json
index 1f9fce978..badbce07f 100644
--- a/plugins/codex/.codex-plugin/plugin.json
+++ b/plugins/codex/.codex-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "codex",
- "version": "0.4.0",
+ "version": "0.4.1",
"description": "Repowise codebase intelligence for Codex.",
"author": {
"name": "Repowise",
diff --git a/pyproject.toml b/pyproject.toml
index c219e072f..4a1786b0e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "repowise"
-version = "0.39.0"
+version = "0.40.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/uv.lock b/uv.lock
index 927db6aa3..e40d6396c 100644
--- a/uv.lock
+++ b/uv.lock
@@ -3051,7 +3051,7 @@ wheels = [
[[package]]
name = "repowise"
-version = "0.39.0"
+version = "0.40.0"
source = { editable = "." }
dependencies = [
{ name = "aiosqlite" },