Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.
Python aicode-complexitycode-healthcode-intelligencecode-qualitydead-codedeveloper-toolsdocumentationgit-analyticsmcpopen-sourcepythonrefactoringstatic-analysistechnical-debt
docs: overhaul the README and restructure the docs tree (#957)
Raghav Chamadiyaa957e883f1a8
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.mdindex 95692ae12..e74ac7c21 100644--- a/.github/CONTRIBUTING.md+++ b/.github/CONTRIBUTING.md@@ -109,10 +109,10 @@ repowise/5. **Add tests** in `tests/unit/test_providers/` — mock the subprocess, test success/error/timeout paths (see `test_codex_cli_provider.py` for the pattern)-6. **Write docs** — `docs/<NAME>.md` and `website/<name>.md`, following `docs/CODEX.md` and `docs/OPENCODE.md`.+6. **Write docs** — `docs/<NAME>.md` and `website/<name>.md`, following `docs/agent/CODEX.md` and `docs/agent/OPENCODE.md`.Adding a new language or LLM provider has a dedicated recipe — see-[docs/LANGUAGE_SUPPORT.md](../docs/LANGUAGE_SUPPORT.md).+[docs/layers/LANGUAGE_SUPPORT.md](../docs/layers/LANGUAGE_SUPPORT.md).## Testingdiff --git a/.github/assets/dashboard/code-health.gif b/.github/assets/dashboard/code-health.gifnew file mode 100644index 000000000..aad9628a1Binary files /dev/null and b/.github/assets/dashboard/code-health.gif differdiff --git a/.github/assets/dashboard/code-health.png b/.github/assets/dashboard/code-health.pngnew file mode 100644index 000000000..7281f0650Binary files /dev/null and b/.github/assets/dashboard/code-health.png differdiff --git a/.github/assets/dashboard/commits-page.gif b/.github/assets/dashboard/commits-page.gifnew file mode 100644index 000000000..893a7ffa4Binary files /dev/null and b/.github/assets/dashboard/commits-page.gif differdiff --git a/.github/assets/dashboard/docs.png b/.github/assets/dashboard/docs.pngnew file mode 100644index 000000000..ae16252cdBinary files /dev/null and b/.github/assets/dashboard/docs.png differdiff --git a/.github/assets/dashboard/files-page.gif b/.github/assets/dashboard/files-page.gifnew file mode 100644index 000000000..70df952d3Binary files /dev/null and b/.github/assets/dashboard/files-page.gif differdiff --git a/.github/assets/dashboard/graph.png b/.github/assets/dashboard/graph.pngnew file mode 100644index 000000000..eed5cd20fBinary files /dev/null and b/.github/assets/dashboard/graph.png differdiff --git a/.github/assets/dashboard/refactoring.gif b/.github/assets/dashboard/refactoring.gifnew file mode 100644index 000000000..78ce5e098Binary files /dev/null and b/.github/assets/dashboard/refactoring.gif differdiff --git a/.github/assets/one-index-dark.svg b/.github/assets/one-index-dark.svgnew file mode 100644index 000000000..1d6069300--- /dev/null+++ b/.github/assets/one-index-dark.svg@@ -0,0 +1,18 @@+<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="812" viewBox="0 0 1600 812" role="img" aria-label="repowise: one index producing code health, a dependency graph, git history, generated docs, architectural decisions, and ten MCP tools"><style>+ text { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif; }+ .h1 { font-size: 30px; font-weight: 700; fill: #EEEAF4; letter-spacing: -.4px; }+ .sub { font-size: 15px; fill: #A79DB3; }+ .lbl { font-size: 11.5px; font-weight: 700; fill: #EEEAF4; letter-spacing: 1.1px; }+ .kick { font-size: 11.5px; fill: #786F84; letter-spacing: .3px; }+ .cap { font-size: 11px; fill: #786F84; letter-spacing: .3px; }+ .out { font-size: 15.5px; font-weight: 650; fill: #EEEAF4; }+ .outsub { font-size: 12.5px; fill: #A79DB3; }+ .chiplbl { font-size: 10.5px; fill: #A79DB3; letter-spacing: .5px; text-transform: uppercase; }+ .chipval { font-size: 24px; font-weight: 700; }+ .chipunit { font-size: 13px; font-weight: 500; fill: #786F84; }+ .trust { font-size: 12.5px; fill: #EEEAF4; }+ .find { font-size: 10.5px; fill: #A79DB3; letter-spacing: .4px; }+ .dec { font-size: 14px; font-weight: 600; fill: #EEEAF4; }+ .pill { font-size: 10.5px; font-weight: 600; }+ .mono { font-size: 11.5px; fill: #A79DB3; font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; }+</style><rect width="1600" height="812" fill="#17131D"/><text x="36" y="50" class="h1">One index. Everything your agent and your team keep asking for.</text><text x="36" y="80" class="sub">Index once, in seconds, no LLM required. Every answer below is already computed.</text><rect x="36" y="104" width="748" height="352" rx="14" fill="#211B29" stroke="rgba(213,197,232,.10)" stroke-width="1"/><text x="58" y="135" class="lbl">CODE HEALTH</text><text x="762" y="135" class="kick" text-anchor="end">25 markers · zero LLM · <30s</text><rect x="58" y="150" width="146" height="58" rx="9" fill="#110D17" stroke="rgba(213,197,232,.10)"/><text x="70" y="170" class="chiplbl">Defect risk</text><text x="70" y="197" class="chipval" fill="#F2A03D">7.5<tspan class="chipunit">/10</tspan></text><rect x="214" y="150" width="146" height="58" rx="9" fill="#110D17" stroke="rgba(213,197,232,.10)"/><text x="226" y="170" class="chiplbl">Maintainability</text><text x="226" y="197" class="chipval" fill="#34D399">8.6<tspan class="chipunit">/10</tspan></text><rect x="370" y="150" width="146" height="58" rx="9" fill="#110D17" stroke="rgba(213,197,232,.10)"/><text x="382" y="170" class="chiplbl">Perf risks</text><text x="382" y="197" class="chipval" fill="#A98FC4">268<tspan class="chipunit"></tspan></text><rect x="58" y="220" width="704" height="34" rx="8" fill="rgba(52,211,153,.10)" stroke="rgba(52,211,153,.26)"/><circle cx="76" cy="237" r="4.5" fill="#34D399"/><text x="90" y="242" class="trust">17 of the 20 lowest-health files were bug-fixed in the last 6 months, <tspan font-weight="700">3.63× the 23% baseline</tspan></text><rect x="58" y="266" width="452" height="170" rx="9" fill="#110D17"/><clipPath id="galaxy"><rect x="58" y="266" width="452" height="170" rx="9"/></clipPath><g clip-path="url(#galaxy)"><circle cx="150" cy="346" r="62" fill="rgba(213,197,232,.05)"/><circle cx="140.1" cy="365.8" r="5.4" fill="#8FCB6B" opacity="0.84"/><circle cx="157.6" cy="330.2" r="4.4" fill="#F2A03D" opacity="0.87"/><circle cx="139.0" cy="345.5" r="3.6" fill="#EE8A50" opacity="0.92"/><circle cx="152.5" cy="388.3" r="2.2" fill="#F2A03D" opacity="0.69"/><circle cx="169.2" cy="364.9" r="5.4" fill="#F2A03D" opacity="0.80"/><circle cx="190.4" cy="362.5" r="2.2" fill="#F2A03D" opacity="0.68"/><circle cx="200.6" cy="361.2" r="3.1" fill="#34D399" opacity="0.62"/><circle cx="108.3" cy="335.1" r="4.4" fill="#8FCB6B" opacity="0.69"/><circle cx="168.3" cy="385.4" r="5.4" fill="#34D399" opacity="0.68"/><circle cx="189.4" cy="373.7" r="4.4" fill="#34D399" opacity="0.65"/><circle cx="156.6" cy="307.6" r="3.6" fill="#8FCB6B" opacity="0.72"/><circle cx="150.2" cy="370.2" r="2.6" fill="#8FCB6B" opacity="0.82"/><circle cx="137.5" cy="384.2" r="3.1" fill="#8FCB6B" opacity="0.71"/><circle cx="136.7" cy="400.9" r="2.2" fill="#34D399" opacity="0.59"/><circle cx="100.7" cy="372.4" r="2.2" fill="#34D399" opacity="0.59"/><circle cx="102.1" cy="322.4" r="3.1" fill="#34D399" opacity="0.61"/><circle cx="126.3" cy="378.5" r="3.6" fill="#34D399" opacity="0.71"/><circle cx="142.8" cy="333.9" r="5.4" fill="#F2A03D" opacity="0.90"/><circle cx="118.3" cy="391.4" r="3.1" fill="#34D399" opacity="0.60"/><circle cx="160.3" cy="355.3" r="3.1" fill="#F2A03D" opacity="0.90"/><circle cx="169.8" cy="323.3" r="3.6" fill="#EE8A50" opacity="0.78"/><circle cx="135.6" cy="313.9" r="2.6" fill="#8FCB6B" opacity="0.74"/><circle cx="201.9" cy="349.9" r="2.6" fill="#34D399" opacity="0.62"/><circle cx="186.9" cy="346.9" r="3.1" fill="#8FCB6B" opacity="0.73"/><circle cx="193.9" cy="331.8" r="5.4" fill="#34D399" opacity="0.66"/><circle cx="190.7" cy="316.3" r="5.4" fill="#8FCB6B" opacity="0.63"/><circle cx="121.9" cy="368.5" r="2.2" fill="#8FCB6B" opacity="0.74"/><circle cx="129.8" cy="360.6" r="2.6" fill="#F2A03D" opacity="0.82"/><circle cx="172.2" cy="346.0" r="2.2" fill="#EE8A50" opacity="0.84"/><circle cx="118.4" cy="349.9" r="2.6" fill="#8FCB6B" opacity="0.77"/><circle cx="119.4" cy="382.2" r="2.2" fill="#8FCB6B" opacity="0.66"/><circle cx="178.5" cy="327.5" r="2.6" fill="#8FCB6B" opacity="0.75"/><circle cx="111.6" cy="312.9" r="2.6" fill="#8FCB6B" opacity="0.63"/><circle cx="170.4" cy="301.4" r="2.6" fill="#34D399" opacity="0.64"/><circle cx="101.3" cy="348.2" r="2.2" fill="#8FCB6B" opacity="0.65"/><circle cx="205.6" cy="341.8" r="3.1" fill="#34D399" opacity="0.60"/><circle cx="181.3" cy="369.4" r="3.1" fill="#34D399" opacity="0.72"/><circle cx="160.0" cy="297.6" r="3.6" fill="#8FCB6B" opacity="0.64"/><circle cx="108.4" cy="364.3" r="2.2" fill="#8FCB6B" opacity="0.67"/><circle cx="159.8" cy="363.8" r="2.6" fill="#EE8A50" opacity="0.85"/><circle cx="104.9" cy="356.0" r="4.4" fill="#8FCB6B" opacity="0.66"/><circle cx="99.9" cy="331.7" r="2.2" fill="#8FCB6B" opacity="0.62"/><circle cx="130.0" cy="330.2" r="3.1" fill="#F2A03D" opacity="0.82"/><circle cx="133.2" cy="295.3" r="3.1" fill="#8FCB6B" opacity="0.61"/><circle cx="128.6" cy="318.9" r="3.1" fill="#F2A03D" opacity="0.75"/><circle cx="176.2" cy="340.6" r="2.2" fill="#F2A03D" opacity="0.81"/><circle cx="93.4" cy="350.5" r="2.6" fill="#34D399" opacity="0.59"/><circle cx="120.0" cy="362.2" r="2.2" fill="#F2A03D" opacity="0.75"/><circle cx="120.9" cy="317.3" r="2.2" fill="#34D399" opacity="0.70"/><circle cx="173.8" cy="332.6" r="2.2" fill="#8FCB6B" opacity="0.80"/><circle cx="177.5" cy="308.0" r="3.1" fill="#34D399" opacity="0.66"/><circle cx="149.1" cy="353.3" r="2.2" fill="#E06A5A" opacity="0.95"/><circle cx="143.4" cy="396.7" r="3.1" fill="#34D399" opacity="0.63"/><circle cx="126.6" cy="310.9" r="3.6" fill="#F2A03D" opacity="0.69"/><circle cx="147.2" cy="324.9" r="3.1" fill="#EE8A50" opacity="0.85"/><circle cx="148.4" cy="317.2" r="2.6" fill="#8FCB6B" opacity="0.79"/><circle cx="140.6" cy="352.9" r="2.2" fill="#F2A03D" opacity="0.92"/><circle cx="142.7" cy="306.6" r="3.1" fill="#8FCB6B" opacity="0.71"/><circle cx="150.8" cy="303.0" r="2.2" fill="#F2A03D" opacity="0.69"/><circle cx="183.9" cy="337.2" r="3.6" fill="#8FCB6B" opacity="0.75"/><circle cx="198.2" cy="371.2" r="3.1" fill="#8FCB6B" opacity="0.60"/><circle cx="167.7" cy="399.6" r="3.6" fill="#34D399" opacity="0.59"/><circle cx="95.0" cy="337.6" r="2.6" fill="#34D399" opacity="0.60"/><circle cx="150.2" cy="293.8" r="2.2" fill="#8FCB6B" opacity="0.62"/><circle cx="109.0" cy="379.9" r="2.2" fill="#34D399" opacity="0.61"/><circle cx="123.1" cy="337.7" r="2.6" fill="#8FCB6B" opacity="0.80"/><circle cx="159.3" cy="322.1" r="2.2" fill="#EE8A50" opacity="0.81"/><circle cx="157.4" cy="374.7" r="2.2" fill="#F2A03D" opacity="0.78"/><circle cx="184.6" cy="301.7" r="2.6" fill="#8FCB6B" opacity="0.59"/><circle cx="144.3" cy="377.6" r="2.6" fill="#8FCB6B" opacity="0.77"/><circle cx="130.5" cy="393.8" r="2.6" fill="#34D399" opacity="0.63"/><circle cx="163.8" cy="341.2" r="2.6" fill="#F2A03D" opacity="0.89"/><circle cx="177.0" cy="375.8" r="2.2" fill="#F2A03D" opacity="0.71"/><circle cx="150.2" cy="360.5" r="2.2" fill="#EE8A50" opacity="0.89"/><circle cx="155.7" cy="315.6" r="3.1" fill="#F2A03D" opacity="0.78"/><circle cx="180.6" cy="390.0" r="4.4" fill="#34D399" opacity="0.61"/><circle cx="176.3" cy="357.3" r="2.6" fill="#F2A03D" opacity="0.79"/><circle cx="156.0" cy="396.9" r="5.4" fill="#34D399" opacity="0.63"/><circle cx="153.7" cy="346.9" r="2.6" fill="#E06A5A" opacity="0.97"/><circle cx="135.1" cy="325.0" r="2.2" fill="#EE8A50" opacity="0.81"/><circle cx="119.6" cy="329.8" r="2.6" fill="#8FCB6B" opacity="0.75"/><circle cx="116.4" cy="305.3" r="4.4" fill="#34D399" opacity="0.62"/><circle cx="169.0" cy="374.5" r="2.6" fill="#8FCB6B" opacity="0.75"/><circle cx="141.5" cy="292.6" r="2.2" fill="#8FCB6B" opacity="0.61"/><circle cx="125.9" cy="345.5" r="2.2" fill="#F2A03D" opacity="0.82"/><circle cx="163.4" cy="312.5" r="2.2" fill="#34D399" opacity="0.74"/><circle cx="112.5" cy="321.6" r="2.6" fill="#34D399" opacity="0.68"/><circle cx="199.4" cy="320.9" r="3.1" fill="#34D399" opacity="0.60"/><circle cx="168.4" cy="334.5" r="2.2" fill="#8FCB6B" opacity="0.84"/><circle cx="132.9" cy="339.1" r="3.1" fill="#F2A03D" opacity="0.87"/><circle cx="190.8" cy="356.0" r="2.6" fill="#8FCB6B" opacity="0.69"/><circle cx="149.5" cy="381.2" r="2.2" fill="#34D399" opacity="0.74"/><circle cx="276" cy="328" r="50" fill="rgba(213,197,232,.05)"/><circle cx="250.0" cy="342.6" r="5.4" fill="#F2A03D" opacity="0.73"/><circle cx="262.7" cy="320.7" r="3.1" fill="#EE8A50" opacity="0.86"/><circle cx="307.0" cy="315.7" r="2.6" fill="#F2A03D" opacity="0.70"/><circle cx="303.9" cy="357.4" r="5.4" fill="#34D399" opacity="0.64"/><circle cx="251.5" cy="297.6" r="2.6" fill="#34D399" opacity="0.65"/><circle cx="250.0" cy="361.6" r="3.1" fill="#8FCB6B" opacity="0.62"/><circle cx="258.5" cy="285.9" r="5.4" fill="#34D399" opacity="0.59"/><circle cx="315.1" cy="328.7" r="3.1" fill="#34D399" opacity="0.65"/><circle cx="261.3" cy="306.5" r="3.6" fill="#8FCB6B" opacity="0.77"/><circle cx="290.5" cy="348.7" r="3.6" fill="#8FCB6B" opacity="0.77"/><circle cx="296.6" cy="289.4" r="2.6" fill="#34D399" opacity="0.61"/><circle cx="266.4" cy="362.6" r="4.4" fill="#34D399" opacity="0.68"/><circle cx="280.2" cy="368.3" r="3.1" fill="#8FCB6B" opacity="0.64"/><circle cx="283.5" cy="356.2" r="4.4" fill="#8FCB6B" opacity="0.74"/><circle cx="303.8" cy="305.3" r="2.2" fill="#8FCB6B" opacity="0.68"/><circle cx="313.1" cy="348.0" r="5.4" fill="#8FCB6B" opacity="0.62"/><circle cx="253.7" cy="320.0" r="2.6" fill="#F2A03D" opacity="0.79"/><circle cx="242.1" cy="333.7" r="3.6" fill="#8FCB6B" opacity="0.69"/><circle cx="265.2" cy="297.4" r="3.1" fill="#F2A03D" opacity="0.71"/><circle cx="272.0" cy="322.7" r="2.2" fill="#E06A5A" opacity="0.94"/><circle cx="300.0" cy="317.0" r="2.2" fill="#F2A03D" opacity="0.76"/><circle cx="232.6" cy="332.2" r="2.2" fill="#34D399" opacity="0.61"/><circle cx="261.9" cy="336.3" r="2.2" fill="#EE8A50" opacity="0.85"/><circle cx="234.6" cy="313.3" r="3.1" fill="#34D399" opacity="0.60"/><circle cx="264.4" cy="345.2" r="3.6" fill="#EE8A50" opacity="0.81"/><circle cx="300.0" cy="335.7" r="2.2" fill="#8FCB6B" opacity="0.77"/><circle cx="289.9" cy="299.5" r="5.4" fill="#34D399" opacity="0.71"/><circle cx="279.7" cy="336.0" r="2.2" fill="#E06A5A" opacity="0.92"/><circle cx="288.8" cy="313.0" r="2.2" fill="#F2A03D" opacity="0.82"/><circle cx="307.5" cy="324.2" r="3.6" fill="#8FCB6B" opacity="0.71"/><circle cx="303.4" cy="343.7" r="2.6" fill="#8FCB6B" opacity="0.72"/><circle cx="279.2" cy="343.7" r="3.6" fill="#8FCB6B" opacity="0.86"/><circle cx="271.7" cy="305.8" r="5.4" fill="#F2A03D" opacity="0.80"/><circle cx="285.0" cy="322.5" r="2.2" fill="#F2A03D" opacity="0.90"/><circle cx="239.6" cy="301.5" r="3.6" fill="#34D399" opacity="0.59"/><circle cx="245.3" cy="354.8" r="3.1" fill="#8FCB6B" opacity="0.63"/><circle cx="258.4" cy="359.2" r="2.2" fill="#8FCB6B" opacity="0.68"/><circle cx="298.6" cy="324.6" r="3.6" fill="#F2A03D" opacity="0.79"/><circle cx="275.6" cy="329.8" r="3.1" fill="#EE8A50" opacity="0.98"/><circle cx="243.0" cy="320.7" r="3.6" fill="#F2A03D" opacity="0.70"/><circle cx="288.2" cy="365.9" r="2.6" fill="#34D399" opacity="0.64"/><circle cx="255.3" cy="327.2" r="2.6" fill="#8FCB6B" opacity="0.81"/><circle cx="236.0" cy="348.1" r="4.4" fill="#8FCB6B" opacity="0.60"/><circle cx="317.5" cy="313.7" r="2.2" fill="#8FCB6B" opacity="0.61"/><circle cx="310.7" cy="304.2" r="2.2" fill="#34D399" opacity="0.62"/><circle cx="292.4" cy="334.0" r="2.2" fill="#EE8A50" opacity="0.84"/><circle cx="281.5" cy="310.6" r="2.6" fill="#8FCB6B" opacity="0.84"/><circle cx="273.0" cy="357.4" r="2.6" fill="#34D399" opacity="0.73"/><circle cx="281.0" cy="289.5" r="2.6" fill="#8FCB6B" opacity="0.65"/><circle cx="276.1" cy="316.6" r="2.2" fill="#E06A5A" opacity="0.90"/><circle cx="246.7" cy="307.5" r="2.2" fill="#34D399" opacity="0.68"/><circle cx="312.0" cy="335.9" r="3.1" fill="#F2A03D" opacity="0.67"/><circle cx="232.8" cy="324.8" r="3.6" fill="#34D399" opacity="0.61"/><circle cx="250.9" cy="333.0" r="2.6" fill="#8FCB6B" opacity="0.77"/><circle cx="290.1" cy="319.6" r="2.2" fill="#8FCB6B" opacity="0.85"/><circle cx="257.1" cy="365.8" r="2.6" fill="#8FCB6B" opacity="0.62"/><circle cx="249.7" cy="314.7" r="2.2" fill="#34D399" opacity="0.73"/><circle cx="318.7" cy="340.1" r="2.6" fill="#34D399" opacity="0.60"/><circle cx="272.5" cy="287.9" r="2.2" fill="#8FCB6B" opacity="0.64"/><circle cx="264.0" cy="352.8" r="2.2" fill="#F2A03D" opacity="0.75"/><circle cx="296.0" cy="363.5" r="3.1" fill="#8FCB6B" opacity="0.63"/><circle cx="267.5" cy="333.9" r="2.6" fill="#EE8A50" opacity="0.91"/><circle cx="301.1" cy="295.8" r="3.6" fill="#34D399" opacity="0.63"/><circle cx="319.1" cy="320.1" r="2.6" fill="#8FCB6B" opacity="0.61"/><circle cx="254.5" cy="353.6" r="3.1" fill="#F2A03D" opacity="0.70"/><circle cx="272.2" cy="351.0" r="2.2" fill="#F2A03D" opacity="0.79"/><circle cx="262.2" cy="371.8" r="2.6" fill="#8FCB6B" opacity="0.59"/><circle cx="294.7" cy="307.9" r="2.2" fill="#8FCB6B" opacity="0.75"/><circle cx="288.9" cy="340.6" r="3.1" fill="#F2A03D" opacity="0.84"/><circle cx="376" cy="370" r="44" fill="rgba(213,197,232,.05)"/><circle cx="403.3" cy="359.1" r="3.1" fill="#8FCB6B" opacity="0.70"/><circle cx="411.6" cy="374.0" r="2.2" fill="#34D399" opacity="0.63"/><circle cx="371.8" cy="391.9" r="4.4" fill="#F2A03D" opacity="0.77"/><circle cx="388.9" cy="378.0" r="3.1" fill="#EE8A50" opacity="0.85"/><circle cx="379.6" cy="331.7" r="4.4" fill="#8FCB6B" opacity="0.61"/><circle cx="354.0" cy="402.6" r="5.4" fill="#34D399" opacity="0.60"/><circle cx="387.3" cy="391.1" r="3.6" fill="#8FCB6B" opacity="0.75"/><circle cx="375.2" cy="352.9" r="3.1" fill="#EE8A50" opacity="0.82"/><circle cx="371.5" cy="343.1" r="5.4" fill="#8FCB6B" opacity="0.72"/><circle cx="402.7" cy="388.7" r="2.6" fill="#34D399" opacity="0.67"/><circle cx="381.8" cy="360.5" r="5.4" fill="#EE8A50" opacity="0.89"/><circle cx="384.6" cy="384.3" r="2.2" fill="#F2A03D" opacity="0.83"/><circle cx="396.7" cy="338.4" r="3.6" fill="#34D399" opacity="0.61"/><circle cx="375.1" cy="383.2" r="2.6" fill="#F2A03D" opacity="0.86"/><circle cx="346.4" cy="370.7" r="2.2" fill="#34D399" opacity="0.70"/><circle cx="376.8" cy="400.5" r="2.2" fill="#8FCB6B" opacity="0.69"/><circle cx="363.9" cy="383.4" r="3.6" fill="#F2A03D" opacity="0.82"/><circle cx="395.8" cy="349.3" r="2.2" fill="#34D399" opacity="0.71"/><circle cx="345.6" cy="355.6" r="2.6" fill="#34D399" opacity="0.66"/><circle cx="393.6" cy="402.7" r="2.2" fill="#34D399" opacity="0.62"/><circle cx="366.5" cy="360.6" r="4.4" fill="#EE8A50" opacity="0.86"/><circle cx="397.1" cy="380.4" r="2.2" fill="#34D399" opacity="0.76"/><circle cx="351.2" cy="347.2" r="3.1" fill="#34D399" opacity="0.66"/><circle cx="386.2" cy="344.5" r="2.6" fill="#34D399" opacity="0.72"/><circle cx="353.0" cy="366.3" r="2.2" fill="#F2A03D" opacity="0.76"/><circle cx="359.7" cy="339.1" r="2.6" fill="#34D399" opacity="0.64"/><circle cx="404.3" cy="370.8" r="2.2" fill="#F2A03D" opacity="0.71"/><circle cx="405.3" cy="343.2" r="3.1" fill="#34D399" opacity="0.59"/><circle cx="373.0" cy="372.4" r="2.6" fill="#F2A03D" opacity="0.96"/><circle cx="406.5" cy="382.0" r="3.6" fill="#34D399" opacity="0.67"/><circle cx="394.2" cy="386.9" r="3.1" fill="#F2A03D" opacity="0.75"/><circle cx="337.9" cy="380.1" r="3.6" fill="#34D399" opacity="0.60"/><circle cx="412.6" cy="358.9" r="2.6" fill="#34D399" opacity="0.61"/><circle cx="387.1" cy="404.6" r="2.2" fill="#34D399" opacity="0.63"/><circle cx="348.6" cy="389.1" r="3.1" fill="#34D399" opacity="0.66"/><circle cx="395.5" cy="360.4" r="2.6" fill="#8FCB6B" opacity="0.78"/><circle cx="337.6" cy="369.9" r="2.2" fill="#8FCB6B" opacity="0.61"/><circle cx="388.2" cy="350.4" r="2.2" fill="#8FCB6B" opacity="0.76"/><circle cx="365.3" cy="407.7" r="3.1" fill="#34D399" opacity="0.60"/><circle cx="381.6" cy="407.3" r="2.2" fill="#8FCB6B" opacity="0.61"/><circle cx="363.6" cy="373.6" r="2.2" fill="#EE8A50" opacity="0.87"/><circle cx="414.6" cy="367.7" r="3.1" fill="#34D399" opacity="0.60"/><circle cx="354.6" cy="357.3" r="2.2" fill="#F2A03D" opacity="0.75"/><circle cx="387.7" cy="368.0" r="2.2" fill="#F2A03D" opacity="0.88"/><circle cx="394.3" cy="370.8" r="3.1" fill="#F2A03D" opacity="0.81"/><circle cx="406.0" cy="352.6" r="2.2" fill="#8FCB6B" opacity="0.65"/><circle cx="399.9" cy="396.8" r="3.1" fill="#34D399" opacity="0.63"/><circle cx="380.0" cy="376.5" r="3.1" fill="#EE8A50" opacity="0.92"/><circle cx="370.7" cy="378.8" r="2.2" fill="#E06A5A" opacity="0.90"/><circle cx="364.1" cy="350.8" r="3.1" fill="#8FCB6B" opacity="0.77"/><circle cx="342.3" cy="362.5" r="3.1" fill="#34D399" opacity="0.65"/><circle cx="387.1" cy="334.7" r="2.2" fill="#8FCB6B" opacity="0.62"/><circle cx="367.7" cy="331.3" r="3.1" fill="#34D399" opacity="0.59"/><circle cx="353.7" cy="373.3" r="2.2" fill="#8FCB6B" opacity="0.77"/><circle cx="347.0" cy="377.8" r="2.2" fill="#34D399" opacity="0.69"/><circle cx="361.0" cy="389.9" r="2.2" fill="#F2A03D" opacity="0.75"/><circle cx="383.9" cy="397.7" r="2.2" fill="#F2A03D" opacity="0.71"/><circle cx="364.2" cy="398.2" r="2.2" fill="#8FCB6B" opacity="0.69"/><circle cx="373.8" cy="405.5" r="2.2" fill="#34D399" opacity="0.64"/><circle cx="450" cy="318" r="32" fill="rgba(213,197,232,.05)"/><circle cx="472.5" cy="330.2" r="2.2" fill="#34D399" opacity="0.64"/><circle cx="463.4" cy="312.4" r="2.6" fill="#8FCB6B" opacity="0.80"/><circle cx="424.1" cy="329.8" r="2.2" fill="#34D399" opacity="0.60"/><circle cx="439.2" cy="323.2" r="2.2" fill="#F2A03D" opacity="0.83"/><circle cx="475.2" cy="316.4" r="5.4" fill="#34D399" opacity="0.65"/><circle cx="445.0" cy="313.0" r="4.4" fill="#F2A03D" opacity="0.90"/><circle cx="445.6" cy="297.4" r="2.6" fill="#34D399" opacity="0.70"/><circle cx="453.8" cy="332.5" r="3.6" fill="#8FCB6B" opacity="0.79"/><circle cx="447.2" cy="323.0" r="3.6" fill="#EE8A50" opacity="0.92"/><circle cx="462.1" cy="322.5" r="3.1" fill="#EE8A50" opacity="0.82"/><circle cx="431.8" cy="310.4" r="2.2" fill="#F2A03D" opacity="0.72"/><circle cx="458.0" cy="299.4" r="2.6" fill="#34D399" opacity="0.72"/><circle cx="455.2" cy="346.2" r="3.1" fill="#34D399" opacity="0.60"/><circle cx="455.5" cy="307.5" r="3.6" fill="#F2A03D" opacity="0.83"/><circle cx="441.9" cy="305.4" r="2.2" fill="#8FCB6B" opacity="0.79"/><circle cx="432.4" cy="334.4" r="2.2" fill="#34D399" opacity="0.66"/><circle cx="433.0" cy="319.8" r="3.1" fill="#8FCB6B" opacity="0.76"/><circle cx="422.7" cy="307.4" r="4.4" fill="#34D399" opacity="0.59"/><circle cx="425.0" cy="320.8" r="2.6" fill="#8FCB6B" opacity="0.65"/><circle cx="466.1" cy="299.1" r="3.6" fill="#34D399" opacity="0.65"/><circle cx="450.7" cy="292.8" r="2.6" fill="#8FCB6B" opacity="0.65"/><circle cx="436.7" cy="341.7" r="2.2" fill="#34D399" opacity="0.62"/><circle cx="436.0" cy="329.6" r="2.2" fill="#F2A03D" opacity="0.75"/><circle cx="453.1" cy="316.1" r="2.6" fill="#F2A03D" opacity="0.95"/><circle cx="431.6" cy="299.6" r="3.6" fill="#34D399" opacity="0.63"/><circle cx="442.1" cy="332.9" r="2.2" fill="#8FCB6B" opacity="0.76"/><circle cx="448.7" cy="341.6" r="2.6" fill="#8FCB6B" opacity="0.67"/><circle cx="465.9" cy="339.2" r="2.2" fill="#34D399" opacity="0.63"/><circle cx="462.2" cy="331.2" r="2.2" fill="#34D399" opacity="0.75"/><circle cx="474.2" cy="303.1" r="2.6" fill="#34D399" opacity="0.60"/><circle cx="450.5" cy="302.5" r="2.2" fill="#F2A03D" opacity="0.78"/><circle cx="443.4" cy="346.2" r="3.1" fill="#34D399" opacity="0.59"/><circle cx="438.7" cy="292.6" r="2.6" fill="#34D399" opacity="0.61"/><circle cx="467.6" cy="327.1" r="2.2" fill="#F2A03D" opacity="0.72"/><circle cx="461.7" cy="291.2" r="3.6" fill="#34D399" opacity="0.59"/><circle cx="459.5" cy="340.9" r="2.2" fill="#34D399" opacity="0.65"/><circle cx="420.8" cy="315.7" r="2.6" fill="#34D399" opacity="0.59"/><circle cx="469.2" cy="308.4" r="3.1" fill="#F2A03D" opacity="0.70"/><circle cx="208" cy="406" r="30" fill="rgba(213,197,232,.05)"/><circle cx="215.5" cy="430.4" r="3.6" fill="#34D399" opacity="0.62"/><circle cx="194.3" cy="402.3" r="2.2" fill="#EE8A50" opacity="0.79"/><circle cx="230.9" cy="399.5" r="4.4" fill="#34D399" opacity="0.64"/><circle cx="206.4" cy="403.2" r="5.4" fill="#E06A5A" opacity="0.95"/><circle cx="226.9" cy="421.4" r="3.6" fill="#8FCB6B" opacity="0.63"/><circle cx="220.2" cy="385.5" r="3.1" fill="#8FCB6B" opacity="0.64"/><circle cx="194.7" cy="393.1" r="4.4" fill="#34D399" opacity="0.72"/><circle cx="187.7" cy="410.6" r="4.4" fill="#8FCB6B" opacity="0.69"/><circle cx="201.9" cy="431.3" r="2.2" fill="#34D399" opacity="0.61"/><circle cx="188.1" cy="422.5" r="4.4" fill="#8FCB6B" opacity="0.61"/><circle cx="219.4" cy="416.8" r="2.2" fill="#F2A03D" opacity="0.76"/><circle cx="200.7" cy="420.4" r="2.2" fill="#8FCB6B" opacity="0.76"/><circle cx="212.8" cy="420.4" r="2.2" fill="#F2A03D" opacity="0.77"/><circle cx="201.7" cy="411.5" r="2.2" fill="#F2A03D" opacity="0.87"/><circle cx="218.4" cy="401.3" r="3.1" fill="#EE8A50" opacity="0.83"/><circle cx="206.6" cy="386.7" r="2.2" fill="#8FCB6B" opacity="0.71"/><circle cx="211.4" cy="394.7" r="2.6" fill="#EE8A50" opacity="0.82"/><circle cx="182.8" cy="402.1" r="2.6" fill="#34D399" opacity="0.62"/><circle cx="212.6" cy="412.1" r="3.1" fill="#EE8A50" opacity="0.89"/><circle cx="232.5" cy="416.4" r="2.2" fill="#34D399" opacity="0.60"/><circle cx="221.5" cy="393.6" r="3.1" fill="#8FCB6B" opacity="0.73"/><circle cx="199.4" cy="384.2" r="2.6" fill="#34D399" opacity="0.65"/><circle cx="208.0" cy="428.0" r="2.6" fill="#8FCB6B" opacity="0.67"/><circle cx="211.8" cy="379.2" r="4.4" fill="#34D399" opacity="0.59"/><circle cx="206.9" cy="420.1" r="2.2" fill="#8FCB6B" opacity="0.79"/><circle cx="229.8" cy="390.6" r="2.6" fill="#34D399" opacity="0.60"/><circle cx="195.7" cy="415.7" r="2.6" fill="#8FCB6B" opacity="0.77"/><circle cx="228.3" cy="408.5" r="3.1" fill="#F2A03D" opacity="0.69"/><circle cx="189.0" cy="387.5" r="2.2" fill="#34D399" opacity="0.60"/></g><text x="70" y="424" class="cap">2,802 files scored</text><text x="526" y="280" class="cap">OPEN FINDINGS</text><rect x="526" y="300" width="236" height="24" rx="6" fill="#110D17"/><rect x="526" y="300" width="3" height="24" rx="1.5" fill="#E06A5A"/><text x="539" y="316" class="find">CHANGE ENTROPY</text><text x="752" y="316" class="find" fill="#E06A5A" text-anchor="end" font-weight="700">−3.0</text><rect x="526" y="328" width="236" height="24" rx="6" fill="#110D17"/><rect x="526" y="328" width="3" height="24" rx="1.5" fill="#E06A5A"/><text x="539" y="344" class="find">NESTED COMPLEXITY</text><text x="752" y="344" class="find" fill="#E06A5A" text-anchor="end" font-weight="700">−2.4</text><rect x="526" y="356" width="236" height="24" rx="6" fill="#110D17"/><rect x="526" y="356" width="3" height="24" rx="1.5" fill="#F2A03D"/><text x="539" y="372" class="find">CHURN RISK</text><text x="752" y="372" class="find" fill="#F2A03D" text-anchor="end" font-weight="700">−1.8</text><rect x="526" y="384" width="236" height="24" rx="6" fill="#110D17"/><rect x="526" y="384" width="3" height="24" rx="1.5" fill="#F2A03D"/><text x="539" y="400" class="find">CO-CHANGE SCATTER</text><text x="752" y="400" class="find" fill="#F2A03D" text-anchor="end" font-weight="700">−1.5</text><rect x="526" y="412" width="236" height="24" rx="6" fill="#110D17"/><rect x="526" y="412" width="3" height="24" rx="1.5" fill="#F2A03D"/><text x="539" y="428" class="find">UNTESTED HOTSPOT</text><text x="752" y="428" class="find" fill="#F2A03D" text-anchor="end" font-weight="700">−1.2</text><rect x="802" y="104" width="380" height="352" rx="14" fill="#211B29" stroke="rgba(213,197,232,.10)" stroke-width="1"/><text x="824" y="135" class="lbl">DEPENDENCY GRAPH</text><text x="1160" y="135" class="kick" text-anchor="end">16 languages</text><rect x="820" y="150" width="344" height="240" rx="9" fill="#110D17"/><clipPath id="gclip"><rect x="820" y="150" width="344" height="240" rx="9"/></clipPath><g clip-path="url(#gclip)"><line x1="944.0" y1="201.8" x2="912" y2="224" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="907.3" y1="185.9" x2="912" y2="224" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="913.1" y1="193.3" x2="912" y2="224" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="948.1" y1="258.8" x2="912" y2="224" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="901.9" y1="182.8" x2="912" y2="224" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="895.4" y1="193.7" x2="912" y2="224" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="888.8" y1="197.7" x2="912" y2="224" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="929.0" y1="238.4" x2="912" y2="224" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="951.9" y1="214.2" x2="912" y2="224" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="1040.2" y1="228.2" x2="1052" y2="212" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="1048.4" y1="190.3" x2="1052" y2="212" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="1068.5" y1="249.3" x2="1052" y2="212" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="1013.8" y1="237.1" x2="1052" y2="212" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="1009.6" y1="237.8" x2="1052" y2="212" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="1065.3" y1="185.2" x2="1052" y2="212" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="1017.4" y1="194.6" x2="1052" y2="212" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="1107.4" y1="209.0" x2="1052" y2="212" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="1061.0" y1="174.5" x2="1052" y2="212" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="944.8" y1="323.3" x2="982" y2="322" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="955.1" y1="338.1" x2="982" y2="322" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="1001.7" y1="341.5" x2="982" y2="322" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="1022.9" y1="322.0" x2="982" y2="322" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="961.2" y1="356.5" x2="982" y2="322" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="942.1" y1="301.8" x2="982" y2="322" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="943.8" y1="346.7" x2="982" y2="322" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="983.8" y1="296.5" x2="982" y2="322" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="949.1" y1="320.7" x2="982" y2="322" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="1131.2" y1="323.1" x2="1098" y2="310" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="1085.5" y1="327.7" x2="1098" y2="310" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="1106.7" y1="286.0" x2="1098" y2="310" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="1152.2" y1="302.0" x2="1098" y2="310" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="1068.9" y1="335.5" x2="1098" y2="310" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="1148.6" y1="288.2" x2="1098" y2="310" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="1064.8" y1="323.3" x2="1098" y2="310" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="1046.2" y1="319.4" x2="1098" y2="310" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="1137.2" y1="290.0" x2="1098" y2="310" stroke="rgba(213,197,232,.15)" stroke-width="1"/><line x1="912" y1="224" x2="1052" y2="212" stroke="rgba(213,197,232,.30)" stroke-width="1.6"/><line x1="912" y1="224" x2="982" y2="322" stroke="rgba(213,197,232,.30)" stroke-width="1.6"/><line x1="912" y1="224" x2="1098" y2="310" stroke="rgba(213,197,232,.30)" stroke-width="1.6"/><line x1="1052" y1="212" x2="982" y2="322" stroke="rgba(213,197,232,.30)" stroke-width="1.6"/><line x1="982" y1="322" x2="1098" y2="310" stroke="rgba(213,197,232,.30)" stroke-width="1.6"/><circle cx="912.0" cy="224.0" r="9.0" fill="#F59520" stroke="#211B29" stroke-width="1.5"/><circle cx="944.0" cy="201.8" r="4.0" fill="#C97A1A"/><circle cx="907.3" cy="185.9" r="3.3" fill="#C97A1A"/><circle cx="913.1" cy="193.3" r="2.8" fill="#C97A1A"/><circle cx="948.1" cy="258.8" r="3.8" fill="#C97A1A"/><circle cx="901.9" cy="182.8" r="3.1" fill="#C97A1A"/><circle cx="895.4" cy="193.7" r="3.4" fill="#C97A1A"/><circle cx="888.8" cy="197.7" r="3.3" fill="#C97A1A"/><circle cx="929.0" cy="238.4" r="3.8" fill="#C97A1A"/><circle cx="951.9" cy="214.2" r="3.6" fill="#C97A1A"/><circle cx="1052.0" cy="212.0" r="9.0" fill="#A98FC4" stroke="#211B29" stroke-width="1.5"/><circle cx="1040.2" cy="228.2" r="3.4" fill="#7D659C"/><circle cx="1048.4" cy="190.3" r="3.5" fill="#7D659C"/><circle cx="1068.5" cy="249.3" r="3.5" fill="#7D659C"/><circle cx="1013.8" cy="237.1" r="3.7" fill="#7D659C"/><circle cx="1009.6" cy="237.8" r="3.8" fill="#7D659C"/><circle cx="1065.3" cy="185.2" r="4.1" fill="#7D659C"/><circle cx="1017.4" cy="194.6" r="4.2" fill="#7D659C"/><circle cx="1107.4" cy="209.0" r="3.7" fill="#7D659C"/><circle cx="1061.0" cy="174.5" r="3.3" fill="#7D659C"/><circle cx="982.0" cy="322.0" r="9.0" fill="#E06A5A" stroke="#211B29" stroke-width="1.5"/><circle cx="944.8" cy="323.3" r="4.2" fill="#B04C3E"/><circle cx="955.1" cy="338.1" r="4.0" fill="#B04C3E"/><circle cx="1001.7" cy="341.5" r="3.2" fill="#B04C3E"/><circle cx="1022.9" cy="322.0" r="3.0" fill="#B04C3E"/><circle cx="961.2" cy="356.5" r="4.0" fill="#B04C3E"/><circle cx="942.1" cy="301.8" r="3.5" fill="#B04C3E"/><circle cx="943.8" cy="346.7" r="3.7" fill="#B04C3E"/><circle cx="983.8" cy="296.5" r="2.9" fill="#B04C3E"/><circle cx="949.1" cy="320.7" r="2.6" fill="#B04C3E"/><circle cx="1098.0" cy="310.0" r="9.0" fill="#A9BB6F" stroke="#211B29" stroke-width="1.5"/><circle cx="1131.2" cy="323.1" r="3.2" fill="#7E8F4E"/><circle cx="1085.5" cy="327.7" r="4.3" fill="#7E8F4E"/><circle cx="1106.7" cy="286.0" r="2.9" fill="#7E8F4E"/><circle cx="1152.2" cy="302.0" r="3.9" fill="#7E8F4E"/><circle cx="1068.9" cy="335.5" r="2.8" fill="#7E8F4E"/><circle cx="1148.6" cy="288.2" r="4.2" fill="#7E8F4E"/><circle cx="1064.8" cy="323.3" r="3.6" fill="#7E8F4E"/><circle cx="1046.2" cy="319.4" r="4.0" fill="#7E8F4E"/><circle cx="1137.2" cy="290.0" r="2.9" fill="#7E8F4E"/></g><text x="832" y="380" class="cap">28,126 nodes · 11 communities</text><text x="824" y="414" class="out">Who calls this? What breaks if</text><text x="824" y="434" class="out">I change it?</text><rect x="1200" y="104" width="364" height="352" rx="14" fill="#211B29" stroke="rgba(213,197,232,.10)" stroke-width="1"/><text x="1222" y="135" class="lbl">GIT HISTORY</text><text x="1542" y="135" class="kick" text-anchor="end">1,050 commits</text><rect x="1218" y="150" width="328" height="240" rx="9" fill="#110D17"/><rect x="1230.0" y="312.2" width="16.0" height="13.8" rx="2.5" fill="#34D399" opacity="0.82"/><rect x="1249.0" y="300.7" width="16.0" height="25.3" rx="2.5" fill="#34D399" opacity="0.82"/><rect x="1268.0" y="282.3" width="16.0" height="43.7" rx="2.5" fill="#34D399" opacity="0.82"/><rect x="1287.0" y="261.6" width="16.0" height="64.4" rx="2.5" fill="#34D399" opacity="0.82"/><rect x="1306.0" y="231.7" width="16.0" height="94.3" rx="2.5" fill="#34D399" opacity="0.82"/><rect x="1325.0" y="206.4" width="16.0" height="119.6" rx="2.5" fill="#34D399" opacity="0.82"/><rect x="1344.0" y="181.1" width="16.0" height="144.9" rx="2.5" fill="#F2A03D" opacity="0.82"/><rect x="1363.0" y="192.6" width="16.0" height="133.4" rx="2.5" fill="#F2A03D" opacity="0.82"/><rect x="1382.0" y="217.9" width="16.0" height="108.1" rx="2.5" fill="#F2A03D" opacity="0.82"/><rect x="1401.0" y="243.2" width="16.0" height="82.8" rx="2.5" fill="#F2A03D" opacity="0.82"/><rect x="1420.0" y="263.9" width="16.0" height="62.1" rx="2.5" fill="#F2A03D" opacity="0.82"/><rect x="1439.0" y="282.3" width="16.0" height="43.7" rx="2.5" fill="#E06A5A" opacity="0.82"/><rect x="1458.0" y="296.1" width="16.0" height="29.9" rx="2.5" fill="#E06A5A" opacity="0.82"/><rect x="1477.0" y="305.3" width="16.0" height="20.7" rx="2.5" fill="#E06A5A" opacity="0.82"/><rect x="1496.0" y="312.2" width="16.0" height="13.8" rx="2.5" fill="#E06A5A" opacity="0.82"/><rect x="1515.0" y="316.8" width="16.0" height="9.2" rx="2.5" fill="#E06A5A" opacity="0.82"/><line x1="1230" y1="327" x2="1534" y2="327" stroke="rgba(213,197,232,.20)"/><text x="1230" y="348" class="cap">low risk</text><text x="1534" y="348" class="cap" text-anchor="end">high risk</text><text x="1230" y="176" class="cap">CHANGE-RISK DISTRIBUTION</text><text x="1230" y="380" class="cap">hotspots · ownership · co-change · bus factor</text><text x="1222" y="414" class="out">Which of these 40 files is</text><text x="1222" y="434" class="out">actually dangerous?</text><rect x="36" y="474" width="496" height="302" rx="14" fill="#211B29" stroke="rgba(213,197,232,.10)" stroke-width="1"/><text x="58" y="505" class="lbl">GENERATED DOCS</text><text x="510" y="505" class="kick" text-anchor="end">1,274 pages</text><rect x="54" y="520" width="460" height="176" rx="9" fill="#110D17"/><rect x="70" y="536" width="265" height="11" rx="3" fill="#A98FC4" opacity=".85"/><rect x="70" y="562" width="394" height="6" rx="3" fill="rgba(213,197,232,.24)"/><rect x="70" y="578" width="368" height="6" rx="3" fill="rgba(213,197,232,.24)"/><rect x="70" y="594" width="304" height="6" rx="3" fill="rgba(213,197,232,.24)"/><rect x="70" y="607" width="188" height="9" rx="3" fill="#F59520" opacity=".55"/><rect x="70" y="630" width="377" height="6" rx="3" fill="rgba(213,197,232,.24)"/><rect x="70" y="646" width="338" height="6" rx="3" fill="rgba(213,197,232,.24)"/><rect x="70" y="662" width="235" height="6" rx="3" fill="rgba(213,197,232,.24)"/><rect x="416" y="530" width="86" height="20" rx="10" fill="rgba(52,211,153,.14)"/><text x="459" y="544" class="pill" fill="#34D399" text-anchor="middle">fresh · v6</text><text x="58" y="730" class="out">Why does auth work this way?</text><text x="58" y="751" class="outsub">Answered from the wiki, not from 12 file reads.</text><rect x="550" y="474" width="496" height="302" rx="14" fill="#211B29" stroke="rgba(213,197,232,.10)" stroke-width="1"/><text x="572" y="505" class="lbl">ARCHITECTURAL DECISIONS</text><text x="1024" y="505" class="kick" text-anchor="end">mined from 8 sources</text><rect x="568" y="520" width="460" height="176" rx="9" fill="#110D17"/><text x="584" y="548" class="dec">Rebuild the KG skeleton only when the</text><text x="584" y="568" class="dec">graph fingerprint changes</text><rect x="584" y="582" width="392" height="1" fill="rgba(213,197,232,.15)"/><rect x="584" y="596" width="101" height="21" rx="10.5" fill="#211B29" stroke="rgba(213,197,232,.18)"/><text x="635" y="610" class="pill" fill="#34D399" text-anchor="middle">Verified quote</text><rect x="693.4" y="596" width="108" height="21" rx="10.5" fill="#211B29" stroke="rgba(213,197,232,.18)"/><text x="747" y="610" class="pill" fill="#A98FC4" text-anchor="middle">supersedes #418</text><rect x="809.4" y="596" width="115" height="21" rx="10.5" fill="#211B29" stroke="rgba(213,197,232,.18)"/><text x="867" y="610" class="pill" fill="#F59520" text-anchor="middle">governs 24 files</text><text x="584" y="660" class="cap">Delivered back at session start, and the moment</text><text x="584" y="676" class="cap">your agent edits a file the decision governs.</text><text x="572" y="730" class="out">Don’t re-litigate what we settled.</text><text x="572" y="751" class="outsub">Captured nowhere else.</text><rect x="1064" y="474" width="500" height="302" rx="14" fill="#211B29" stroke="rgba(213,197,232,.10)" stroke-width="1"/><text x="1086" y="505" class="lbl">SERVED TO YOUR AGENT</text><text x="1542" y="505" class="kick" text-anchor="end">10 MCP tools</text><rect x="1084" y="528" width="95" height="24" rx="6" fill="#110D17" stroke="rgba(213,197,232,.10)"/><text x="1131" y="544" class="mono" text-anchor="middle">get_overview</text><rect x="1187" y="528" width="81" height="24" rx="6" fill="#110D17" stroke="rgba(213,197,232,.10)"/><text x="1227" y="544" class="mono" text-anchor="middle">get_answer</text><rect x="1276" y="528" width="88" height="24" rx="6" fill="#110D17" stroke="rgba(213,197,232,.10)"/><text x="1320" y="544" class="mono" text-anchor="middle">get_context</text><rect x="1372" y="528" width="81" height="24" rx="6" fill="#110D17" stroke="rgba(213,197,232,.10)"/><text x="1412" y="544" class="mono" text-anchor="middle">get_symbol</text><rect x="1084" y="558" width="116" height="24" rx="6" fill="#110D17" stroke="rgba(213,197,232,.10)"/><text x="1142" y="574" class="mono" text-anchor="middle">search_codebase</text><rect x="1208" y="558" width="67" height="24" rx="6" fill="#110D17" stroke="rgba(213,197,232,.10)"/><text x="1241" y="574" class="mono" text-anchor="middle">get_risk</text><rect x="1283" y="558" width="116" height="24" rx="6" fill="#110D17" stroke="rgba(213,197,232,.10)"/><text x="1340" y="574" class="mono" text-anchor="middle">get_change_risk</text><rect x="1406" y="558" width="60" height="24" rx="6" fill="#110D17" stroke="rgba(213,197,232,.10)"/><text x="1436" y="574" class="mono" text-anchor="middle">get_why</text><rect x="1084" y="588" width="102" height="24" rx="6" fill="#110D17" stroke="rgba(213,197,232,.10)"/><text x="1135" y="604" class="mono" text-anchor="middle">get_dead_code</text><rect x="1194" y="588" width="81" height="24" rx="6" fill="#110D17" stroke="rgba(213,197,232,.10)"/><text x="1234" y="604" class="mono" text-anchor="middle">get_health</text><text x="1084" y="636" class="cap">Every response carries index age, indexed commit, and a staleness warning.</text><rect x="1084" y="650" width="460" height="46" rx="9" fill="rgba(245,149,32,.12)" stroke="rgba(245,149,32,.32)"/><text x="1098" y="670" class="chipval" fill="#F59520" font-size="19">−96%<tspan class="chipunit" fill="#A79DB3"> context tokens</tspan></text><text x="1098" y="688" class="cap">−70% tool calls · −89% file reads · fewer round-trips per answer</text><text x="1086" y="730" class="out">Claude Code, Codex, Cursor, VS Code.</text><text x="1086" y="751" class="outsub">Plus hooks, so it arrives unasked.</text></svg>\ No newline at end of filediff --git a/.github/assets/one-index.svg b/.github/assets/one-index.svgnew file mode 100644index 000000000..ac3c4204c--- /dev/null+++ b/.github/assets/one-index.svg@@ -0,0 +1,18 @@+<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="812" viewBox="0 0 1600 812" role="img" aria-label="repowise: one index producing code health, a dependency graph, git history, generated docs, architectural decisions, and ten MCP tools"><style>+ text { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif; }+ .h1 { font-size: 30px; font-weight: 700; fill: #241B2C; letter-spacing: -.4px; }+ .sub { font-size: 15px; fill: #5E5360; }+ .lbl { font-size: 11.5px; font-weight: 700; fill: #241B2C; letter-spacing: 1.1px; }+ .kick { font-size: 11.5px; fill: #8C7F88; letter-spacing: .3px; }+ .cap { font-size: 11px; fill: #8C7F88; letter-spacing: .3px; }+ .out { font-size: 15.5px; font-weight: 650; fill: #241B2C; }+ .outsub { font-size: 12.5px; fill: #5E5360; }+ .chiplbl { font-size: 10.5px; fill: #5E5360; letter-spacing: .5px; text-transform: uppercase; }+ .chipval { font-size: 24px; font-weight: 700; }+ .chipunit { font-size: 13px; font-weight: 500; fill: #8C7F88; }+ .trust { font-size: 12.5px; fill: #241B2C; }+ .find { font-size: 10.5px; fill: #5E5360; letter-spacing: .4px; }+ .dec { font-size: 14px; font-weight: 600; fill: #241B2C; }+ .pill { font-size: 10.5px; font-weight: 600; }+ .mono { font-size: 11.5px; fill: #5E5360; font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; }+</style><rect width="1600" height="812" fill="#FBF6F1"/><text x="36" y="50" class="h1">One index. Everything your agent and your team keep asking for.</text><text x="36" y="80" class="sub">Index once, in seconds, no LLM required. Every answer below is already computed.</text><rect x="36" y="104" width="748" height="352" rx="14" fill="#FFFFFF" stroke="rgba(88,67,108,.12)" stroke-width="1"/><text x="58" y="135" class="lbl">CODE HEALTH</text><text x="762" y="135" class="kick" text-anchor="end">25 markers · zero LLM · <30s</text><rect x="58" y="150" width="146" height="58" rx="9" fill="#F4EAE1" stroke="rgba(88,67,108,.12)"/><text x="70" y="170" class="chiplbl">Defect risk</text><text x="70" y="197" class="chipval" fill="#9A6614">7.5<tspan class="chipunit">/10</tspan></text><rect x="214" y="150" width="146" height="58" rx="9" fill="#F4EAE1" stroke="rgba(88,67,108,.12)"/><text x="226" y="170" class="chiplbl">Maintainability</text><text x="226" y="197" class="chipval" fill="#1D8155">8.6<tspan class="chipunit">/10</tspan></text><rect x="370" y="150" width="146" height="58" rx="9" fill="#F4EAE1" stroke="rgba(88,67,108,.12)"/><text x="382" y="170" class="chiplbl">Perf risks</text><text x="382" y="197" class="chipval" fill="#58436C">268<tspan class="chipunit"></tspan></text><rect x="58" y="220" width="704" height="34" rx="8" fill="rgba(29,129,85,.09)" stroke="rgba(29,129,85,.22)"/><circle cx="76" cy="237" r="4.5" fill="#1D8155"/><text x="90" y="242" class="trust">17 of the 20 lowest-health files were bug-fixed in the last 6 months, <tspan font-weight="700">3.63× the 23% baseline</tspan></text><rect x="58" y="266" width="452" height="170" rx="9" fill="#F4EAE1"/><clipPath id="galaxy"><rect x="58" y="266" width="452" height="170" rx="9"/></clipPath><g clip-path="url(#galaxy)"><circle cx="150" cy="346" r="62" fill="rgba(88,67,108,.05)"/><circle cx="140.1" cy="365.8" r="5.4" fill="#6B9A3D" opacity="0.84"/><circle cx="157.6" cy="330.2" r="4.4" fill="#9A6614" opacity="0.87"/><circle cx="139.0" cy="345.5" r="3.6" fill="#C4762A" opacity="0.92"/><circle cx="152.5" cy="388.3" r="2.2" fill="#9A6614" opacity="0.69"/><circle cx="169.2" cy="364.9" r="5.4" fill="#9A6614" opacity="0.80"/><circle cx="190.4" cy="362.5" r="2.2" fill="#9A6614" opacity="0.68"/><circle cx="200.6" cy="361.2" r="3.1" fill="#1D8155" opacity="0.62"/><circle cx="108.3" cy="335.1" r="4.4" fill="#6B9A3D" opacity="0.69"/><circle cx="168.3" cy="385.4" r="5.4" fill="#1D8155" opacity="0.68"/><circle cx="189.4" cy="373.7" r="4.4" fill="#1D8155" opacity="0.65"/><circle cx="156.6" cy="307.6" r="3.6" fill="#6B9A3D" opacity="0.72"/><circle cx="150.2" cy="370.2" r="2.6" fill="#6B9A3D" opacity="0.82"/><circle cx="137.5" cy="384.2" r="3.1" fill="#6B9A3D" opacity="0.71"/><circle cx="136.7" cy="400.9" r="2.2" fill="#1D8155" opacity="0.59"/><circle cx="100.7" cy="372.4" r="2.2" fill="#1D8155" opacity="0.59"/><circle cx="102.1" cy="322.4" r="3.1" fill="#1D8155" opacity="0.61"/><circle cx="126.3" cy="378.5" r="3.6" fill="#1D8155" opacity="0.71"/><circle cx="142.8" cy="333.9" r="5.4" fill="#9A6614" opacity="0.90"/><circle cx="118.3" cy="391.4" r="3.1" fill="#1D8155" opacity="0.60"/><circle cx="160.3" cy="355.3" r="3.1" fill="#9A6614" opacity="0.90"/><circle cx="169.8" cy="323.3" r="3.6" fill="#C4762A" opacity="0.78"/><circle cx="135.6" cy="313.9" r="2.6" fill="#6B9A3D" opacity="0.74"/><circle cx="201.9" cy="349.9" r="2.6" fill="#1D8155" opacity="0.62"/><circle cx="186.9" cy="346.9" r="3.1" fill="#6B9A3D" opacity="0.73"/><circle cx="193.9" cy="331.8" r="5.4" fill="#1D8155" opacity="0.66"/><circle cx="190.7" cy="316.3" r="5.4" fill="#6B9A3D" opacity="0.63"/><circle cx="121.9" cy="368.5" r="2.2" fill="#6B9A3D" opacity="0.74"/><circle cx="129.8" cy="360.6" r="2.6" fill="#9A6614" opacity="0.82"/><circle cx="172.2" cy="346.0" r="2.2" fill="#C4762A" opacity="0.84"/><circle cx="118.4" cy="349.9" r="2.6" fill="#6B9A3D" opacity="0.77"/><circle cx="119.4" cy="382.2" r="2.2" fill="#6B9A3D" opacity="0.66"/><circle cx="178.5" cy="327.5" r="2.6" fill="#6B9A3D" opacity="0.75"/><circle cx="111.6" cy="312.9" r="2.6" fill="#6B9A3D" opacity="0.63"/><circle cx="170.4" cy="301.4" r="2.6" fill="#1D8155" opacity="0.64"/><circle cx="101.3" cy="348.2" r="2.2" fill="#6B9A3D" opacity="0.65"/><circle cx="205.6" cy="341.8" r="3.1" fill="#1D8155" opacity="0.60"/><circle cx="181.3" cy="369.4" r="3.1" fill="#1D8155" opacity="0.72"/><circle cx="160.0" cy="297.6" r="3.6" fill="#6B9A3D" opacity="0.64"/><circle cx="108.4" cy="364.3" r="2.2" fill="#6B9A3D" opacity="0.67"/><circle cx="159.8" cy="363.8" r="2.6" fill="#C4762A" opacity="0.85"/><circle cx="104.9" cy="356.0" r="4.4" fill="#6B9A3D" opacity="0.66"/><circle cx="99.9" cy="331.7" r="2.2" fill="#6B9A3D" opacity="0.62"/><circle cx="130.0" cy="330.2" r="3.1" fill="#9A6614" opacity="0.82"/><circle cx="133.2" cy="295.3" r="3.1" fill="#6B9A3D" opacity="0.61"/><circle cx="128.6" cy="318.9" r="3.1" fill="#9A6614" opacity="0.75"/><circle cx="176.2" cy="340.6" r="2.2" fill="#9A6614" opacity="0.81"/><circle cx="93.4" cy="350.5" r="2.6" fill="#1D8155" opacity="0.59"/><circle cx="120.0" cy="362.2" r="2.2" fill="#9A6614" opacity="0.75"/><circle cx="120.9" cy="317.3" r="2.2" fill="#1D8155" opacity="0.70"/><circle cx="173.8" cy="332.6" r="2.2" fill="#6B9A3D" opacity="0.80"/><circle cx="177.5" cy="308.0" r="3.1" fill="#1D8155" opacity="0.66"/><circle cx="149.1" cy="353.3" r="2.2" fill="#B23A2E" opacity="0.95"/><circle cx="143.4" cy="396.7" r="3.1" fill="#1D8155" opacity="0.63"/><circle cx="126.6" cy="310.9" r="3.6" fill="#9A6614" opacity="0.69"/><circle cx="147.2" cy="324.9" r="3.1" fill="#C4762A" opacity="0.85"/><circle cx="148.4" cy="317.2" r="2.6" fill="#6B9A3D" opacity="0.79"/><circle cx="140.6" cy="352.9" r="2.2" fill="#9A6614" opacity="0.92"/><circle cx="142.7" cy="306.6" r="3.1" fill="#6B9A3D" opacity="0.71"/><circle cx="150.8" cy="303.0" r="2.2" fill="#9A6614" opacity="0.69"/><circle cx="183.9" cy="337.2" r="3.6" fill="#6B9A3D" opacity="0.75"/><circle cx="198.2" cy="371.2" r="3.1" fill="#6B9A3D" opacity="0.60"/><circle cx="167.7" cy="399.6" r="3.6" fill="#1D8155" opacity="0.59"/><circle cx="95.0" cy="337.6" r="2.6" fill="#1D8155" opacity="0.60"/><circle cx="150.2" cy="293.8" r="2.2" fill="#6B9A3D" opacity="0.62"/><circle cx="109.0" cy="379.9" r="2.2" fill="#1D8155" opacity="0.61"/><circle cx="123.1" cy="337.7" r="2.6" fill="#6B9A3D" opacity="0.80"/><circle cx="159.3" cy="322.1" r="2.2" fill="#C4762A" opacity="0.81"/><circle cx="157.4" cy="374.7" r="2.2" fill="#9A6614" opacity="0.78"/><circle cx="184.6" cy="301.7" r="2.6" fill="#6B9A3D" opacity="0.59"/><circle cx="144.3" cy="377.6" r="2.6" fill="#6B9A3D" opacity="0.77"/><circle cx="130.5" cy="393.8" r="2.6" fill="#1D8155" opacity="0.63"/><circle cx="163.8" cy="341.2" r="2.6" fill="#9A6614" opacity="0.89"/><circle cx="177.0" cy="375.8" r="2.2" fill="#9A6614" opacity="0.71"/><circle cx="150.2" cy="360.5" r="2.2" fill="#C4762A" opacity="0.89"/><circle cx="155.7" cy="315.6" r="3.1" fill="#9A6614" opacity="0.78"/><circle cx="180.6" cy="390.0" r="4.4" fill="#1D8155" opacity="0.61"/><circle cx="176.3" cy="357.3" r="2.6" fill="#9A6614" opacity="0.79"/><circle cx="156.0" cy="396.9" r="5.4" fill="#1D8155" opacity="0.63"/><circle cx="153.7" cy="346.9" r="2.6" fill="#B23A2E" opacity="0.97"/><circle cx="135.1" cy="325.0" r="2.2" fill="#C4762A" opacity="0.81"/><circle cx="119.6" cy="329.8" r="2.6" fill="#6B9A3D" opacity="0.75"/><circle cx="116.4" cy="305.3" r="4.4" fill="#1D8155" opacity="0.62"/><circle cx="169.0" cy="374.5" r="2.6" fill="#6B9A3D" opacity="0.75"/><circle cx="141.5" cy="292.6" r="2.2" fill="#6B9A3D" opacity="0.61"/><circle cx="125.9" cy="345.5" r="2.2" fill="#9A6614" opacity="0.82"/><circle cx="163.4" cy="312.5" r="2.2" fill="#1D8155" opacity="0.74"/><circle cx="112.5" cy="321.6" r="2.6" fill="#1D8155" opacity="0.68"/><circle cx="199.4" cy="320.9" r="3.1" fill="#1D8155" opacity="0.60"/><circle cx="168.4" cy="334.5" r="2.2" fill="#6B9A3D" opacity="0.84"/><circle cx="132.9" cy="339.1" r="3.1" fill="#9A6614" opacity="0.87"/><circle cx="190.8" cy="356.0" r="2.6" fill="#6B9A3D" opacity="0.69"/><circle cx="149.5" cy="381.2" r="2.2" fill="#1D8155" opacity="0.74"/><circle cx="276" cy="328" r="50" fill="rgba(88,67,108,.05)"/><circle cx="250.0" cy="342.6" r="5.4" fill="#9A6614" opacity="0.73"/><circle cx="262.7" cy="320.7" r="3.1" fill="#C4762A" opacity="0.86"/><circle cx="307.0" cy="315.7" r="2.6" fill="#9A6614" opacity="0.70"/><circle cx="303.9" cy="357.4" r="5.4" fill="#1D8155" opacity="0.64"/><circle cx="251.5" cy="297.6" r="2.6" fill="#1D8155" opacity="0.65"/><circle cx="250.0" cy="361.6" r="3.1" fill="#6B9A3D" opacity="0.62"/><circle cx="258.5" cy="285.9" r="5.4" fill="#1D8155" opacity="0.59"/><circle cx="315.1" cy="328.7" r="3.1" fill="#1D8155" opacity="0.65"/><circle cx="261.3" cy="306.5" r="3.6" fill="#6B9A3D" opacity="0.77"/><circle cx="290.5" cy="348.7" r="3.6" fill="#6B9A3D" opacity="0.77"/><circle cx="296.6" cy="289.4" r="2.6" fill="#1D8155" opacity="0.61"/><circle cx="266.4" cy="362.6" r="4.4" fill="#1D8155" opacity="0.68"/><circle cx="280.2" cy="368.3" r="3.1" fill="#6B9A3D" opacity="0.64"/><circle cx="283.5" cy="356.2" r="4.4" fill="#6B9A3D" opacity="0.74"/><circle cx="303.8" cy="305.3" r="2.2" fill="#6B9A3D" opacity="0.68"/><circle cx="313.1" cy="348.0" r="5.4" fill="#6B9A3D" opacity="0.62"/><circle cx="253.7" cy="320.0" r="2.6" fill="#9A6614" opacity="0.79"/><circle cx="242.1" cy="333.7" r="3.6" fill="#6B9A3D" opacity="0.69"/><circle cx="265.2" cy="297.4" r="3.1" fill="#9A6614" opacity="0.71"/><circle cx="272.0" cy="322.7" r="2.2" fill="#B23A2E" opacity="0.94"/><circle cx="300.0" cy="317.0" r="2.2" fill="#9A6614" opacity="0.76"/><circle cx="232.6" cy="332.2" r="2.2" fill="#1D8155" opacity="0.61"/><circle cx="261.9" cy="336.3" r="2.2" fill="#C4762A" opacity="0.85"/><circle cx="234.6" cy="313.3" r="3.1" fill="#1D8155" opacity="0.60"/><circle cx="264.4" cy="345.2" r="3.6" fill="#C4762A" opacity="0.81"/><circle cx="300.0" cy="335.7" r="2.2" fill="#6B9A3D" opacity="0.77"/><circle cx="289.9" cy="299.5" r="5.4" fill="#1D8155" opacity="0.71"/><circle cx="279.7" cy="336.0" r="2.2" fill="#B23A2E" opacity="0.92"/><circle cx="288.8" cy="313.0" r="2.2" fill="#9A6614" opacity="0.82"/><circle cx="307.5" cy="324.2" r="3.6" fill="#6B9A3D" opacity="0.71"/><circle cx="303.4" cy="343.7" r="2.6" fill="#6B9A3D" opacity="0.72"/><circle cx="279.2" cy="343.7" r="3.6" fill="#6B9A3D" opacity="0.86"/><circle cx="271.7" cy="305.8" r="5.4" fill="#9A6614" opacity="0.80"/><circle cx="285.0" cy="322.5" r="2.2" fill="#9A6614" opacity="0.90"/><circle cx="239.6" cy="301.5" r="3.6" fill="#1D8155" opacity="0.59"/><circle cx="245.3" cy="354.8" r="3.1" fill="#6B9A3D" opacity="0.63"/><circle cx="258.4" cy="359.2" r="2.2" fill="#6B9A3D" opacity="0.68"/><circle cx="298.6" cy="324.6" r="3.6" fill="#9A6614" opacity="0.79"/><circle cx="275.6" cy="329.8" r="3.1" fill="#C4762A" opacity="0.98"/><circle cx="243.0" cy="320.7" r="3.6" fill="#9A6614" opacity="0.70"/><circle cx="288.2" cy="365.9" r="2.6" fill="#1D8155" opacity="0.64"/><circle cx="255.3" cy="327.2" r="2.6" fill="#6B9A3D" opacity="0.81"/><circle cx="236.0" cy="348.1" r="4.4" fill="#6B9A3D" opacity="0.60"/><circle cx="317.5" cy="313.7" r="2.2" fill="#6B9A3D" opacity="0.61"/><circle cx="310.7" cy="304.2" r="2.2" fill="#1D8155" opacity="0.62"/><circle cx="292.4" cy="334.0" r="2.2" fill="#C4762A" opacity="0.84"/><circle cx="281.5" cy="310.6" r="2.6" fill="#6B9A3D" opacity="0.84"/><circle cx="273.0" cy="357.4" r="2.6" fill="#1D8155" opacity="0.73"/><circle cx="281.0" cy="289.5" r="2.6" fill="#6B9A3D" opacity="0.65"/><circle cx="276.1" cy="316.6" r="2.2" fill="#B23A2E" opacity="0.90"/><circle cx="246.7" cy="307.5" r="2.2" fill="#1D8155" opacity="0.68"/><circle cx="312.0" cy="335.9" r="3.1" fill="#9A6614" opacity="0.67"/><circle cx="232.8" cy="324.8" r="3.6" fill="#1D8155" opacity="0.61"/><circle cx="250.9" cy="333.0" r="2.6" fill="#6B9A3D" opacity="0.77"/><circle cx="290.1" cy="319.6" r="2.2" fill="#6B9A3D" opacity="0.85"/><circle cx="257.1" cy="365.8" r="2.6" fill="#6B9A3D" opacity="0.62"/><circle cx="249.7" cy="314.7" r="2.2" fill="#1D8155" opacity="0.73"/><circle cx="318.7" cy="340.1" r="2.6" fill="#1D8155" opacity="0.60"/><circle cx="272.5" cy="287.9" r="2.2" fill="#6B9A3D" opacity="0.64"/><circle cx="264.0" cy="352.8" r="2.2" fill="#9A6614" opacity="0.75"/><circle cx="296.0" cy="363.5" r="3.1" fill="#6B9A3D" opacity="0.63"/><circle cx="267.5" cy="333.9" r="2.6" fill="#C4762A" opacity="0.91"/><circle cx="301.1" cy="295.8" r="3.6" fill="#1D8155" opacity="0.63"/><circle cx="319.1" cy="320.1" r="2.6" fill="#6B9A3D" opacity="0.61"/><circle cx="254.5" cy="353.6" r="3.1" fill="#9A6614" opacity="0.70"/><circle cx="272.2" cy="351.0" r="2.2" fill="#9A6614" opacity="0.79"/><circle cx="262.2" cy="371.8" r="2.6" fill="#6B9A3D" opacity="0.59"/><circle cx="294.7" cy="307.9" r="2.2" fill="#6B9A3D" opacity="0.75"/><circle cx="288.9" cy="340.6" r="3.1" fill="#9A6614" opacity="0.84"/><circle cx="376" cy="370" r="44" fill="rgba(88,67,108,.05)"/><circle cx="403.3" cy="359.1" r="3.1" fill="#6B9A3D" opacity="0.70"/><circle cx="411.6" cy="374.0" r="2.2" fill="#1D8155" opacity="0.63"/><circle cx="371.8" cy="391.9" r="4.4" fill="#9A6614" opacity="0.77"/><circle cx="388.9" cy="378.0" r="3.1" fill="#C4762A" opacity="0.85"/><circle cx="379.6" cy="331.7" r="4.4" fill="#6B9A3D" opacity="0.61"/><circle cx="354.0" cy="402.6" r="5.4" fill="#1D8155" opacity="0.60"/><circle cx="387.3" cy="391.1" r="3.6" fill="#6B9A3D" opacity="0.75"/><circle cx="375.2" cy="352.9" r="3.1" fill="#C4762A" opacity="0.82"/><circle cx="371.5" cy="343.1" r="5.4" fill="#6B9A3D" opacity="0.72"/><circle cx="402.7" cy="388.7" r="2.6" fill="#1D8155" opacity="0.67"/><circle cx="381.8" cy="360.5" r="5.4" fill="#C4762A" opacity="0.89"/><circle cx="384.6" cy="384.3" r="2.2" fill="#9A6614" opacity="0.83"/><circle cx="396.7" cy="338.4" r="3.6" fill="#1D8155" opacity="0.61"/><circle cx="375.1" cy="383.2" r="2.6" fill="#9A6614" opacity="0.86"/><circle cx="346.4" cy="370.7" r="2.2" fill="#1D8155" opacity="0.70"/><circle cx="376.8" cy="400.5" r="2.2" fill="#6B9A3D" opacity="0.69"/><circle cx="363.9" cy="383.4" r="3.6" fill="#9A6614" opacity="0.82"/><circle cx="395.8" cy="349.3" r="2.2" fill="#1D8155" opacity="0.71"/><circle cx="345.6" cy="355.6" r="2.6" fill="#1D8155" opacity="0.66"/><circle cx="393.6" cy="402.7" r="2.2" fill="#1D8155" opacity="0.62"/><circle cx="366.5" cy="360.6" r="4.4" fill="#C4762A" opacity="0.86"/><circle cx="397.1" cy="380.4" r="2.2" fill="#1D8155" opacity="0.76"/><circle cx="351.2" cy="347.2" r="3.1" fill="#1D8155" opacity="0.66"/><circle cx="386.2" cy="344.5" r="2.6" fill="#1D8155" opacity="0.72"/><circle cx="353.0" cy="366.3" r="2.2" fill="#9A6614" opacity="0.76"/><circle cx="359.7" cy="339.1" r="2.6" fill="#1D8155" opacity="0.64"/><circle cx="404.3" cy="370.8" r="2.2" fill="#9A6614" opacity="0.71"/><circle cx="405.3" cy="343.2" r="3.1" fill="#1D8155" opacity="0.59"/><circle cx="373.0" cy="372.4" r="2.6" fill="#9A6614" opacity="0.96"/><circle cx="406.5" cy="382.0" r="3.6" fill="#1D8155" opacity="0.67"/><circle cx="394.2" cy="386.9" r="3.1" fill="#9A6614" opacity="0.75"/><circle cx="337.9" cy="380.1" r="3.6" fill="#1D8155" opacity="0.60"/><circle cx="412.6" cy="358.9" r="2.6" fill="#1D8155" opacity="0.61"/><circle cx="387.1" cy="404.6" r="2.2" fill="#1D8155" opacity="0.63"/><circle cx="348.6" cy="389.1" r="3.1" fill="#1D8155" opacity="0.66"/><circle cx="395.5" cy="360.4" r="2.6" fill="#6B9A3D" opacity="0.78"/><circle cx="337.6" cy="369.9" r="2.2" fill="#6B9A3D" opacity="0.61"/><circle cx="388.2" cy="350.4" r="2.2" fill="#6B9A3D" opacity="0.76"/><circle cx="365.3" cy="407.7" r="3.1" fill="#1D8155" opacity="0.60"/><circle cx="381.6" cy="407.3" r="2.2" fill="#6B9A3D" opacity="0.61"/><circle cx="363.6" cy="373.6" r="2.2" fill="#C4762A" opacity="0.87"/><circle cx="414.6" cy="367.7" r="3.1" fill="#1D8155" opacity="0.60"/><circle cx="354.6" cy="357.3" r="2.2" fill="#9A6614" opacity="0.75"/><circle cx="387.7" cy="368.0" r="2.2" fill="#9A6614" opacity="0.88"/><circle cx="394.3" cy="370.8" r="3.1" fill="#9A6614" opacity="0.81"/><circle cx="406.0" cy="352.6" r="2.2" fill="#6B9A3D" opacity="0.65"/><circle cx="399.9" cy="396.8" r="3.1" fill="#1D8155" opacity="0.63"/><circle cx="380.0" cy="376.5" r="3.1" fill="#C4762A" opacity="0.92"/><circle cx="370.7" cy="378.8" r="2.2" fill="#B23A2E" opacity="0.90"/><circle cx="364.1" cy="350.8" r="3.1" fill="#6B9A3D" opacity="0.77"/><circle cx="342.3" cy="362.5" r="3.1" fill="#1D8155" opacity="0.65"/><circle cx="387.1" cy="334.7" r="2.2" fill="#6B9A3D" opacity="0.62"/><circle cx="367.7" cy="331.3" r="3.1" fill="#1D8155" opacity="0.59"/><circle cx="353.7" cy="373.3" r="2.2" fill="#6B9A3D" opacity="0.77"/><circle cx="347.0" cy="377.8" r="2.2" fill="#1D8155" opacity="0.69"/><circle cx="361.0" cy="389.9" r="2.2" fill="#9A6614" opacity="0.75"/><circle cx="383.9" cy="397.7" r="2.2" fill="#9A6614" opacity="0.71"/><circle cx="364.2" cy="398.2" r="2.2" fill="#6B9A3D" opacity="0.69"/><circle cx="373.8" cy="405.5" r="2.2" fill="#1D8155" opacity="0.64"/><circle cx="450" cy="318" r="32" fill="rgba(88,67,108,.05)"/><circle cx="472.5" cy="330.2" r="2.2" fill="#1D8155" opacity="0.64"/><circle cx="463.4" cy="312.4" r="2.6" fill="#6B9A3D" opacity="0.80"/><circle cx="424.1" cy="329.8" r="2.2" fill="#1D8155" opacity="0.60"/><circle cx="439.2" cy="323.2" r="2.2" fill="#9A6614" opacity="0.83"/><circle cx="475.2" cy="316.4" r="5.4" fill="#1D8155" opacity="0.65"/><circle cx="445.0" cy="313.0" r="4.4" fill="#9A6614" opacity="0.90"/><circle cx="445.6" cy="297.4" r="2.6" fill="#1D8155" opacity="0.70"/><circle cx="453.8" cy="332.5" r="3.6" fill="#6B9A3D" opacity="0.79"/><circle cx="447.2" cy="323.0" r="3.6" fill="#C4762A" opacity="0.92"/><circle cx="462.1" cy="322.5" r="3.1" fill="#C4762A" opacity="0.82"/><circle cx="431.8" cy="310.4" r="2.2" fill="#9A6614" opacity="0.72"/><circle cx="458.0" cy="299.4" r="2.6" fill="#1D8155" opacity="0.72"/><circle cx="455.2" cy="346.2" r="3.1" fill="#1D8155" opacity="0.60"/><circle cx="455.5" cy="307.5" r="3.6" fill="#9A6614" opacity="0.83"/><circle cx="441.9" cy="305.4" r="2.2" fill="#6B9A3D" opacity="0.79"/><circle cx="432.4" cy="334.4" r="2.2" fill="#1D8155" opacity="0.66"/><circle cx="433.0" cy="319.8" r="3.1" fill="#6B9A3D" opacity="0.76"/><circle cx="422.7" cy="307.4" r="4.4" fill="#1D8155" opacity="0.59"/><circle cx="425.0" cy="320.8" r="2.6" fill="#6B9A3D" opacity="0.65"/><circle cx="466.1" cy="299.1" r="3.6" fill="#1D8155" opacity="0.65"/><circle cx="450.7" cy="292.8" r="2.6" fill="#6B9A3D" opacity="0.65"/><circle cx="436.7" cy="341.7" r="2.2" fill="#1D8155" opacity="0.62"/><circle cx="436.0" cy="329.6" r="2.2" fill="#9A6614" opacity="0.75"/><circle cx="453.1" cy="316.1" r="2.6" fill="#9A6614" opacity="0.95"/><circle cx="431.6" cy="299.6" r="3.6" fill="#1D8155" opacity="0.63"/><circle cx="442.1" cy="332.9" r="2.2" fill="#6B9A3D" opacity="0.76"/><circle cx="448.7" cy="341.6" r="2.6" fill="#6B9A3D" opacity="0.67"/><circle cx="465.9" cy="339.2" r="2.2" fill="#1D8155" opacity="0.63"/><circle cx="462.2" cy="331.2" r="2.2" fill="#1D8155" opacity="0.75"/><circle cx="474.2" cy="303.1" r="2.6" fill="#1D8155" opacity="0.60"/><circle cx="450.5" cy="302.5" r="2.2" fill="#9A6614" opacity="0.78"/><circle cx="443.4" cy="346.2" r="3.1" fill="#1D8155" opacity="0.59"/><circle cx="438.7" cy="292.6" r="2.6" fill="#1D8155" opacity="0.61"/><circle cx="467.6" cy="327.1" r="2.2" fill="#9A6614" opacity="0.72"/><circle cx="461.7" cy="291.2" r="3.6" fill="#1D8155" opacity="0.59"/><circle cx="459.5" cy="340.9" r="2.2" fill="#1D8155" opacity="0.65"/><circle cx="420.8" cy="315.7" r="2.6" fill="#1D8155" opacity="0.59"/><circle cx="469.2" cy="308.4" r="3.1" fill="#9A6614" opacity="0.70"/><circle cx="208" cy="406" r="30" fill="rgba(88,67,108,.05)"/><circle cx="215.5" cy="430.4" r="3.6" fill="#1D8155" opacity="0.62"/><circle cx="194.3" cy="402.3" r="2.2" fill="#C4762A" opacity="0.79"/><circle cx="230.9" cy="399.5" r="4.4" fill="#1D8155" opacity="0.64"/><circle cx="206.4" cy="403.2" r="5.4" fill="#B23A2E" opacity="0.95"/><circle cx="226.9" cy="421.4" r="3.6" fill="#6B9A3D" opacity="0.63"/><circle cx="220.2" cy="385.5" r="3.1" fill="#6B9A3D" opacity="0.64"/><circle cx="194.7" cy="393.1" r="4.4" fill="#1D8155" opacity="0.72"/><circle cx="187.7" cy="410.6" r="4.4" fill="#6B9A3D" opacity="0.69"/><circle cx="201.9" cy="431.3" r="2.2" fill="#1D8155" opacity="0.61"/><circle cx="188.1" cy="422.5" r="4.4" fill="#6B9A3D" opacity="0.61"/><circle cx="219.4" cy="416.8" r="2.2" fill="#9A6614" opacity="0.76"/><circle cx="200.7" cy="420.4" r="2.2" fill="#6B9A3D" opacity="0.76"/><circle cx="212.8" cy="420.4" r="2.2" fill="#9A6614" opacity="0.77"/><circle cx="201.7" cy="411.5" r="2.2" fill="#9A6614" opacity="0.87"/><circle cx="218.4" cy="401.3" r="3.1" fill="#C4762A" opacity="0.83"/><circle cx="206.6" cy="386.7" r="2.2" fill="#6B9A3D" opacity="0.71"/><circle cx="211.4" cy="394.7" r="2.6" fill="#C4762A" opacity="0.82"/><circle cx="182.8" cy="402.1" r="2.6" fill="#1D8155" opacity="0.62"/><circle cx="212.6" cy="412.1" r="3.1" fill="#C4762A" opacity="0.89"/><circle cx="232.5" cy="416.4" r="2.2" fill="#1D8155" opacity="0.60"/><circle cx="221.5" cy="393.6" r="3.1" fill="#6B9A3D" opacity="0.73"/><circle cx="199.4" cy="384.2" r="2.6" fill="#1D8155" opacity="0.65"/><circle cx="208.0" cy="428.0" r="2.6" fill="#6B9A3D" opacity="0.67"/><circle cx="211.8" cy="379.2" r="4.4" fill="#1D8155" opacity="0.59"/><circle cx="206.9" cy="420.1" r="2.2" fill="#6B9A3D" opacity="0.79"/><circle cx="229.8" cy="390.6" r="2.6" fill="#1D8155" opacity="0.60"/><circle cx="195.7" cy="415.7" r="2.6" fill="#6B9A3D" opacity="0.77"/><circle cx="228.3" cy="408.5" r="3.1" fill="#9A6614" opacity="0.69"/><circle cx="189.0" cy="387.5" r="2.2" fill="#1D8155" opacity="0.60"/></g><text x="70" y="424" class="cap">2,802 files scored</text><text x="526" y="280" class="cap">OPEN FINDINGS</text><rect x="526" y="300" width="236" height="24" rx="6" fill="#F4EAE1"/><rect x="526" y="300" width="3" height="24" rx="1.5" fill="#B23A2E"/><text x="539" y="316" class="find">CHANGE ENTROPY</text><text x="752" y="316" class="find" fill="#B23A2E" text-anchor="end" font-weight="700">−3.0</text><rect x="526" y="328" width="236" height="24" rx="6" fill="#F4EAE1"/><rect x="526" y="328" width="3" height="24" rx="1.5" fill="#B23A2E"/><text x="539" y="344" class="find">NESTED COMPLEXITY</text><text x="752" y="344" class="find" fill="#B23A2E" text-anchor="end" font-weight="700">−2.4</text><rect x="526" y="356" width="236" height="24" rx="6" fill="#F4EAE1"/><rect x="526" y="356" width="3" height="24" rx="1.5" fill="#9A6614"/><text x="539" y="372" class="find">CHURN RISK</text><text x="752" y="372" class="find" fill="#9A6614" text-anchor="end" font-weight="700">−1.8</text><rect x="526" y="384" width="236" height="24" rx="6" fill="#F4EAE1"/><rect x="526" y="384" width="3" height="24" rx="1.5" fill="#9A6614"/><text x="539" y="400" class="find">CO-CHANGE SCATTER</text><text x="752" y="400" class="find" fill="#9A6614" text-anchor="end" font-weight="700">−1.5</text><rect x="526" y="412" width="236" height="24" rx="6" fill="#F4EAE1"/><rect x="526" y="412" width="3" height="24" rx="1.5" fill="#9A6614"/><text x="539" y="428" class="find">UNTESTED HOTSPOT</text><text x="752" y="428" class="find" fill="#9A6614" text-anchor="end" font-weight="700">−1.2</text><rect x="802" y="104" width="380" height="352" rx="14" fill="#FFFFFF" stroke="rgba(88,67,108,.12)" stroke-width="1"/><text x="824" y="135" class="lbl">DEPENDENCY GRAPH</text><text x="1160" y="135" class="kick" text-anchor="end">16 languages</text><rect x="820" y="150" width="344" height="240" rx="9" fill="#F4EAE1"/><clipPath id="gclip"><rect x="820" y="150" width="344" height="240" rx="9"/></clipPath><g clip-path="url(#gclip)"><line x1="944.0" y1="201.8" x2="912" y2="224" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="907.3" y1="185.9" x2="912" y2="224" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="913.1" y1="193.3" x2="912" y2="224" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="948.1" y1="258.8" x2="912" y2="224" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="901.9" y1="182.8" x2="912" y2="224" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="895.4" y1="193.7" x2="912" y2="224" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="888.8" y1="197.7" x2="912" y2="224" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="929.0" y1="238.4" x2="912" y2="224" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="951.9" y1="214.2" x2="912" y2="224" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="1040.2" y1="228.2" x2="1052" y2="212" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="1048.4" y1="190.3" x2="1052" y2="212" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="1068.5" y1="249.3" x2="1052" y2="212" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="1013.8" y1="237.1" x2="1052" y2="212" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="1009.6" y1="237.8" x2="1052" y2="212" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="1065.3" y1="185.2" x2="1052" y2="212" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="1017.4" y1="194.6" x2="1052" y2="212" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="1107.4" y1="209.0" x2="1052" y2="212" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="1061.0" y1="174.5" x2="1052" y2="212" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="944.8" y1="323.3" x2="982" y2="322" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="955.1" y1="338.1" x2="982" y2="322" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="1001.7" y1="341.5" x2="982" y2="322" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="1022.9" y1="322.0" x2="982" y2="322" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="961.2" y1="356.5" x2="982" y2="322" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="942.1" y1="301.8" x2="982" y2="322" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="943.8" y1="346.7" x2="982" y2="322" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="983.8" y1="296.5" x2="982" y2="322" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="949.1" y1="320.7" x2="982" y2="322" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="1131.2" y1="323.1" x2="1098" y2="310" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="1085.5" y1="327.7" x2="1098" y2="310" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="1106.7" y1="286.0" x2="1098" y2="310" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="1152.2" y1="302.0" x2="1098" y2="310" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="1068.9" y1="335.5" x2="1098" y2="310" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="1148.6" y1="288.2" x2="1098" y2="310" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="1064.8" y1="323.3" x2="1098" y2="310" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="1046.2" y1="319.4" x2="1098" y2="310" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="1137.2" y1="290.0" x2="1098" y2="310" stroke="rgba(88,67,108,.15)" stroke-width="1"/><line x1="912" y1="224" x2="1052" y2="212" stroke="rgba(88,67,108,.30)" stroke-width="1.6"/><line x1="912" y1="224" x2="982" y2="322" stroke="rgba(88,67,108,.30)" stroke-width="1.6"/><line x1="912" y1="224" x2="1098" y2="310" stroke="rgba(88,67,108,.30)" stroke-width="1.6"/><line x1="1052" y1="212" x2="982" y2="322" stroke="rgba(88,67,108,.30)" stroke-width="1.6"/><line x1="982" y1="322" x2="1098" y2="310" stroke="rgba(88,67,108,.30)" stroke-width="1.6"/><circle cx="912.0" cy="224.0" r="9.0" fill="#C0641A" stroke="#FFFFFF" stroke-width="1.5"/><circle cx="944.0" cy="201.8" r="4.0" fill="#F7A94D"/><circle cx="907.3" cy="185.9" r="3.3" fill="#F7A94D"/><circle cx="913.1" cy="193.3" r="2.8" fill="#F7A94D"/><circle cx="948.1" cy="258.8" r="3.8" fill="#F7A94D"/><circle cx="901.9" cy="182.8" r="3.1" fill="#F7A94D"/><circle cx="895.4" cy="193.7" r="3.4" fill="#F7A94D"/><circle cx="888.8" cy="197.7" r="3.3" fill="#F7A94D"/><circle cx="929.0" cy="238.4" r="3.8" fill="#F7A94D"/><circle cx="951.9" cy="214.2" r="3.6" fill="#F7A94D"/><circle cx="1052.0" cy="212.0" r="9.0" fill="#58436C" stroke="#FFFFFF" stroke-width="1.5"/><circle cx="1040.2" cy="228.2" r="3.4" fill="#826AA0"/><circle cx="1048.4" cy="190.3" r="3.5" fill="#826AA0"/><circle cx="1068.5" cy="249.3" r="3.5" fill="#826AA0"/><circle cx="1013.8" cy="237.1" r="3.7" fill="#826AA0"/><circle cx="1009.6" cy="237.8" r="3.8" fill="#826AA0"/><circle cx="1065.3" cy="185.2" r="4.1" fill="#826AA0"/><circle cx="1017.4" cy="194.6" r="4.2" fill="#826AA0"/><circle cx="1107.4" cy="209.0" r="3.7" fill="#826AA0"/><circle cx="1061.0" cy="174.5" r="3.3" fill="#826AA0"/><circle cx="982.0" cy="322.0" r="9.0" fill="#B23A2E" stroke="#FFFFFF" stroke-width="1.5"/><circle cx="944.8" cy="323.3" r="4.2" fill="#CF6A55"/><circle cx="955.1" cy="338.1" r="4.0" fill="#CF6A55"/><circle cx="1001.7" cy="341.5" r="3.2" fill="#CF6A55"/><circle cx="1022.9" cy="322.0" r="3.0" fill="#CF6A55"/><circle cx="961.2" cy="356.5" r="4.0" fill="#CF6A55"/><circle cx="942.1" cy="301.8" r="3.5" fill="#CF6A55"/><circle cx="943.8" cy="346.7" r="3.7" fill="#CF6A55"/><circle cx="983.8" cy="296.5" r="2.9" fill="#CF6A55"/><circle cx="949.1" cy="320.7" r="2.6" fill="#CF6A55"/><circle cx="1098.0" cy="310.0" r="9.0" fill="#6B7A3D" stroke="#FFFFFF" stroke-width="1.5"/><circle cx="1131.2" cy="323.1" r="3.2" fill="#90A05E"/><circle cx="1085.5" cy="327.7" r="4.3" fill="#90A05E"/><circle cx="1106.7" cy="286.0" r="2.9" fill="#90A05E"/><circle cx="1152.2" cy="302.0" r="3.9" fill="#90A05E"/><circle cx="1068.9" cy="335.5" r="2.8" fill="#90A05E"/><circle cx="1148.6" cy="288.2" r="4.2" fill="#90A05E"/><circle cx="1064.8" cy="323.3" r="3.6" fill="#90A05E"/><circle cx="1046.2" cy="319.4" r="4.0" fill="#90A05E"/><circle cx="1137.2" cy="290.0" r="2.9" fill="#90A05E"/></g><text x="832" y="380" class="cap">28,126 nodes · 11 communities</text><text x="824" y="414" class="out">Who calls this? What breaks if</text><text x="824" y="434" class="out">I change it?</text><rect x="1200" y="104" width="364" height="352" rx="14" fill="#FFFFFF" stroke="rgba(88,67,108,.12)" stroke-width="1"/><text x="1222" y="135" class="lbl">GIT HISTORY</text><text x="1542" y="135" class="kick" text-anchor="end">1,050 commits</text><rect x="1218" y="150" width="328" height="240" rx="9" fill="#F4EAE1"/><rect x="1230.0" y="312.2" width="16.0" height="13.8" rx="2.5" fill="#1D8155" opacity="0.82"/><rect x="1249.0" y="300.7" width="16.0" height="25.3" rx="2.5" fill="#1D8155" opacity="0.82"/><rect x="1268.0" y="282.3" width="16.0" height="43.7" rx="2.5" fill="#1D8155" opacity="0.82"/><rect x="1287.0" y="261.6" width="16.0" height="64.4" rx="2.5" fill="#1D8155" opacity="0.82"/><rect x="1306.0" y="231.7" width="16.0" height="94.3" rx="2.5" fill="#1D8155" opacity="0.82"/><rect x="1325.0" y="206.4" width="16.0" height="119.6" rx="2.5" fill="#1D8155" opacity="0.82"/><rect x="1344.0" y="181.1" width="16.0" height="144.9" rx="2.5" fill="#9A6614" opacity="0.82"/><rect x="1363.0" y="192.6" width="16.0" height="133.4" rx="2.5" fill="#9A6614" opacity="0.82"/><rect x="1382.0" y="217.9" width="16.0" height="108.1" rx="2.5" fill="#9A6614" opacity="0.82"/><rect x="1401.0" y="243.2" width="16.0" height="82.8" rx="2.5" fill="#9A6614" opacity="0.82"/><rect x="1420.0" y="263.9" width="16.0" height="62.1" rx="2.5" fill="#9A6614" opacity="0.82"/><rect x="1439.0" y="282.3" width="16.0" height="43.7" rx="2.5" fill="#B23A2E" opacity="0.82"/><rect x="1458.0" y="296.1" width="16.0" height="29.9" rx="2.5" fill="#B23A2E" opacity="0.82"/><rect x="1477.0" y="305.3" width="16.0" height="20.7" rx="2.5" fill="#B23A2E" opacity="0.82"/><rect x="1496.0" y="312.2" width="16.0" height="13.8" rx="2.5" fill="#B23A2E" opacity="0.82"/><rect x="1515.0" y="316.8" width="16.0" height="9.2" rx="2.5" fill="#B23A2E" opacity="0.82"/><line x1="1230" y1="327" x2="1534" y2="327" stroke="rgba(88,67,108,.20)"/><text x="1230" y="348" class="cap">low risk</text><text x="1534" y="348" class="cap" text-anchor="end">high risk</text><text x="1230" y="176" class="cap">CHANGE-RISK DISTRIBUTION</text><text x="1230" y="380" class="cap">hotspots · ownership · co-change · bus factor</text><text x="1222" y="414" class="out">Which of these 40 files is</text><text x="1222" y="434" class="out">actually dangerous?</text><rect x="36" y="474" width="496" height="302" rx="14" fill="#FFFFFF" stroke="rgba(88,67,108,.12)" stroke-width="1"/><text x="58" y="505" class="lbl">GENERATED DOCS</text><text x="510" y="505" class="kick" text-anchor="end">1,274 pages</text><rect x="54" y="520" width="460" height="176" rx="9" fill="#F4EAE1"/><rect x="70" y="536" width="265" height="11" rx="3" fill="#58436C" opacity=".85"/><rect x="70" y="562" width="394" height="6" rx="3" fill="rgba(88,67,108,.26)"/><rect x="70" y="578" width="368" height="6" rx="3" fill="rgba(88,67,108,.26)"/><rect x="70" y="594" width="304" height="6" rx="3" fill="rgba(88,67,108,.26)"/><rect x="70" y="607" width="188" height="9" rx="3" fill="#A16215" opacity=".55"/><rect x="70" y="630" width="377" height="6" rx="3" fill="rgba(88,67,108,.26)"/><rect x="70" y="646" width="338" height="6" rx="3" fill="rgba(88,67,108,.26)"/><rect x="70" y="662" width="235" height="6" rx="3" fill="rgba(88,67,108,.26)"/><rect x="416" y="530" width="86" height="20" rx="10" fill="rgba(29,129,85,.12)"/><text x="459" y="544" class="pill" fill="#1D8155" text-anchor="middle">fresh · v6</text><text x="58" y="730" class="out">Why does auth work this way?</text><text x="58" y="751" class="outsub">Answered from the wiki, not from 12 file reads.</text><rect x="550" y="474" width="496" height="302" rx="14" fill="#FFFFFF" stroke="rgba(88,67,108,.12)" stroke-width="1"/><text x="572" y="505" class="lbl">ARCHITECTURAL DECISIONS</text><text x="1024" y="505" class="kick" text-anchor="end">mined from 8 sources</text><rect x="568" y="520" width="460" height="176" rx="9" fill="#F4EAE1"/><text x="584" y="548" class="dec">Rebuild the KG skeleton only when the</text><text x="584" y="568" class="dec">graph fingerprint changes</text><rect x="584" y="582" width="392" height="1" fill="rgba(88,67,108,.15)"/><rect x="584" y="596" width="101" height="21" rx="10.5" fill="#FFFFFF" stroke="rgba(88,67,108,.18)"/><text x="635" y="610" class="pill" fill="#1D8155" text-anchor="middle">Verified quote</text><rect x="693.4" y="596" width="108" height="21" rx="10.5" fill="#FFFFFF" stroke="rgba(88,67,108,.18)"/><text x="747" y="610" class="pill" fill="#58436C" text-anchor="middle">supersedes #418</text><rect x="809.4" y="596" width="115" height="21" rx="10.5" fill="#FFFFFF" stroke="rgba(88,67,108,.18)"/><text x="867" y="610" class="pill" fill="#A16215" text-anchor="middle">governs 24 files</text><text x="584" y="660" class="cap">Delivered back at session start, and the moment</text><text x="584" y="676" class="cap">your agent edits a file the decision governs.</text><text x="572" y="730" class="out">Don’t re-litigate what we settled.</text><text x="572" y="751" class="outsub">Captured nowhere else.</text><rect x="1064" y="474" width="500" height="302" rx="14" fill="#FFFFFF" stroke="rgba(88,67,108,.12)" stroke-width="1"/><text x="1086" y="505" class="lbl">SERVED TO YOUR AGENT</text><text x="1542" y="505" class="kick" text-anchor="end">10 MCP tools</text><rect x="1084" y="528" width="95" height="24" rx="6" fill="#F4EAE1" stroke="rgba(88,67,108,.12)"/><text x="1131" y="544" class="mono" text-anchor="middle">get_overview</text><rect x="1187" y="528" width="81" height="24" rx="6" fill="#F4EAE1" stroke="rgba(88,67,108,.12)"/><text x="1227" y="544" class="mono" text-anchor="middle">get_answer</text><rect x="1276" y="528" width="88" height="24" rx="6" fill="#F4EAE1" stroke="rgba(88,67,108,.12)"/><text x="1320" y="544" class="mono" text-anchor="middle">get_context</text><rect x="1372" y="528" width="81" height="24" rx="6" fill="#F4EAE1" stroke="rgba(88,67,108,.12)"/><text x="1412" y="544" class="mono" text-anchor="middle">get_symbol</text><rect x="1084" y="558" width="116" height="24" rx="6" fill="#F4EAE1" stroke="rgba(88,67,108,.12)"/><text x="1142" y="574" class="mono" text-anchor="middle">search_codebase</text><rect x="1208" y="558" width="67" height="24" rx="6" fill="#F4EAE1" stroke="rgba(88,67,108,.12)"/><text x="1241" y="574" class="mono" text-anchor="middle">get_risk</text><rect x="1283" y="558" width="116" height="24" rx="6" fill="#F4EAE1" stroke="rgba(88,67,108,.12)"/><text x="1340" y="574" class="mono" text-anchor="middle">get_change_risk</text><rect x="1406" y="558" width="60" height="24" rx="6" fill="#F4EAE1" stroke="rgba(88,67,108,.12)"/><text x="1436" y="574" class="mono" text-anchor="middle">get_why</text><rect x="1084" y="588" width="102" height="24" rx="6" fill="#F4EAE1" stroke="rgba(88,67,108,.12)"/><text x="1135" y="604" class="mono" text-anchor="middle">get_dead_code</text><rect x="1194" y="588" width="81" height="24" rx="6" fill="#F4EAE1" stroke="rgba(88,67,108,.12)"/><text x="1234" y="604" class="mono" text-anchor="middle">get_health</text><text x="1084" y="636" class="cap">Every response carries index age, indexed commit, and a staleness warning.</text><rect x="1084" y="650" width="460" height="46" rx="9" fill="rgba(245,149,32,.10)" stroke="rgba(245,149,32,.28)"/><text x="1098" y="670" class="chipval" fill="#A16215" font-size="19">−96%<tspan class="chipunit" fill="#5E5360"> context tokens</tspan></text><text x="1098" y="688" class="cap">−70% tool calls · −89% file reads · fewer round-trips per answer</text><text x="1086" y="730" class="out">Claude Code, Codex, Cursor, VS Code.</text><text x="1086" y="751" class="outsub">Plus hooks, so it arrives unasked.</text></svg>\ No newline at end of filediff --git a/README.md b/README.mdindex 955f474b3..fcbc936ad 100644--- a/README.md+++ b/README.md@@ -4,8 +4,6 @@<a href="https://www.repowise.dev"><img src=".github/assets/banner.png" alt="repowise: the codebase intelligence layer for your AI coding agent" width="100%" /></a>-<p align="center"><strong>Five intelligence layers · Ten MCP tools · 15 languages · Multi-repo workspaces · One <code>pip install</code></strong></p>-<p align="center"><a href="https://www.repowise.dev"><img src="https://img.shields.io/badge/LIVE_DEMO-repowise.dev-F59520?style=for-the-badge&labelColor=0A0A0A" alt="Live demo: repowise.dev" /></a><a href="https://github.com/repowise-dev/repowise"><img src="https://img.shields.io/badge/Star_this_repo-1E293B?style=for-the-badge&logo=github&logoColor=white&labelColor=0A0A0A" alt="Star repowise on GitHub" /></a>@@ -27,327 +25,249 @@</p><p align="center"><sub>- <a href="#the-five-layers">Layers</a> ·- <a href="#learns-from-how-you-actually-use-it">Learns from you</a> ·- <a href="#-code-health-the-layer-nobody-else-nails">Code Health</a> ·- <a href="#refactoring-intelligence">Refactoring</a> ·- <a href="#benchmarks">Benchmarks</a> ·- <a href="#supported-languages">Languages</a> ·+ <a href="#your-agent-stops-guessing">For your agent</a> ·+ <a href="#stop-paying-for-output-nobody-reads">Distill</a> ·+ <a href="#know-whats-dangerous-before-you-merge">Change risk</a> ·+ <a href="#-know-exactly-what-to-fix">Code health</a> ·+ <a href="#see-all-of-it">Dashboard</a> ·+ <a href="#past-one-repo">Workspaces</a> ·<a href="#quickstart">Quickstart</a> ·- <a href="#ten-mcp-tools">MCP tools</a> ·+ <a href="#the-ten-mcp-tools">MCP tools</a> ·<a href="#how-it-compares">Comparison</a> ·- <a href="#for-teams--enterprises">Hosted</a>+ <a href="#for-teams--enterprises">Teams</a></sub></p>----<p align="center">- <strong>measure, locate, and fix what your AI ships</strong><br/>- <strong>code health that predicts real bugs</strong> · <strong>ROC AUC 0.74 across 21 repos</strong> · <strong>2.3×</strong> CodeScene's defects under a fixed review budget<br/>- <strong>graph-aware refactoring plans</strong> your agent can execute · <strong>up to −96% context tokens</strong> · <strong>−70% agent tool calls</strong> at answer-quality parity-</p>+### Your AI agent burns most of its budget rediscovering your codebase. Index it once, and it never has to again.-<p align="center"><sub>Measured, reproducible, on public codebases. <a href="#benchmarks">See the benchmarks ↓</a></sub></p>+<sub>Free and self-hosted, runs on your machine, and the first index needs no API key.</sub>-<img src=".github/assets/demo.gif" alt="repowise demo: Claude Code querying the codebase through repowise's MCP tools, then a tour of the local dashboard" width="100%" />+<picture>+ <source media="(prefers-color-scheme: dark)" srcset=".github/assets/one-index-dark.svg" />+ <img src=".github/assets/one-index.svg" alt="One index producing code health, a dependency graph, git history, generated docs, architectural decisions, and ten MCP tools" width="100%" />+</picture>++</div>----</div>+Every question your agent asks about your repo has an answer that could have been+computed ahead of time. *Who calls this function? What breaks if I change it? Why is+it written this way? Which of these files is actually dangerous?* Instead, agents+rediscover it from scratch on every task: grep, read, re-read, forget.-AI now writes a large and growing share of the code, and the humans accountable-for it have to trust what ships. A score that says *"this file is risky"* isn't-enough: you need to know **where** the risk concentrates and **how** to fix it.--repowise closes that loop. It indexes your codebase once and scores **every file-for defect risk, maintainability, and performance** from 25 deterministic-markers, calibrated against a real defect corpus, no LLM, in under 30 seconds-([the proof ↓](#-code-health-the-layer-nobody-else-nails)). The same index then-**locates** the risk through a real dependency graph and git history, and-**generates the fix**: concrete, graph-aware refactoring plans (split this god-class, move this method, break this dependency cycle, dedup this clone) that-your coding agent can execute.--And because it is all one index, your agent gets the rest for free: **five-intelligence layers**: dependency graph, git history, auto-generated docs,-architectural decisions, and code health, exposed to Claude Code, Codex, and any-MCP-compatible agent through **ten task-shaped tools**. Your agent answers *"why-does auth work this way?"* instead of *"here is what `auth.ts` contains"*, with-fewer tool calls, fewer file reads, and lower cost per query, at comparable-answer quality ([benchmarks ↓](#benchmarks)). One index: context your agent can-use, signals your team can trust, and the fix it can apply.+repowise computes those answers once and keeps them current on every commit. Your+agent reads the answer instead of the codebase, and the same index gives your team a+defect-validated health score, change-risk scoring on every PR, and a local dashboard+for all of it. One `pip install`, no cloud, your code never leaves your machine.----## The five layers+## Your agent stops guessing-repowise runs once, builds everything, then keeps it in sync on every commit.-Each layer is queryable from the CLI, the MCP tools, and the local dashboard.+repowise exposes **ten task-shaped MCP tools** to Claude Code, Codex, Cursor, VS Code+and anything else that speaks MCP. Most tools are built around data entities (one+file, one symbol), which forces agents into long chains of sequential calls. These are+built around **tasks**: pass several targets in one call, get complete context back.-| Layer | What it gives you | Edge |-|---|---|---|-| **◈ Graph** | tree-sitter dependency graph across 15 languages · two-tier file + symbol nodes · 3-tier call resolution · Leiden communities · PageRank / centrality / execution flows · framework-aware route→handler edges | A real graph most tools never build |-| **◈ Git** | hotspots (churn × complexity) · ownership % · co-change pairs (hidden coupling) · bus factor · contributor profiles · module health · reviewer suggestions | Behavioral signals static analysis can't see |-| **◈ Docs** | LLM-generated wiki per module/file · incremental on every commit · freshness + confidence scoring · hybrid RAG search (FTS + vector via RRF) · selectable wiki styles (comprehensive / reference / tutorial / caveman) · 15 output languages (`init --language zh`) | Stays current, rebuilt every commit |-| **◈ Decisions** | architectural decisions mined from **8 sources**, evidence-backed (verified / fuzzy / unverified), linked to graph nodes, connected by `supersedes`/`refines`/`conflicts_with` edges, tracked for staleness | **★ Captured nowhere else** |-| **★ Code Health** | **25 deterministic markers**, 1–10 per file · **three signals: defect risk · maintainability · performance** · coverage ingestion · trend alerts · **concrete graph-aware refactoring plans** (Extract Class / Helper / Move Method / Break Cycle / Split File / Extract Method) · **zero LLM, <30s** | **★ Defect-validated, with the fix attached. Our edge** |+<img src=".github/assets/demo.gif" alt="Claude Code querying the codebase through repowise's MCP tools" width="100%" />-Full deep-dive on every layer (graph, git, docs, decisions, hooks, auto-sync,-dead code, CLAUDE.md generation): **[docs/INTELLIGENCE_LAYERS.md →](docs/INTELLIGENCE_LAYERS.md)**+Because the exploration work is already done, that phase mostly disappears:----+<div align="center">-## Learns from how you actually use it--repowise doesn't just index once and go stale, it watches how you and your agent-work in the repo and tilts itself toward that. All local, all deterministic, no-extra LLM calls, and it feeds back through the [hooks](docs/HOOKS.md) at zero-agent effort:--- **Decisions mined from your own sessions.** repowise reads your Claude Code- transcripts for the corrections and conventions you actually enforce ("new- endpoints go through the auth middleware", "use the shared HTTP client, not- raw requests"), turns the durable ones into tracked decisions, then delivers- the relevant ones back: a compact block at session start, and a one-line- *"governed by"* notice the moment your agent edits a file that decision- governs. If a later session contradicts a decision, it stops being injected.-- **Docs that follow your questions.** The wiki generation budget tilts toward- the modules you and your agent ask about most (from `get_answer` and- `search_codebase` history), so depth lands where you actually work instead of- spreading evenly. Silent and byte-identical on a fresh repo with no history.--It is a flywheel: **use it → it mines what mattered → it delivers that back on-the next session.** How the hooks carry it: **[docs/HOOKS.md →](docs/HOOKS.md)** ·-decision layer: **[docs/INTELLIGENCE_LAYERS.md →](docs/INTELLIGENCE_LAYERS.md)**+**up to −96% tokens to load context · −89% file reads · −70% tool calls**----+</div>-## ★ Code Health: the layer nobody else nails+Loading one commit's context through `get_context` costs **2,391 tokens instead of+64,039** raw. On a long multi-step investigation that compounds to **−41% of the+context re-read across the whole session**. Paired runs, same model, same harness,+with and without repowise ([the numbers, and what they do not show →](docs/BENCHMARKS.md)).-Code health is repowise's deepest differentiator: the one layer with no real-equivalent, and **the only one we can prove predicts real bugs**. It runs as a-loop: **measure** every file across three signals, **locate** where the risk-concentrates through the graph and git history, then **fix** it with a concrete-refactoring plan your agent can execute.+**And it arrives without being asked.** Optional [hooks](docs/agent/HOOKS.md) push+context into the session at the moment it matters: the governing architectural+decision when your agent edits a file that decision covers, a warning when it touches+a file with a run of recent bug fixes, a compact briefing at session start. repowise+also generates your `CLAUDE.md` and `AGENTS.md` from the real index, so even an agent+with no MCP support starts informed.-<div align="center">-<img src=".github/assets/health-loop.svg" alt="repowise code-health loop: 25 deterministic markers fan into three signals (defect risk, maintainability, performance), the graph and git history locate where risk concentrates, and refactoring intelligence emits concrete plans (Extract Class, Extract Helper, Move Method, Break Cycle, Split File, Extract Method) your agent executes" width="100%" />-</div>+**It learns from how you actually work.** repowise reads your own agent transcripts+for the corrections you keep making ("use the shared HTTP client, not raw requests")+and turns the durable ones into tracked decisions it delivers back later. The wiki+generation budget tilts toward the modules you and your agent ask about most. All+local, all deterministic, no extra LLM calls.-repowise scores **every file 1–10** from **25 deterministic markers** (McCabe-complexity, brain methods, LCOM4 cohesion, god classes, native Rabin–Karp clone-detection, untested hotspots, change entropy, prior-defect history, and more),-split into **three signals** kept as separate lenses so the headline stays clean:+----- **Defect risk**, the bug-predictive, defect-calibrated headline 1–10 in the table below.-- **Maintainability** (cohesion, brain methods, DRY and god-class smells): what- raises change-cost without predicting bugs.-- **Performance** (static N+1 / I/O-in-loop risk), traced across files through- the call graph: file-local linters found 0 of those cross-function cases on a- 12k-file benchmark where repowise surfaced 557.+## Stop paying for output nobody reads-> **Zero LLM calls, zero cloud, zero new runtime dependencies.** Pure Python-> over tree-sitter + git data, **under 30 seconds** on a 3,000-file repo, with-> marker weights **calibrated against a real defect corpus, not hand-tuned**.+Most of what an agent reads back from a shell command is noise: 300 lines of passing+tests wrapped around 4 failures, full commit bodies when it asked "what changed+recently". `repowise distill <cmd>` compresses command output **before the agent reads+it**, errors first, exit code preserved.```bash-repowise health # KPIs + lowest-scoring files-coverage run --contexts=test -m pytest # produce a .coverage with per-test contexts-repowise coverage add .coverage # untested-hotspot marker + per-test test-to-code map-repowise impacted-tests HEAD~1 # run only the tests a diff actually exercises-repowise health --trend # snapshots + declining / predicted-decline alerts+repowise distill pytest # 61% fewer tokens, all 11 failure lines kept+repowise distill git log -50 # 89% fewer tokens+repowise saved # what distillation saved you, in tokens and dollars```-It proves itself on *your* repo, not just a benchmark: after every index,-repowise checks its own flags against your git history, *"16/20 lowest-health-files had a bug fix in the last 6 months, 3.3x the 24% baseline"*. [Does the-score find the bugs?](docs/CODE_HEALTH.md#does-the-score-find-the-bugs).--**And it out-ranks CodeScene**, the leading commercial code-health tool, on the-**same 2,770 files across 9 languages**, scored at the same leakage-free commit-against the same defect labels:--| Axis (head-to-head, paired tests) | repowise | CodeScene |-|---|---:|---:|-| **Recall @ 20%-of-lines budget** | **0.173** | 0.074 |-| **Effort-aware ranking (Popt)** | **0.607** | 0.462 |-| **Defect density, size-normalized (defects/KLOC, Alert:Healthy)** | **2.18×** | 0.56× |--Ranking by repowise health surfaces **2.3× the defects under a fixed review-budget** (Popt Δ +0.144, recall Δ +0.098, density Δ all p = 0.003, paired and-significant). [Full methodology & CIs →](https://github.com/repowise-dev/repowise-bench/blob/master/health-defect/COMPARISON_REPORT.md)--User guide & per-marker reference: **[docs/CODE_HEALTH.md](docs/CODE_HEALTH.md)**--### Refactoring intelligence--A health score tells you a file is in trouble; every other tool stops there, or-prints the same static sentence for every god class. repowise names the-**specific** fix, computed deterministically from the graph, class model, and-git co-change: **Extract Class**, **Extract Helper**, **Move Method**, **Break-Cycle**, **Split File**, **Extract Method**. Each plan names the exact methods,-edges, or symbols that move, carries its **blast radius** (callers and-co-changing files that must move with it), and is ranked **graph-aware** (`impact-× centrality × blast radius`) so a fix on a central hub outranks the same fix on-a leaf. That is the wedge: CodeScene's AI refactoring stays inside one function;-repowise names the cross-file move and its dependents. Extract Method goes-deepest, an intra-procedural dataflow pass (CFG + def/use + reaching definitions)-lifts the exact span and infers a behavior-preserving helper signature.--The deterministic plan is the product; an optional LLM step (never in the-indexing path, only on request) expands any plan into generated code plus a-unified diff, fed the graph and co-change context a bare codegen tool throws away.+Nothing is lost. Every omission leaves an inline `[repowise#<ref>]` marker that+`repowise expand <ref>` reverses in full, so the agent can always pull the detail back+without re-running the command. Small outputs pass through untouched. An opt-in hook+rewrites noisy commands automatically, shown to you for approval first.-```bash-repowise health --refactoring-targets # ranked plans; get_health(include=["refactoring"]) over MCP-```+<div align="center">+<img src=".github/assets/savings.png" alt="repowise Costs dashboard: tokens and dollars saved across distill and the MCP tools" width="100%" />+<p align="center"><sub>The <strong>Costs</strong> dashboard tallies both savings surfaces, priced at your own agent's model. Example from a week of heavy local use.</sub></p>+</div>-The web **Refactoring** tab renders each plan as a card with a **copy-to-agent**-button and the opt-in **Generate code** diff view. Per-detector mechanics:-**[docs/CODE_HEALTH.md](docs/CODE_HEALTH.md#refactoring-targets)** · full-reference: **[docs/REFACTORING.md](docs/REFACTORING.md)**+Full guide: **[docs/agent/DISTILL.md →](docs/agent/DISTILL.md)**----## Change risk & agent provenance+## Know what's dangerous before you merge-Two more deterministic signals, built on the same graph and git history, for the-people who have to trust what ships:+Three deterministic signals, all computed from the graph and git history, no LLM:-- **★ Change risk:** score any commit or `base..HEAD` range **0–10** for defect- risk from the shape of the diff (Kamei-style just-in-time metrics), with- PR-mode directives (`will_break`, `missing_cochanges`, `missing_tests`,- `tests_to_run`). One command: `repowise risk main..HEAD`. Reference:- **[docs/CHANGE_RISK.md](docs/CHANGE_RISK.md)**.-- **★ Agent provenance:** attribute commits to the AI agents that wrote them,- straight from git history, so you can see how much of your codebase an agent- produced and which of that code is a low-health hotspot owned by a single- person. Risk management for AI-era codebases, not developer surveillance.+- **Change risk.** Score any commit or `base..HEAD` range **0-10** from the shape of+ the diff, ranked against your repo's own recent commits. PR mode returns directives+ rather than vibes: `will_break`, `missing_cochanges`, `missing_tests`, `tests_to_run`.+ One command: `repowise risk main..HEAD`. ([reference →](docs/layers/CHANGE_RISK.md))+- **Bug history.** Which files and symbols actually get bug-fixed, and how recently.+ Doc, test and config commits are filtered out so the count means what it says, and a+ file with a run of recent fixes gets flagged as a bug magnet while you edit it.+ ([reference →](docs/layers/BUG_HISTORY.md))+- **Test intelligence.** Ingest coverage, find untested hotspots, and run only the+ tests a diff actually exercises with `repowise impacted-tests HEAD~1`.+ ([reference →](docs/layers/TEST_INTELLIGENCE.md))-Both are zero-LLM and reproducible. Deep dives on the hosted site:-[change risk →](https://www.repowise.dev/features/change-risk) ·-[agent provenance →](https://www.repowise.dev/features/agent-provenance).+Plus the free **[Repowise PR Bot](https://github.com/apps/repowise-bot)**: one+deterministic comment per pull request covering hotspot touches, hidden coupling,+declining health and dead code. Zero LLM calls.----## Benchmarks+## ★ Know exactly what to fix-Reproducible, on public codebases. **[repowise-bench →](https://github.com/repowise-dev/repowise-bench)**+A score that says *"this file is risky"* is where most tools stop. repowise scores+every file, locates where the risk concentrates, and then names the specific fix.-### 1 · Agent efficiency: repowise does the exploration once, offline+<div align="center">+<img src=".github/assets/health-loop.svg" alt="repowise code-health loop: 25 deterministic markers fan into three signals, the graph and git history locate where risk concentrates, and refactoring intelligence emits concrete plans your agent executes" width="100%" />+</div>-Most of a coding agent's spend goes to *exploration*: greping for symbols,-reading candidate files, re-reading them as context grows. repowise does that-work once so the agent skips it on every query. Paired SWE-QA runs on real-repositories (same model, same harness, with vs without repowise's MCP tools):+Every file is scored 1-10 from **25 deterministic markers** (McCabe complexity, brain+methods, LCOM4 cohesion, god classes, native Rabin-Karp clone detection, untested+hotspots, change entropy, prior-defect history and more), split into three lenses:+**defect risk**, **maintainability**, and **performance** (static N+1 and I/O-in-loop+risk traced *across* files through the call graph, where file-local linters found 0 of+the cross-function cases repowise surfaced 557 of).++> **Zero LLM calls, zero cloud, zero new runtime dependencies.** Pure Python over+> tree-sitter and git data, **under 30 seconds** on a 3,000-file repo, with marker+> weights **calibrated against a real defect corpus, not hand-tuned**.++**It proves itself on your repo, not just on a benchmark.** After every index,+repowise checks its own flags against your git history and reports what it found:+*"17 of the 20 lowest-health files had a bug fix in the last 6 months, 3.6x the 23%+baseline."* If that number is bad on your codebase, you will see it.++Then it names the fix. Not "this class is too big", but **Extract Class**, **Extract+Helper**, **Move Method**, **Break Cycle**, **Split File**, or **Extract Method**, with+the exact methods, edges and symbols that move, the **blast radius** of callers and+co-changing files that have to move with them, and a graph-aware ranking so a fix on a+central hub outranks the same fix on a leaf. Extract Method goes down to an+intra-procedural dataflow pass that lifts the exact span and infers a+behavior-preserving signature.-<div align="center">+```bash+repowise health # KPIs and lowest-scoring files+repowise health --refactoring-targets # ranked, concrete plans+repowise health --trend # snapshots plus declining-health alerts+```-**up to −96% tokens to load context · −89% file reads · −70% fewer tool calls · answer quality at parity**+The dashboard renders each plan as a card with a copy-to-agent button. An optional LLM+step, never in the indexing path and only on request, expands any plan into generated+code and a unified diff.-</div>+<sub>Against <strong>CodeScene</strong>, the leading commercial code-health tool, on the+same 2,770 files and the same defect labels, ranking by repowise health surfaces+<strong>2.3x the defects under a fixed review budget</strong> (paired, p = 0.003).+<a href="docs/BENCHMARKS.md">Full head-to-head, methodology and limitations →</a></sub>-The win is *context*: repowise hands the agent a curated answer instead of a-pile of files to read. Loading a commit's context via `get_context` costs-**2,391 tokens vs 64,039** raw, **~27× fewer (−96%)**. Across the two-benchmarks, agents read **−69% to −89% fewer files** and make **−49% to −70%-fewer tool calls** at answer quality on par with raw exploration; on a long,-multi-step investigation that compounds to **−41% of the context re-read across-the whole session**. Saved tokens are tokens you don't pay for, so dollar cost-drops too, though agent-side prompt caching now mutes the cost delta. Reports: [flask48](https://github.com/repowise-dev/repowise-bench/blob/master/BENCHMARK_REPORT_FLASK48.md) · [flask v3](https://github.com/repowise-dev/repowise-bench/blob/master/BENCHMARK_REPORT_FLASK_V3.md) · [sklearn48](https://github.com/repowise-dev/repowise-bench/blob/master/BENCHMARK_REPORT_SKLEARN48.md)--### 2 · Distill: index-aware output distillation--Most of what an agent reads from a shell command is noise: 300 lines of-passing tests around 4 failures, full commit bodies for "what changed-recently". `repowise distill <cmd>` compresses command output **before the-agent reads it**, errors-first, exit code preserved, and every omission-reversible via an inline `[repowise#<ref>]` marker (`repowise expand <ref>`).-Paired runs on a public OSS repo, per command:--| Command | Raw → distilled tokens | Saved |-|---|---|---:|-| `pytest -q` (11 failures) | 3,374 → 1,317 | **61%**, all 11 failure lines preserved |-| `git log -50` | 3,064 → 331 | **89%** |-| `git diff` (30 commits) | 62,833 → 8,635 | **86%** |--Small outputs pass through untouched (net-positive guard), and in an-end-to-end spot-check the agent reached the identical root-cause diagnosis-from distilled output as from raw. Opt-in Claude Code hook rewrites noisy-commands automatically (shown for approval); `repowise saved` tracks tokens-and dollars saved. Full guide: **[docs/DISTILL.md →](docs/DISTILL.md)**+Guides: **[code health](docs/layers/CODE_HEALTH.md)** · **[refactoring](docs/layers/REFACTORING.md)**-<div align="center">-<img src=".github/assets/savings.png" alt="repowise Costs dashboard: tokens and dollars saved across distill and MCP tools" width="100%" />-<p align="center"><sub>The <strong>Costs</strong> dashboard tallies both savings surfaces: <code>repowise distill</code> (command output) and the MCP tools (each curated answer replacing the raw file reads it stood in for), priced at your coding agent's own model. Example shown from a week of heavy local use.</sub></p>-</div>+----### 3 · Code health predicts real defects+## See all of it-Health scores are collected at a historical commit (T0); bug-fixing commits are-counted over the following 6 months; the two are correlated, with strictly no-leakage. Across **21 open-source repositories spanning all 9 Full-tier-languages**:+`repowise serve` starts the full web dashboard next to the MCP server. No separate+setup, all local.-- **Cross-project mean ROC AUC 0.74** [95% CI 0.68–0.79] at identifying the files- that go on to receive bug-fixes, up to **0.90** on individual repos.-- **Survives controlling for file size** (partial Spearman ρ = −0.16), so it is- not just "flag the big files."-- **Significantly out-discriminates** recent churn (+0.10 AUC) and prior-defect- history (+0.12 AUC), DeLong p < 1e-9.-- Holds up on an **external published dataset it has never seen** (PROMISE/jEdit- CK-metrics: AUC 0.76–0.78, within ~0.03 of the dataset's own tuned model).+<table>+<tr>+<td width="50%"><img src=".github/assets/dashboard/code-health.gif" alt="Code health map: every file as a bubble, hover to inspect score, coverage and tests" /><br/><sub><b>Code Health</b> · every file as a bubble, hover any one to inspect its score, size, coverage and findings</sub></td>+<td width="50%"><img src=".github/assets/dashboard/commits-page.gif" alt="Commits view: change-risk distribution, review priority queue, agent attribution" /><br/><sub><b>Commits</b> · change-risk distribution, size-versus-diffusion scatter, and a review-priority queue</sub></td>+</tr>+<tr>+<td width="50%"><img src=".github/assets/dashboard/refactoring.gif" alt="Refactoring plans grouped by type with a priority versus effort quadrant chart" /><br/><sub><b>Refactoring</b> · plans grouped by type, ranked on a priority-versus-effort quadrant</sub></td>+<td width="50%"><img src=".github/assets/dashboard/files-page.gif" alt="Files treemap with per-file health, churn, lines and coverage" /><br/><sub><b>Files</b> · a treemap of the whole repo, sortable by health, churn, size or coverage</sub></td>+</tr>+</table>-Full report: **[health-defect/BENCHMARK_REPORT.md →](https://github.com/repowise-dev/repowise-bench/blob/master/health-defect/BENCHMARK_REPORT.md)**+Also in there: **Chat** (ask the codebase in natural language) · **Docs** (the+generated wiki, with Mermaid and a graph sidebar) · **Architecture** and **C4**+(Context → Containers → Components) · **Knowledge Graph** plus a zoomable canvas map ·+**Risk**, **Hotspots**, **Coupling** and **Blast radius** · **Contributors** ·+**Decisions** (evidence drawer and evolution timeline) · **Symbols** · **Security** ·+**Dead code** · **Stats** · **Costs** · **Workspace**.-<div align="center">-<sub>⭐ <strong>Star the repo</strong> if repowise just saved your agent a few greps, it helps the next engineer find it and tells us to keep building.</sub>-</div>+Every view and what each one answers: **[docs/start/DASHBOARD.md →](docs/start/DASHBOARD.md)**----## Local dashboard--`repowise serve` starts a full web UI alongside the MCP server, no separate-setup.+## Past one repo-<img src=".github/assets/webui.gif" alt="repowise local dashboard: Overview, Knowledge Graph, Code Health map, Commits, Chat, and By the Numbers" width="100%" />+Real systems are not one repository, and the interesting failures live in the gaps+between them.-Highlights: **Chat** (natural-language Q&A) · **Docs** (wiki with Mermaid +-graph sidebar) · **Graph** (interactive, 2,000+ nodes, community coloring, path-finder) · **C4 Architecture** (Context → Containers → Components) · **Risk**-(hotspots, ownership heatmap, module health, dead code, blast radius) ·-**Contributors** (per-author profiles) · **Decisions** (evidence drawer,-evolution timeline, decision-graph) · **Health** (three signals: defect,-maintainability, performance; coverage, trends) · **Refactoring** (ranked plan-cards, blast radius, copy-to-agent, opt-in code-gen diff) · **Security** (local-pattern scan) · **Costs** · **Workspace**-(cross-repo contracts & co-changes). Full view-by-view list in-[docs/USER_GUIDE.md](docs/USER_GUIDE.md).+- **Workspaces.** Index many repos as one unit and get what only a cross-repo view can+ show: **contracts** matched between a producer and its consumers, so a breaking API+ change is caught before it ships, plus cross-repo **co-change** pairs, federated MCP+ that answers across the whole estate, and conformance checks.+ ([docs/scale/WORKSPACES.md →](docs/scale/WORKSPACES.md))+- **Worktrees just work.** Run `repowise init` or `repowise update` inside a linked git+ worktree and it detects the base checkout, seeds that worktree's index from it, and+ catches up incrementally. No flags, no second full index.+ ([docs/scale/WORKTREES.md →](docs/scale/WORKTREES.md))+- **Auto-sync.** Keep the index current with a post-commit hook, a file watcher+ (`repowise watch`), a webhook, or polling. An incremental update takes seconds.+ ([docs/scale/AUTO_SYNC.md →](docs/scale/AUTO_SYNC.md))----## VS Code extension+## In your editor-The **Repowise** extension puts the index where code gets written: know what-your change breaks before you push (your riskiest files ranked, what is-downstream, forgotten companion files, missing tests, suggested reviewers),-health signals in the gutter and status bar, callers and ownership on hover,-refactoring plans as CodeLens, and the full dashboards (health, architecture,-knowledge graph, decisions, docs) inside the editor. One install also registers-the Repowise MCP server with VS Code, so the same local index serves both you-and your AI agent. Quiet by default, everything toggleable, nothing leaves your-machine.+The **Repowise** VS Code extension puts the index where code actually gets written:+know what your change breaks before you push (riskiest files ranked, what is+downstream, forgotten companion files, missing tests, suggested reviewers), health in+the gutter and status bar, callers and ownership on hover, refactoring plans as+CodeLens, and the full dashboards inside the editor. One install also registers the MCP+server with VS Code, so the same local index serves both you and your agent, and+exposes six tools to GitHub Copilot. Quiet by default, everything toggleable, nothing+leaves your machine.-Install from the Marketplace (search **Repowise**) or Open VSX, then run-**Repowise: Set Up This Repository**. Full guide in-[docs/VSCODE.md →](docs/VSCODE.md).+Install from the Marketplace (search **Repowise**) or Open VSX, then run **Repowise:+Set Up This Repository**. Guide: **[docs/agent/VSCODE.md →](docs/agent/VSCODE.md)**---## Supported languages-**15 languages parsed to AST · 11 at the Full tier · framework-aware across all of them.**+**16 languages parsed to AST · 11 at the Full tier · framework-aware across all of them.**<p><strong>Full tier </strong>@@ -373,68 +293,49 @@ Install from the Marketplace (search **Repowise**) or Open VSX, then run<img src="https://img.shields.io/badge/Luau-00A2FF?style=flat-square&logo=lua&logoColor=white" alt="Luau" /></p>-| Tier | Languages | What works |-|------|-----------|------------|-| **Full** | Python · TypeScript · JavaScript · Java · Kotlin · Go · Rust · C++ · C# · Scala · Ruby | AST parsing, import resolution, named bindings, call resolution, heritage extraction, docstrings; multi-project workspace resolvers; framework-aware edges; per-language dynamic-hint extractors; **code-health markers** |-| **Good** | C · Swift · PHP · Dart | AST parsing, import resolution, named bindings, call resolution, heritage (mixins / derive / extensions / traits), docstrings; dedicated workspace-aware resolvers; Laravel / TYPO3 / Flutter framework edges; dynamic-hint extractors; Dart adds code-health + perf markers |-| **SQL / dbt** | `.sql` via sqlglot (postgres, mysql, tsql, clickhouse, ...) | Tables / views / functions / procedures as symbols with wiki pages; dbt projects get real `ref()` / `source()` lineage edges: model-level DAG, hotspots, co-change, ownership |-| **Shell** | `.sh` · `.bash` · `.zsh` | Functions as symbols, `source` / `.` import edges (`$SCRIPT_DIR` / `dirname` idioms), and function-level code-health complexity. No class metrics, heritage, or dead-code flagging |-| **Config / data** | OpenAPI · Protobuf · GraphQL · Dockerfile · Makefile · YAML · JSON · TOML · Terraform · Markdown | Included in the file tree; special handlers extract endpoints / targets where applicable |-| **Git-blame only** | Objective-C · Elixir · Erlang · Zig · Julia · Clojure · Haskell · OCaml · F# · … | Tracked in git history (blame, hotspots, co-change); no AST parsing yet |+SQL and dbt projects get real `ref()` / `source()` lineage, shell scripts get+function-level symbols, and OpenAPI, Protobuf, GraphQL, Dockerfile, Terraform and+friends get dedicated handlers. Anything else is still tracked through git history:+blame, hotspots, co-change.-Adding a language needs **one `.scm` query file and one config entry**, with no-changes to the parser core. Full per-language matrix, code-health checklist, and-the contributor recipe: **[docs/LANGUAGE_SUPPORT.md →](docs/LANGUAGE_SUPPORT.md)**-------## Who it's for--| | Start here |-|---|---|-| **Individual developers** | `pip install repowise` → `repowise init` → query from Claude Code, Cursor, or any MCP agent. 100% local, BYO API key, free under AGPL-3.0. [For developers →](https://www.repowise.dev/for/developers) |-| **Team leads** | Know which PRs to worry about before you merge: change-risk scoring plus the free [**Repowise PR Bot**](https://github.com/apps/repowise-bot) that posts one deterministic comment per PR (hotspots, hidden coupling, declining health), zero LLM. [For team leads →](https://www.repowise.dev/for/teams) |-| **Engineering leaders** | See how much of your code AI wrote and whether it is healthy: agent provenance, code-health trends, and bus factor, from git history. [For engineering leaders →](https://www.repowise.dev/for/engineering-leaders) |-| **Security & compliance** | Reachability-aware CVE triage, secret detection across full git history, and SBOM, on your real dependency graph. [For security →](https://www.repowise.dev/for/security) |-| **Enterprises** | On-prem / air-gapped, SSO/SCIM, commercial licensing (no AGPL obligation), and IP indemnification. [For enterprise →](https://www.repowise.dev/for/enterprise) · [docs/COMMERCIAL.md](docs/COMMERCIAL.md) |+Adding a language takes **one `.scm` query file and one config entry**, with no changes+to the parser core. Full matrix and the contributor recipe:+**[docs/layers/LANGUAGE_SUPPORT.md →](docs/layers/LANGUAGE_SUPPORT.md)**---<a id="quickstart"></a>-## Quick start (under 5 minutes, no API key)--*Index once, and give your agent the dependency graph + git history + code-health-— not 40 greps.*+## Quickstart (under 5 minutes, no API key)**1. Install**```bashpip install repowise # Windows: python -m pip install repowise-repowise --version # -> repowise, version 0.27.x+repowise --version```-**2. Index your repo — no LLM, no key**+**2. Index your repo, with no LLM and no key**```bashcd /path/to/your/reporepowise init --index-only -y```-Builds the dependency graph, git history, code-health score, and dead-code findings-in seconds. (Want the generated wiki + semantic search? Use-`repowise init --provider gemini|anthropic|openai` with the matching key.)+That builds the dependency graph, git history, code-health scores and dead-code+findings in seconds. Want the generated wiki and semantic search too? Use `repowise+init --provider gemini|anthropic|openai` with the matching key.-**3. Connect your agent** — the MCP server is `repowise mcp`, served from the repo dir.+**3. Connect your agent.** The MCP server is `repowise mcp`, served from the repo directory.<details><summary><b>Claude Code</b></summary>```bash-# Plugin (adds 10 tools + slash commands + skills):+# Plugin (adds the tools, slash commands and skills):/plugin marketplace add repowise-dev/repowise/plugin install repowise@repowise-# …or wire the MCP server directly:+# ...or wire the MCP server directly:claude mcp add repowise -- repowise mcp```Or commit a project `.mcp.json`:@@ -455,45 +356,40 @@ Or: `codex mcp add repowise -- repowise mcp`</details>**4. First real call.** Ask your agent: *"Use repowise `get_overview` to summarize this-repo,"* or *"`get_context` for `src/auth.py`."* You get graph-grounded architecture and-per-file triage instead of a flurry of greps. ✅--> `get_overview` / `get_context` work in **index-only mode** (no key) — they synthesize-> from the graph/git/health layers. `search_codebase` / `get_answer` / `get_why` need-> full mode (the generated wiki).+repo"*, or *"`get_context` for `src/auth.py`"*. You get graph-grounded architecture and+per-file triage instead of a flurry of greps.-Ready for the full picture? Run `repowise init --provider …` for the generated wiki +-semantic search, or skip key management entirely with the hosted tier at-[repowise.dev](https://www.repowise.dev). Full walkthrough: [docs/QUICKSTART.md](docs/QUICKSTART.md).+> `get_overview` and `get_context` work in index-only mode with no key, synthesized+> from the graph, git and health layers. `search_codebase`, `get_answer` and `get_why`+> need full mode (the generated wiki).-**Docs:** [Quickstart](docs/QUICKSTART.md) · [User Guide](docs/USER_GUIDE.md) · [CLI Reference](docs/CLI_REFERENCE.md) · [Codex](docs/CODEX.md) · [MCP Tools](docs/MCP_TOOLS.md) · [Hooks](docs/HOOKS.md) · [Distill](docs/DISTILL.md) · [Workspaces](docs/WORKSPACES.md) · [Auto-Sync](docs/AUTO_SYNC.md) · [Upgrading](docs/UPGRADING.md) · [Config](docs/CONFIG.md)+Full walkthrough: **[docs/start/QUICKSTART.md →](docs/start/QUICKSTART.md)**----## Ten MCP tools+## The ten MCP tools-Most tools are designed around data entities (one module, one file, one symbol),-forcing agents into long chains of sequential calls. repowise tools are designed-around **tasks**: pass multiple targets in one call, get complete context back.-Every response carries an `_meta` envelope with `index_age_days`,-`indexed_commit`, and a `stale_warning` that fires only when the indexed HEAD-diverges from live `.git/HEAD`.+Every response carries an `_meta` envelope with `index_age_days`, `indexed_commit`, and+a `stale_warning` that fires only when the indexed HEAD diverges from live `.git/HEAD`,+so your agent always knows how much to trust what it just read.| Tool | What only this tool answers ||---|---|-| `get_overview()` | Architecture summary, module map, entry points, git health, community summary. First call on any unfamiliar codebase. |-| `get_answer(question)` | Hybrid retrieval (FTS + vector via RRF) + PageRank bias + 1-hop graph expansion → a cited answer with calibrated `retrieval_quality`. Returns structured `best_guesses` on low confidence. Collapses search → read → reason into one round-trip. |-| `get_context(targets, include?)` | Triage card for files / modules / symbols: title, summary, signatures, `hotspot` bit, `governing_decisions`, and `symbol_id`s. `include` opens callers/callees, ownership, metrics, decisions, full_doc. Batch many targets. |-| `get_symbol("file.py::Name")` | Raw source bytes for one indexed symbol with exact line bounds, cheaper and safer than `Read` + offset math. |-| `search_codebase(query, kind?)` | Semantic search over the wiki, filterable by `kind` (implementation / test / config / doc), tagging each result's `search_method`. |-| `get_risk(targets, changed_files?)` | Hotspot scores, dependents, co-change partners, ownership, test gaps, security signals. Pass `changed_files` for PR mode → a `directive` block (`will_break`, `missing_cochanges`, `missing_tests`, `tests_to_run`, `governance_risk`). |-| `get_change_risk(revspec, extensions?)` | Pre-merge defect score for a whole commit or `base..head` range from the shape of the diff (Kamei-style JIT metrics), ranked as a `risk_percentile` against recent commits. Also returns `impacted_tests`: the tests the per-test coverage map proves execute the change's changed *lines*, plus honest missing-test buckets. Scores the change; `get_risk` scores the indexed files it touches. |-| `get_why(query?, targets?)` | Architectural decision records, status, evidence spans, and the supersession **lineage chain**. Falls back to git archaeology when no ADRs exist. |-| `get_dead_code(...)` | Unreachable code by confidence tier with cleanup-impact estimates; cross-repo consumer detection in workspace mode. |-| `get_health(targets?, include?)` | Marker scores per file across three signals (defect · maintainability · performance). Dashboard mode → KPIs + lowest-scoring files + module rollup; targeted mode → per-file findings. Self-check before a PR via `include`: `accuracy` (does the score find the bugs), `signals` (per-file churn / owners / prior defects), `churn_complexity`, a dimension name to filter findings, plus `coverage`, `trend`, and `refactoring` → **structured, graph-aware refactoring plans** (split groups, move target, cut edges + blast radius), not template strings. |--Worked example (*"Add rate limiting to all API endpoints"* in 5 calls instead of-~30 greps+reads) and the full reference: **[docs/MCP_TOOLS.md →](docs/MCP_TOOLS.md)**+| `get_overview()` | Architecture summary, module map, entry points, git health. The first call on any unfamiliar codebase. |+| `get_answer(question)` | Hybrid retrieval (full-text plus vector via RRF), PageRank bias and 1-hop graph expansion into one cited answer with a calibrated `retrieval_quality`. Collapses search → read → reason into a single round-trip. |+| `get_context(targets, include?)` | Triage card for files, modules or symbols: summary, signatures, `hotspot` bit, governing decisions, `symbol_id`s. `include` opens callers, callees, ownership and metrics. Batch many targets in one call. |+| `get_symbol("file.py::Name")` | Source for one indexed symbol with exact line bounds. Cheaper and safer than `Read` plus offset math. |+| `search_codebase(query, kind?)` | Semantic search over the wiki, filterable by kind (implementation / test / config / doc), tagging each result's `search_method`. |+| `get_risk(targets, changed_files?)` | Hotspots, dependents, co-change partners, ownership, test gaps, bug history. Pass `changed_files` for PR mode and get a `directive` block back. |+| `get_change_risk(revspec)` | Pre-merge defect score for a whole commit or range from the shape of the diff, ranked as a percentile against recent commits, plus the tests coverage proves it touches. |+| `get_why(query?, targets?)` | Architectural decisions, their evidence spans and the supersession lineage. Falls back to git archaeology when no decisions exist. |+| `get_dead_code(...)` | Unreachable code by confidence tier with cleanup-impact estimates, and cross-repo consumer detection in workspace mode. |+| `get_health(targets?, include?)` | Per-file marker scores across all three signals. `include` opens coverage, trends, per-file signals, the accuracy self-check, and structured refactoring plans. |++Ten is a deliberate ceiling rather than a limit we ran into: a small, task-shaped+surface is easier for an agent to choose from than a large one. Worked example (*"add+rate limiting to all API endpoints"* in 5 calls instead of ~30 greps and reads), the+opt-in tools, and the full reference: **[docs/agent/MCP_TOOLS.md →](docs/agent/MCP_TOOLS.md)**---@@ -505,82 +401,101 @@ Worked example (*"Add rate limiting to all API endpoints"* in 5 calls instead of| Private repo, no cloud | ✅ | ❌ in development | ❌ OSS forks only | ✅ Enterprise tier | ✅ || Auto-generated documentation | ✅ | ✅ Gemini | ✅ | ✅ PR2Doc | ❌ || MCP server for AI agents | ✅ 10 tools | ❌ | ✅ 3 tools | ✅ | ✅ |-| Proactive agent hooks | ✅ Claude + Codex hooks | ❌ | ❌ | ❌ | ❌ |+| Proactive agent hooks | ✅ Claude + Codex | ❌ | ❌ | ❌ | ❌ || Auto-generated AI instructions (`CLAUDE.md`, `AGENTS.md`) | ✅ | ❌ | ❌ | ❌ | ❌ |+| Command-output distillation | ✅ reversible | ❌ | ❌ | ❌ | ❌ || Learns from your usage (session-mined decisions, demand-weighted docs) | ✅ | ❌ | ❌ | ❌ | ❌ |-| Code health score (1–10) | ✅ 25 markers | ❌ | ❌ | ❌ | ✅ 25–30 |+| Code health score (1-10) | ✅ 25 markers | ❌ | ❌ | ❌ | ✅ 25-30 || Brain Method / LCOM4 / god class | ✅ | ❌ | ❌ | ❌ | ✅ || Test-coverage intelligence | ✅ LCOV/Cobertura/Clover | ❌ | ❌ | ❌ | ❌ || Untested-hotspot detection | ✅ coverage × hotspot | ❌ | ❌ | ❌ | ❌ || Health trend + declining alerts | ✅ rolling snapshots | ❌ | ❌ | ❌ | ✅ |-| Refactoring recommendations | ✅ deterministic | ❌ | ❌ | ❌ | ✅ |-| Concrete cross-file refactoring plans (Extract Class / Move Method / Break Cycle) | ✅ graph-aware + blast radius | ❌ | ❌ | ❌ | ⚠️ within-function only |-| Dataflow-verified within-function plans (Extract Method with inferred signature) | ✅ CFG + reaching definitions | ❌ | ❌ | ❌ | ⚠️ LLM-generated, unverified |+| Concrete cross-file refactoring plans | ✅ graph-aware + blast radius | ❌ | ❌ | ❌ | ⚠️ within-function only |+| Dataflow-verified within-function plans | ✅ CFG + reaching definitions | ❌ | ❌ | ❌ | ⚠️ LLM-generated, unverified || Git intelligence (hotspots, ownership, co-change) | ✅ | ❌ | ❌ | ❌ | ✅ |+| Pre-merge change-risk scoring | ✅ 0-10 + directives | ❌ | ❌ | ❌ | ✅ || Bus factor analysis | ✅ | ❌ | ❌ | ❌ | ✅ || Dead code detection | ✅ | ❌ | ❌ | ❌ | ❌ || Architectural decision records | ✅ | ❌ | ❌ | ❌ | ❌ |-| Multi-repo workspace intelligence | ✅ co-changes, contracts, federated MCP | ❌ | ❌ | ❌ | ❌ |+| Multi-repo workspace intelligence | ✅ contracts, co-change, federated MCP | ❌ | ❌ | ❌ | ❌ || Local dashboard | ✅ | ❌ | ❌ | ❌ IDE only | ✅ |-**repowise is the intersection:** behavioral git intelligence + a defect-validated-code-health score *with the graph-aware fix attached* + auto-generated docs +-agent-native MCP + architectural decisions + multi-repo workspace intelligence,-self-hostable and open source.-Full side-by-side comparisons (CodeScene, DeepWiki, Sourcegraph, Cursor, GitClear):-**[repowise.dev/compare →](https://www.repowise.dev/compare)**.+**repowise is the intersection:** an agent-native context layer *and* behavioral git+intelligence *and* a defect-validated health score with the fix attached, all out of+one index, self-hostable and open source. Full side-by-side comparisons:+**[repowise.dev/compare →](https://www.repowise.dev/compare)**++---++## Who it's for++| | Start here |+|---|---|+| **Individual developers** | `pip install repowise` → `repowise init` → query from Claude Code, Cursor, or any MCP agent. Fully local, bring your own key, free under AGPL-3.0. [For developers →](https://www.repowise.dev/for/developers) |+| **Team leads** | Know which PRs to worry about before you merge: change-risk scoring plus the free [Repowise PR Bot](https://github.com/apps/repowise-bot). [For team leads →](https://www.repowise.dev/for/teams) |+| **Engineering leaders** | See how much of your code AI wrote and whether it is healthy: agent provenance, health trends and bus factor, straight from git history. [For engineering leaders →](https://www.repowise.dev/for/engineering-leaders) |+| **Security & compliance** | Reachability-aware CVE triage, secret detection across full git history, and SBOM, on your real dependency graph. [For security →](https://www.repowise.dev/for/security) · [security review →](docs/business/SECURITY_COMPLIANCE.md) |+| **Enterprises** | On-prem and air-gapped, SSO/SCIM, commercial licensing with no AGPL obligation, IP indemnification. [For enterprise →](https://www.repowise.dev/for/enterprise) · [docs/business/COMMERCIAL.md](docs/business/COMMERCIAL.md) |---## For teams & enterprises-[**repowise.dev**](https://www.repowise.dev) is the same engine, fully managed,-at feature parity with self-hosted: every CLI command, every MCP tool, the full-dashboard. We dogfood it on our own codebase: [live snapshot →](https://www.repowise.dev/s/5a6b93fa9a69) · [explore public repos →](https://www.repowise.dev/explore).+[**repowise.dev**](https://www.repowise.dev) is the same engine, fully managed, at+feature parity with self-hosted: every CLI command, every MCP tool, the whole+dashboard. We run it on our own codebase in the open:+[live snapshot →](https://www.repowise.dev/s/5a6b93fa9a69) ·+[explore public repos →](https://www.repowise.dev/explore).-**On top of self-hosting:**-- **Zero ops**: managed deploys & webhooks, auto re-index on every commit.-- **Hosted MCP endpoint**: point any MCP client at one URL, no local server.-- **Repowise PR Bot**: free GitHub App, one deterministic comment per PR- (hotspot touches, hidden coupling, declining health, dead code), zero LLM calls.- [Install →](https://github.com/apps/repowise-bot) · [Learn more →](https://www.repowise.dev/bot)-- **CVE-aware security layer**, **cross-repo intelligence at scale**, and- **integrations** (Slack, Jira/Linear, Confluence/Notion, PagerDuty) *(rolling out)*.+On top of self-hosting: managed deploys and webhooks with auto re-index on every+commit, a hosted MCP endpoint so any client can point at one URL with no local server,+a CVE-aware security layer, cross-repo intelligence at scale, and integrations (Slack,+Jira/Linear, Confluence/Notion, PagerDuty) *(rolling out)*.-What's GA / in development / planned, on-prem topology, SSO/SCIM/RBAC, and-pricing: **[docs/COMMERCIAL.md](docs/COMMERCIAL.md)** · [Get in touch →](https://www.repowise.dev/#contact)+What is GA versus in development, on-prem topology, SSO/SCIM/RBAC and pricing:+**[docs/business/COMMERCIAL.md](docs/business/COMMERCIAL.md)** ·+[Get in touch →](https://www.repowise.dev/#contact)---## Privacy-- **Self-hosted:** your code never leaves your infrastructure, so no code, file paths, or repo names are ever sent. The CLI does report **anonymous, opt-out** usage telemetry (command names + coarse environment only) to help us prioritize; turn it off with `repowise telemetry disable`, `DO_NOT_TRACK=1`, or by running fully offline. [What's collected →](docs/TELEMETRY.md)-- **BYOK:** bring your own Anthropic / OpenAI key. We never see your LLM calls. Zero data retention via Anthropic's API policy.-- **What's stored:** the NetworkX graph, LanceDB embeddings (non-reversible vectors), generated wiki pages, git metadata. Raw source is processed transiently and never persisted.-- **Fully offline:** Ollama + a local embedding model = zero external API calls.+- **Self-hosted:** your code never leaves your infrastructure, so no code, file paths+ or repo names are ever sent. The CLI does report **anonymous, opt-out** usage+ telemetry (command names and coarse environment only) to help us prioritize; turn it+ off with `repowise telemetry disable`, `DO_NOT_TRACK=1`, or by running fully offline.+ [What's collected →](docs/reference/TELEMETRY.md)+- **Bring your own key:** we never see your LLM calls. Zero data retention via+ Anthropic's API policy.+- **What's stored:** the graph, embeddings (non-reversible vectors), generated wiki+ pages, git metadata. Raw source is processed transiently and never persisted.+- **Fully offline:** Ollama plus a local embedding model means zero external calls.++Doing a security review? **[docs/business/SECURITY_COMPLIANCE.md →](docs/business/SECURITY_COMPLIANCE.md)**----## CLI & configuration+## CLI```bash-repowise init [PATH] # index codebase (one-time; --index-only skips LLM)+repowise init [PATH] # index a codebase (one-time; --index-only skips the LLM)repowise serve [PATH] # MCP server + local dashboard-repowise update [PATH] # incremental update (<30s; --workspace for all repos)- # git worktrees auto-seed from the base checkout (docs/WORKTREES.md)+repowise update [PATH] # incremental update (seconds; --workspace for every repo)+repowise watch # auto-sync daemon, re-index on file changerepowise search "<q>" # search the wiki (fulltext / semantic / symbol)-repowise health # code-health KPIs + lowest-scoring files-repowise risk main..HEAD # score a branch / PR range for defect risk+repowise health # code-health KPIs and lowest-scoring files+repowise risk main..HEAD # score a branch or PR range for defect risk+repowise impacted-tests # only the tests a diff actually exercisesrepowise dead-code # unreachable-code report-repowise distill pytest # compact errors-first output (reversible), saves 60–90% tokens-repowise saved # tokens & dollars saved by distillation-repowise doctor # check setup, API keys, store drift+repowise decision list # architectural decisions+repowise distill pytest # compact, errors-first, reversible command output+repowise saved # tokens and dollars saved by distillation+repowise workspace add # multi-repo workspace management+repowise doctor # check setup, API keys, index drift```-`repowise init` generates `.repowise/config.yaml` (provider, model, embedder,-reasoning mode, exclude patterns, git commit depth). Full command set:-**[docs/CLI_REFERENCE.md](docs/CLI_REFERENCE.md)** · config reference:-**[docs/CONFIG.md](docs/CONFIG.md)**.+Every command and flag: **[docs/reference/CLI_REFERENCE.md](docs/reference/CLI_REFERENCE.md)** ·+config: **[docs/reference/CONFIG.md](docs/reference/CONFIG.md)**---@@ -595,18 +510,20 @@ uv run pytest tests/unit/```Full guide, including how to add languages and LLM providers:-[CONTRIBUTING.md](.github/CONTRIBUTING.md).+[CONTRIBUTING.md](.github/CONTRIBUTING.md) · architecture:+[docs/architecture/](docs/architecture/README.md)---## License-AGPL-3.0. Free for individuals, teams, and companies using repowise internally.+AGPL-3.0. Free for individuals, teams and companies using repowise internally.-For commercial licensing (the enterprise security & compliance layer, SSO/SCIM,-RBAC, workflow integrations, priority support and SLA, or embedding repowise in a-product without AGPL obligations), see **[docs/COMMERCIAL.md](docs/COMMERCIAL.md)**-or contact [[email protected]](mailto:[email protected]).+For commercial licensing (the enterprise security and compliance layer, SSO/SCIM, RBAC,+workflow integrations, priority support and SLA, or embedding repowise in a product+without AGPL obligations), see+**[docs/business/COMMERCIAL.md](docs/business/COMMERCIAL.md)** or contact+[[email protected]](mailto:[email protected]).---diff --git a/docs/BENCHMARKS.md b/docs/BENCHMARKS.mdnew file mode 100644index 000000000..eef695706--- /dev/null+++ b/docs/BENCHMARKS.md@@ -0,0 +1,295 @@+# Benchmarks++Every number repowise publishes, with the method behind it and the limits it+carries. Three studies:++1. [Agent efficiency](#1-agent-efficiency) (context, file reads, tool calls)+2. [Distill](#2-distill-command-output-compression) (command-output compression)+3. [Code health predicts defects](#3-code-health-predicts-defects) (defect ranking, plus a CodeScene head-to-head)++The harnesses, raw run logs, and full reports live in+**[repowise-bench](https://github.com/repowise-dev/repowise-bench)**. Nothing+here is measured on a private corpus: every study runs on public codebases so+you can re-run it.++Two ground rules for how we report:++- **The limits ship with the wins.** Each study has a "What this does not show"+ section, and it is the section we would want to read first if someone else+ published these numbers.+- **Token savings are not automatically dollar savings.** Agent-side prompt+ caching now mutes the cost delta on repeated context, even where token counts+ drop sharply. We report tokens, reads, and calls because those are what the+ measurements actually establish.++---++## 1 · Agent efficiency++Most of a coding agent's spend goes to exploration: greping for symbols, reading+candidate files, re-reading them as the context window fills. repowise does that+work once, offline, so the agent skips it on every query.++Paired SWE-QA runs on real repositories, same model and same harness, with and+without repowise's MCP tools:++| Measure | Result |+|---|---|+| Tokens to load context | up to **−96%** |+| File reads | **−69% to −89%** |+| Tool calls | **−49% to −70%** |+| Answer quality | at parity with raw exploration |++The mechanism is context substitution, not a smaller model or a shorter answer.+Loading one commit's context through `get_context` costs **2,391 tokens against+64,039** raw, roughly 27x fewer. On a long multi-step investigation the effect+compounds: **−41% of the context re-read across the whole session**, because the+agent is not re-reading files it already saw to recover a detail.++Reports:+[flask48](https://github.com/repowise-dev/repowise-bench/blob/master/BENCHMARK_REPORT_FLASK48.md) ·+[flask v3](https://github.com/repowise-dev/repowise-bench/blob/master/BENCHMARK_REPORT_FLASK_V3.md) ·+[sklearn48](https://github.com/repowise-dev/repowise-bench/blob/master/BENCHMARK_REPORT_SKLEARN48.md)++An earlier cut of the same paired setup is quoted in+[COMMERCIAL.md](business/COMMERCIAL.md) as −36% cost / −49% tool calls on+`pallets/flask` and −29% cost / −70% tool calls on `scikit-learn`, both at+parity answer quality.++### How to reproduce++1. Clone [repowise-bench](https://github.com/repowise-dev/repowise-bench) and+ the target repository (`pallets/flask` or `scikit-learn`) at the pinned+ commit named in the report you want to reproduce.+2. Index the target: `repowise init <path>`.+3. Run the harness twice over the same SWE-QA question set with the same model:+ once with the repowise MCP server registered, once without. Each report names+ its own question set, model, and pinned commit.+4. Compare the per-run token, file-read, and tool-call totals the harness emits.+ The answer-quality check is a graded comparison of the two answer sets, also+ described in the report.++The `get_context` figure is the cheapest thing to check on your own repo: run+`get_context` on a commit and compare the response size against the raw bytes of+the files it covers.++### What this does not show++- **Not a SWE-bench-style task-completion result.** These runs measure the cost+ and shape of answering questions about a codebase, not the rate at which an+ agent lands a correct patch.+- **Answer quality is "at parity", not "better".** The claim is that the agent+ reaches the same quality of answer for far less exploration. If a benchmark+ showed a quality gain, we would report a quality gain.+- **The ranges are wide because the repos differ.** "up to −96%" is a ceiling+ observed on a specific context-loading comparison, not the average case. Read+ the per-repo reports for the distribution.+- **Prompt caching changes the economics.** With agent-side caching, a large+ repeated context can be cheap in dollars even when it is expensive in tokens.+ Token reduction still buys you context-window headroom and fewer round trips;+ it no longer buys a proportional dollar saving.+- **Same model, same harness, one vendor's agent.** We have not shown the effect+ transfers unchanged to every agent framework.++---++## 2 · Distill: command-output compression++`repowise distill <cmd>` compresses command output *before* the agent reads it:+errors first, exit code preserved, and every omission recoverable through an+inline `[repowise#<ref>]` marker (`repowise expand <ref>`).++Paired runs on a public OSS repository (microdot), one run per command, tokens+estimated at chars/4, which is the same estimator the savings ledger uses:++| Command | Raw tokens | Distilled | Saved |+|---|---:|---:|---|+| `pytest -q` (11 failures) | 3,374 | 1,317 | **61%**, all 11 `FAILED` lines preserved |+| `git log -50` | 3,064 | 331 | **89%** |+| `git diff` (30 commits of history) | 62,833 | 8,635 | **86%** |+| `git log --oneline -30` | 321 | 321 | 0%, already compact, passed through |+| `git status` (clean tree) | 83 | 83 | 0%, too small to distill, passed through |++The two 0% rows are the net-positive guard doing its job: distill never inflates+small output. In an end-to-end spot-check on the same repo with a seeded+11-failure bug, the agent reached the identical root-cause line and fix from+distilled output as from raw. Across the fixture suite, the core filters hold a+median of at least 60% reduction on test/build/lint output with zero error-line+loss, asserted in CI.++Full guide: **[docs/agent/DISTILL.md](agent/DISTILL.md)**.++### How to reproduce++1. Clone microdot (or any repo with a test suite) and index it with+ `repowise init`.+2. For each command, capture the raw output and the distilled output:++ ```bash+ pytest -q > raw.txt 2>&1+ repowise distill pytest -q > distilled.txt 2>&1+ ```++3. Compare sizes with the chars/4 estimator. `repowise saved` reports the same+ accounting cumulatively across a session.+4. To reproduce the failure-preservation claim, diff the `FAILED` lines in+ `raw.txt` against `distilled.txt`. They should match exactly.++### What this does not show++- **One run per command, one repository.** These are point measurements, not a+ distribution over many repos with confidence intervals. Your ratios will+ differ with your test suite's verbosity and your diff sizes.+- **Reduction is not comprehension.** The 61/89/86% figures measure bytes+ removed. The evidence that the removal is safe is narrower: preserved failure+ lines, the CI-asserted zero-error-line-loss fixtures, and a single end-to-end+ agent spot-check. One spot-check is an existence proof, not a rate.+- **`git diff` compresses hardest because diffs are the most redundant input.**+ Do not read 86% as the expected saving on arbitrary commands.+- **Token estimation is chars/4, not a tokenizer.** It is consistent across the+ raw and distilled sides, so the ratio is sound, but the absolute counts are+ approximations.+- **Dollar savings again depend on caching.** `repowise saved` prices tokens at+ your agent's model rate; a cached context reduces the real-world delta.++---++## 3 · Code health predicts defects++The health score is worth something only if the files it flags are the files+that actually break. Scores are collected at a historical commit (T0),+bug-fixing commits are counted over the following six months, and the two are+correlated with strictly no leakage: nothing after T0 feeds the score.++### Cross-project validation++Across **21 open-source repositories spanning all 9 Full-tier languages** and+2,826 files:++- **Mean ROC AUC 0.74** (95% CI 0.68 to 0.79) at identifying the files that go+ on to receive bug fixes, reaching **0.90** on individual repos. ROC AUC is the+ probability the score ranks a known-buggy file worse than a clean one: 0.5 is+ a coin flip, 1.0 is perfect.+- **Survives controlling for file size**: partial Spearman rho = −0.16, so the+ signal is not simply "flag the big files".+- **Out-discriminates the obvious baselines**: +0.10 AUC over recent churn and+ +0.12 AUC over prior-defect history, DeLong p < 1e-9.+- **Holds on an external dataset it never saw**: PROMISE/jEdit CK-metrics, AUC+ **0.76 to 0.78**, within about 0.03 of that dataset's own tuned model. This+ held-out result is the main evidence the markers are not overfit to the+ calibration corpus.++Full report:+**[health-defect/BENCHMARK_REPORT.md](https://github.com/repowise-dev/repowise-bench/blob/master/health-defect/BENCHMARK_REPORT.md)**++### CodeScene head-to-head++CodeScene is the closest commercial product on code health and the only vendor+in the category with a published empirical defect study (the "Code Red"+correlation study, Tornhill and Borg, TechDebt 2022). Both tools were run over+the **same 2,770 files across 9 languages**, scored at the same leakage-free+commit against the same defect labels:++| Axis (paired tests) | repowise | CodeScene |+|---|---:|---:|+| Recall at a 20%-of-lines review budget | **0.173** | 0.074 |+| Effort-aware ranking (Popt) | **0.607** | 0.462 |+| Defect density, size-normalized (defects/KLOC, Alert:Healthy) | **2.18x** | 0.56x |++Ranking by repowise health surfaces **2.3x the defects under a fixed review+budget**. The deltas are Popt +0.144 and recall +0.098, both p = 0.003, paired+and significant.++Full methodology and confidence intervals:+**[health-defect/COMPARISON_REPORT.md](https://github.com/repowise-dev/repowise-bench/blob/master/health-defect/COMPARISON_REPORT.md)**.+A wider capability comparison is in+[COMPETITIVE_ANALYSIS.md](COMPETITIVE_ANALYSIS.md).++### The per-repo self-check++Separate from the cross-project study, every index prints a check against your+own history:++```+Does the score find the bugs? 16/20 lowest-health files had a bug fix in the+last 6 months, 3.3x the 24% baseline (80% vs 24%).+```++Agents can read the same block over MCP with `get_health(include=["accuracy"])`.+It stays silent on repos with too little history to be honest (fewer than 25+scored files, or fewer than 5 recently-fixed files). Details in+[docs/layers/CODE_HEALTH.md](layers/CODE_HEALTH.md#does-the-score-find-the-bugs).++### How to reproduce++1. Clone [repowise-bench](https://github.com/repowise-dev/repowise-bench) and+ open `health-defect/`. The corpus list, the T0 commit per repo, and the+ bug-window definition are all pinned there.+2. The harness checks out each repo at T0, runs the health pass, then labels+ files from `fix:` commits in the following six months and computes ROC AUC,+ Popt, recall@20%, and the DeLong comparisons against the churn and+ prior-defect baselines.+3. The PROMISE/jEdit arm needs no repowise index at all: it scores the published+ CK-metrics dataset with the same marker weights.+4. The CodeScene arm requires a CodeScene account. The comparison is restricted+ to the 2,770 files both tools scored, so it can be re-derived from the two+ exported score sets plus the shared label file.+5. For the per-repo self-check, just run `repowise init` then `repowise health`+ on any repo with enough history.++### What this does not show++- **The per-repo callout is an association, not a forward prediction.**+ `prior_defect` is itself one (down-weighted) input to the score, so the+ "16/20 lowest-health files" line is measured on the indexed history. The+ cross-project study is the leakage-free one.+- **Within a size band the signal is weak.** Among files of similar size the AUC+ sits near 0.49, so part of the headline number is that larger files carry more+ risk. We report this because it is the most important caveat on the AUC.+- **A prior-defects baseline still wins on effort.** Under a fixed review budget+ that baseline finds bugs slightly more efficiently than the repowise score+ (Popt by 0.085), even though the score out-discriminates it on AUC.+- **The CodeScene comparison is scoped.** It covers 2,770 shared files at one+ leakage-free commit. The significant wins are Popt, recall@20%, and defect+ density; the ROC AUC edge is marginal (+0.026, p = 0.054) and precision@20% is+ a tie, not a win. The operating points also differ: CodeScene flags about 27+ files where repowise flags 132, a more conservative threshold, which is why+ its precision reads higher. This is not an unqualified "better than+ CodeScene", and it says nothing about CodeScene's breadth (28+ languages,+ knowledge maps, off-boarding simulation).+- **"Bug fix" means a `fix:` commit touching the file.** That is a proxy for a+ defect, and it inherits every quirk of the corpus repos' commit hygiene.+- **Maintainability and performance are not validated this way.**+ Maintainability weights are expert-set and the performance signal is+ high-precision, low-recall and advisory. Only the defect pillar carries these+ numbers, which is exactly why repowise refuses to blend the three into one+ headline score.++### Related: static performance risk++The performance pillar has its own, separate benchmark. On a 12,000-file corpus,+standard linters (clippy, ruff `PERF`, ESLint, golangci-lint) found **0** of the+cross-function I/O-in-loop cases, while repowise surfaced 557 findings, about 90+of them spanning function boundaries, with 98% in categories ruff has no rule+for. Findings are ordered by impact rather than raw count (NDCG 0.755 against+0.292 for severity-only). Hand-labeled `io_in_loop` precision on an 11-repo OSS+corpus: Go 96.7%, TypeScript 100%, Python 96.2%. One caveat travels with it: the+Rust dialect was new when the benchmark ran and clippy could not be built+end-to-end on the corpus under Windows, so the Rust comparison is+catalogue-level, not a measured head-to-head. Data and method:+[perf-detection](https://github.com/repowise-dev/repowise-bench/tree/master/perf-detection).++---++## See also++- [docs/layers/CODE_HEALTH.md](layers/CODE_HEALTH.md): the score, the 25+ markers, the bands, and the validation section in full.+- [docs/agent/DISTILL.md](agent/DISTILL.md): distill filters, the omission+ store, and the hook.+- [docs/agent/MCP_TOOLS.md](agent/MCP_TOOLS.md): the tools the agent-efficiency+ study exercises.+- [docs/COMPETITIVE_ANALYSIS.md](COMPETITIVE_ANALYSIS.md): capability-level+ comparison against CodeScene, SonarQube, DeepWiki, and others.+- [repowise-bench](https://github.com/repowise-dev/repowise-bench): harnesses,+ raw logs, and every full report.diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.mdindex f6af6de3e..b6e7f748d 100644--- a/docs/CHANGELOG.md+++ b/docs/CHANGELOG.md@@ -95,7 +95,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0### Added- **First-class output-language support.** `repowise init --language <code>` (15 languages: en, ru, es, fr, de, zh, ja, ko, it, pt, nl, pl, tr, ar, hi) sets the natural language for generated wiki pages; advanced interactive mode now asks for it too (English default). The choice persists to `.repowise/config.yaml` so `update` regenerates changed pages in the same language, and the workspace init, workspace generate, and server regenerate paths now honor it instead of silently defaulting to English. Code, file paths, and symbol names stay untranslated. Previously this was config-file-only (#99). (#756)-- **Worktrees just work.** `repowise init` and `repowise update` inside a linked git worktree now auto-detect the base checkout and seed the worktree's index from it, then catch up incrementally; no flags needed. `--seed-from <base>` remains as an explicit override and `--no-seed` forces a cold init. See [WORKTREES.md](WORKTREES.md). (#655 introduced the manual flag; #747 makes it automatic.)+- **Worktrees just work.** `repowise init` and `repowise update` inside a linked git worktree now auto-detect the base checkout and seed the worktree's index from it, then catch up incrementally; no flags needed. `--seed-from <base>` remains as an explicit override and `--no-seed` forces a cold init. See [WORKTREES.md](scale/WORKTREES.md). (#655 introduced the manual flag; #747 makes it automatic.)- **Ruby and Scala promoted to Full health tier.** Both languages now get the full complexity node map and performance-risk dialect, so health scores and perf findings match the depth Python/TypeScript/Go already had. (#745, #749)- **Git stats awards.** The contributor stats view gained biggest-commit, longest-streak, most-imported-file, and dependency awards. (#752)- **Workspace socket-contract detection.** Cross-repo analysis now detects socket-based service contracts alongside HTTP ones. (#710)@@ -719,7 +719,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0- **Pluggable storage seams + capability registries.** New async `IndexStore` / `GraphStore` / `JobStore` interfaces with SQL/in-process default implementations, and process-wide `cli_registry` / `mcp_tool_registry` / `pipeline_hooks` registries so downstream packages can extend the CLI, MCP tool list, and pipeline phases without monkey-patching internals. Behavior is unchanged for OSS users — same CLI commands, same MCP tools, same default storage (#219).### Changed-- **Code-health scoring recalibrated.** The organizational category cap is lifted from −1.0 to −3.5 so the strongest empirical predictors (`developer_congestion`, `untested_hotspot`, `hidden_coupling`) are no longer suppressed, and a per-biomarker weight multiplier was added (`developer_congestion` ×1.5, `untested_hotspot` ×1.3, `function_hotspot` ×1.2). `knowledge_loss` is de-rated to ×0.4 per OSS calibration (legacy code that works gets handed off) — enterprise users can raise it back via per-repo overrides. See the updated category-cap table in `docs/CODE_HEALTH.md` (#221).+- **Code-health scoring recalibrated.** The organizational category cap is lifted from −1.0 to −3.5 so the strongest empirical predictors (`developer_congestion`, `untested_hotspot`, `hidden_coupling`) are no longer suppressed, and a per-biomarker weight multiplier was added (`developer_congestion` ×1.5, `untested_hotspot` ×1.3, `function_hotspot` ×1.2). `knowledge_loss` is de-rated to ×0.4 per OSS calibration (legacy code that works gets handed off) — enterprise users can raise it back via per-repo overrides. See the updated category-cap table in `docs/layers/CODE_HEALTH.md` (#221).- **Health web UI surfaces the new biomarkers.** Glossary entries and biomarker-specific detail views for all four new biomarkers (partner-file chip for `hidden_coupling`, operator count for `complex_conditional`, mod/p80 ratio for `function_hotspot`, median age + recent edits for `code_age_volatility`), recalibrated category caps in the score breakdown (now sorted by applied deduction), and a clickable `function:line` deep-link in the file drawer. The new biomarker details also flow into the AI refactor prompt (#223).- **Doc generation scales to very large repos.** Batch embedding (one model call per generation level instead of N upserts), pipeline checkpoint/resume over the new JobStore seam, and graph metrics computed in SQL. Default behavior is unchanged when the new knobs aren't set (#220).@@ -734,7 +734,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0## [0.10.0] — 2026-05-18### Added-- **Code health layer — a fifth intelligence layer alongside graph / git / docs / decisions.** New `repowise health` command, `health_*` SQLite tables, biomarker engine, and `/repos/[id]/health` web UI surface what hotspots actually *cost* to maintain. Tree-sitter complexity walker feeds 10+ biomarkers across structural (`large_method`, `nested_complexity`, `bumpy_road`, `complex_method`, `brain_method`, `primitive_obsession`), organizational (`developer_congestion`, `knowledge_loss`), test (`untested_hotspot`, `coverage_gap`), and DRY (`dry_violation`, backed by a tokenizer + Rabin-Karp clone detector with co-change correlation) categories. A composite 0–10 score is rolled up per file, per module (NLOC-weighted), and per repo. Findings persist with deterministic refactoring suggestions and an `acknowledged | resolved | false_positive` lifecycle. `HealthSnapshot` writer + trend detector surface declining-health alerts. `.repowise/health-rules.json` supports per-file overrides. `repowise update` runs an incremental upsert so the dashboard stays fresh without re-running the full pipeline. New `repowise health --trend`, `--refactoring-targets`, `--module`, `--file`, and `--coverage` flags; `repowise status` prints a one-line health digest. Parallel biomarker analysis via `asyncio.gather`. Full architecture deep-dive in `docs/CODE_HEALTH.md` (#212).+- **Code health layer — a fifth intelligence layer alongside graph / git / docs / decisions.** New `repowise health` command, `health_*` SQLite tables, biomarker engine, and `/repos/[id]/health` web UI surface what hotspots actually *cost* to maintain. Tree-sitter complexity walker feeds 10+ biomarkers across structural (`large_method`, `nested_complexity`, `bumpy_road`, `complex_method`, `brain_method`, `primitive_obsession`), organizational (`developer_congestion`, `knowledge_loss`), test (`untested_hotspot`, `coverage_gap`), and DRY (`dry_violation`, backed by a tokenizer + Rabin-Karp clone detector with co-change correlation) categories. A composite 0–10 score is rolled up per file, per module (NLOC-weighted), and per repo. Findings persist with deterministic refactoring suggestions and an `acknowledged | resolved | false_positive` lifecycle. `HealthSnapshot` writer + trend detector surface declining-health alerts. `.repowise/health-rules.json` supports per-file overrides. `repowise update` runs an incremental upsert so the dashboard stays fresh without re-running the full pipeline. New `repowise health --trend`, `--refactoring-targets`, `--module`, `--file`, and `--coverage` flags; `repowise status` prints a one-line health digest. Parallel biomarker analysis via `asyncio.gather`. Full architecture deep-dive in `docs/layers/CODE_HEALTH.md` (#212).- **Coverage ingestion (LCOV / Cobertura / Clover).** `repowise health --coverage report.lcov` parses one or more reports (format auto-detected, override with `--coverage-format`), persists per-file line + branch + covered-line sets to a new `coverage_files` table, and feeds two coverage-aware biomarkers — `untested_hotspot` (hotspot files with low coverage *or*, when no coverage is ingested, no paired test file) and `coverage_gap` (significant uncovered surface area on non-test files). New `/api/repos/{id}/health/coverage` endpoint + `/repos/[id]/health/coverage` page with risk × coverage scatter, module rollup, and per-file drilldown (#212).- **Code-health web UX overhaul — tabbed chrome, trend, scatter quadrants, file drawer.** `/health` is now a four-tab surface (Overview / Trend / Coverage / Refactoring) with shared `HealthPageChrome`, sparklines pulled from `/health/trend`, a 5th "Hotspot Health" KPI card, server-side paginated file table with sortable headers + filter chips (Hotspots / Untested / Failing) + path search, biomarker glossary tooltips, severity-distribution bars, slide-over `HealthFileDrawer` with score breakdown by category, impact × effort quadrant on the refactoring page, and one-click status mutation (Acknowledge / Resolved / False positive) wired to a new `PATCH /health/findings/{id}` endpoint. Inline `HealthBadge` chips appear on the hotspots / ownership / graph views so health context follows you across the app (#212).- **AI fix / test prompts on the refactoring and coverage pages.** Per-row `AI fix prompt` / `AI test prompt` buttons open a modal that picks a target agent (Generic / Claude Code / Cursor), previews the generated prompt (with biomarkers, line ranges, severities, score deductions, suggested directions, hard constraints, completion contract — and the explicit "verify each finding against the real code; treat analyzer output as leads, not ground truth" preamble), and copies to clipboard. Prompt builder is generic (`buildAiPrompt` / `buildCoverageAiPrompt`) so future surfaces can reuse it (#212).@@ -831,7 +831,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0## [0.8.0] — 2026-05-11### Added-- **Workspace mode is now first-class across the CLI.** Every relevant command auto-detects whether it's running inside a workspace root and routes accordingly, with a one-line `[workspace] …` notice when it does. New flags `--no-workspace` (force single-repo) and `--repo <alias>` (scope to one repo) on `update`, `status`, `watch`, `doctor`, `costs`, `search`, `dead-code`, `decision`, `generate-claude-md`, `hook install/status/uninstall`. `costs` and `search` also gained `--all` for explicit workspace-wide fan-out. New `Workspace auto-detect` section in [CLI Reference](CLI_REFERENCE.md) (#173).+- **Workspace mode is now first-class across the CLI.** Every relevant command auto-detects whether it's running inside a workspace root and routes accordingly, with a one-line `[workspace] …` notice when it does. New flags `--no-workspace` (force single-repo) and `--repo <alias>` (scope to one repo) on `update`, `status`, `watch`, `doctor`, `costs`, `search`, `dead-code`, `decision`, `generate-claude-md`, `hook install/status/uninstall`. `costs` and `search` also gained `--all` for explicit workspace-wide fan-out. New `Workspace auto-detect` section in [CLI Reference](reference/CLI_REFERENCE.md) (#173).- **`repowise update --workspace` now first-time-indexes previously-skipped repos.** Workspace entries without `.repowise/` no longer short-circuit with `"not_indexed"` — the full index pipeline runs (no LLM cost), `state.json` is written with a `docs_skip_reason` marker, and subsequent `update --repo <alias> --docs` cleanly picks up doc generation (#173).- **`repowise workspace add` defaults to full index + LLM doc generation** when a provider is configured. Inherits provider, model, embedder, and exclude patterns from the primary repo's `.repowise/config.yaml`. `--no-docs` / `--no-index` opt out. Cost-gate prompt still runs before any tokens are spent (#173).- **`repowise doctor --workspace`** validates every workspace entry: directory exists, has `.git/`, state.json ↔ workspace config drift, MCP registration. `--repair` syncs drifted entries from disk and drops dead entries whose directory no longer exists (#173).@@ -991,7 +991,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0- **Workspace dashboard** — contract summary now renders when contracts exist but no cross-repo links have been detected, instead of showing an empty state (#111).### Documentation-- **Computed glossary** — `docs/COMPUTED_GLOSSARY.md` documents every derived metric, score, and signal Repowise computes (PageRank, hotspot score, freshness, confidence tiers, etc.) so the surface vocabulary is discoverable in one place (#127).+- **Computed glossary** — `docs/reference/COMPUTED_GLOSSARY.md` documents every derived metric, score, and signal Repowise computes (PageRank, hotspot score, freshness, confidence tiers, etc.) so the surface vocabulary is discoverable in one place (#127).- **README + UI/UX audit fixes** — confirmation dialogs, mobile responsiveness, accessibility, and empty/error/loading states across the dashboard (#117).### Dependencies@@ -1080,7 +1080,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0- **Swift `extension_declaration` heritage** — extension conformance declarations now contribute heritage relations (`extension_declaration` was missing from Swift's `heritage_node_types`).### Changed-- **Language tier promotion** — C# moves from "Good" to "Full" in `README.md` and `docs/LANGUAGE_SUPPORT.md`. Eight languages now sit at Full tier (was: seven).+- **Language tier promotion** — C# moves from "Good" to "Full" in `README.md` and `docs/layers/LANGUAGE_SUPPORT.md`. Eight languages now sit at Full tier (was: seven).- **Heritage / bindings / dead-code internals refactored into per-language subpackages** — `extractors/heritage.py` and `extractors/bindings.py` (previously 600+ LOC monoliths) and `analysis/dead_code.py` are now subpackages with one file per language plus a re-export shim. Public API (`extract_heritage`, `extract_import_bindings`, `DeadCodeAnalyzer`, etc.) is unchanged.### Testsdiff --git a/docs/QUICKSTART.md b/docs/QUICKSTART.mddeleted file mode 100644index 27cc90297..000000000--- a/docs/QUICKSTART.md+++ /dev/null@@ -1,234 +0,0 @@-# Quickstart--Get repowise running on your codebase in under 5 minutes.--> For the full CLI reference, web UI docs, MCP integration, and troubleshooting, see the [User Guide](USER_GUIDE.md).-------## 1. Install--```bash-pip install "repowise[anthropic]"-```--Or substitute `openai`, `gemini`, `litellm`, or `all` depending on your LLM provider.--For the Codex CLI subscription flow, no provider SDK or API key is required:--```bash-pip install repowise-npm install -g @openai/codex-codex login-```--**Requirements:** Python 3.11+, Git.--## 2. Set Your API Key--```bash-export ANTHROPIC_API_KEY="sk-ant-..."-```--Or `OPENAI_API_KEY`, `GEMINI_API_KEY` — whichever provider you installed.--If you use Codex as the LLM provider, authenticate the Codex CLI instead:--```bash-codex login status-```--On Windows PowerShell:--```powershell-$env:ANTHROPIC_API_KEY = "sk-ant-..."-```--## 3. Initialize--```bash-cd /path/to/your-repo-repowise init-```--Repowise will walk you through an interactive setup — choose a provider, review the cost estimate, and confirm. It parses every file, builds a dependency graph, indexes git history, and generates wiki pages.--Codex users can force project-local MCP/hooks setup and use the Codex CLI provider in one command:--```bash-repowise init --codex --provider codex_cli --yes-```--A typical run on a ~500-file codebase takes 5-15 minutes.--**Want to skip LLM costs?** Use `--index-only` to just parse and analyze without generating docs:--```bash-repowise init --index-only-```--## 4. Explore--Once init completes, you have several ways to use the wiki:--**Search from the terminal:**--```bash-repowise search "authentication"-repowise search "how are errors handled" --mode semantic-```--**Browse in a web UI:**--```bash-repowise serve-# API on http://localhost:7337, Web UI on http://localhost:3000-```--If Node.js 20+ is installed, the web UI starts automatically. Otherwise, use Docker (see below).--**Connect to your AI editor (Claude Code, Codex, Cursor, Cline, Windsurf):**--```bash-repowise mcp --transport stdio-```--> **Automatic for Claude Code:** `repowise init` already registers the MCP server and installs a PostToolUse hook in `~/.claude/settings.json`. Broad or zero-result `Grep`/`Glob` searches can receive graph context, and git operations can notify the agent when the wiki is stale.--> **Claude Code plugin (one-command):** install from the marketplace to get the MCP server, the hook, and `/repowise:*` slash commands together:-> ```text-> /plugin marketplace add repowise-dev/repowise-> /plugin install repowise@repowise-> ```--> **Automatic for Codex:** run `repowise init --codex` to write project-local `.codex/config.toml`, `.codex/hooks.json`, and managed `AGENTS.md`. See [Codex Integration](CODEX.md).--**Cut your agent's context spend (optional):**--```bash-repowise distill pytest -x # compact errors-first output; raw recoverable via `repowise expand`-repowise saved # tokens & dollars saved so far-```--Distill compresses noisy command output (tests, builds, git, searches) before-the agent reads it — **60–90% fewer tokens on noisy commands, with zero-error-line loss** (measured on a public OSS repo). Opt into the Claude Code-rewrite hook at `init` (or `repowise hook rewrite install`) to apply it-automatically, with each rewrite shown for approval. See [Distill](DISTILL.md).--## 5. Keep It in Sync--After pulling changes or editing code:--```bash-repowise update-```--Or install a post-commit hook for automatic sync:--```bash-repowise hook install-```--Or run continuous sync while you work:--```bash-repowise watch-```--Working with `git worktree`? New worktrees seed their index from your main checkout automatically on the first `repowise init` or `repowise update`; no re-indexing. See [WORKTREES.md](WORKTREES.md).--See [Auto-Sync](AUTO_SYNC.md) for all sync methods (hooks, file watcher, GitHub/GitLab webhooks, polling).-------## Multi-Repo Workspace--If your project spans multiple repos, initialize a workspace instead:--```bash-cd my-workspace/ # parent dir containing backend/, frontend/, shared-libs/-repowise init . # scans for git repos, indexes each, runs cross-repo analysis-```--Repowise will scan for git repos, prompt you to select which to index, and run cross-repo analysis (co-changes, API contracts, package dependencies). The MCP server serves all repos from a single instance.--```bash-repowise workspace list # show repos and their status-repowise workspace add ../new-svc # add a repo-repowise update --workspace # update all stale repos-repowise hook install --workspace # install post-commit hooks for all repos-```--Full guide: [Workspaces](WORKSPACES.md)-------## Web UI--Repowise includes a full web dashboard with a repository overview, wiki browser, interactive dependency graph, codebase chat, search, code ownership, hotspots, and dead code detection. In workspace mode, additional pages show a workspace dashboard, cross-repo API contracts, and co-change pairs. The overview page shows a health score, attention items, language breakdown, ownership treemap, quick actions, and a "Graph Intelligence" section with architectural communities and execution flow traces.--### With Node.js installed--If you have Node.js 20+, `repowise serve` auto-downloads and starts the web UI:--```bash-repowise serve-# API: http://localhost:7337-# Web UI: http://localhost:3000-```--The frontend is downloaded once (~50 MB) and cached in `~/.repowise/web/`.--To skip the web UI and only run the API: `repowise serve --no-ui`--### With Docker (no Node.js needed)--```bash-git clone https://github.com/repowise-dev/repowise.git-cd repowise-docker build -t repowise -f docker/Dockerfile .--docker run -p 7337:7337 -p 3000:3000 \- -v /path/to/your-repo/.repowise:/data \- -e GEMINI_API_KEY=your-key \- -e REPOWISE_EMBEDDER=gemini \- repowise-```--### From source (for development)--```bash-git clone https://github.com/repowise-dev/repowise.git-cd repowise && npm install--# Terminal 1: API-repowise serve --no-ui--# Terminal 2: Frontend (with hot reload)-REPOWISE_API_URL=http://localhost:7337 npm run dev --workspace packages/web-```-------## Environment Variables--| Variable | When needed | Description |-|----------|-------------|-------------|-| `ANTHROPIC_API_KEY` | Using Anthropic | Anthropic API key |-| `OPENAI_API_KEY` | Using OpenAI | OpenAI API key |-| `GEMINI_API_KEY` | Using Gemini | Google Gemini API key |-| `REPOWISE_EMBEDDER` | Semantic search | Embedder: `gemini`, `openai`, or `mock` (default) |-| `REPOWISE_DB_URL` | Custom database | SQLite/PostgreSQL connection string (default: `.repowise/wiki.db`) |-| `REPOWISE_API_URL` | Frontend only | Backend URL for the web UI (default: `http://localhost:7337`) |-------## What's Next--- **[User Guide](USER_GUIDE.md)** — full CLI reference, web UI features, MCP setup, common workflows, and troubleshooting-- **[CLI Reference](CLI_REFERENCE.md)** — every command with every flag-- **[MCP Tools](MCP_TOOLS.md)** — full tool reference, configuration, parameters, and examples-- **[Workspaces](WORKSPACES.md)** — multi-repo workspace setup and cross-repo intelligence-- **[Auto-Sync](AUTO_SYNC.md)** — hooks, file watcher, webhooks, polling-- **[Architecture](architecture/ARCHITECTURE.md)** — how repowise is built internallydiff --git a/docs/README.md b/docs/README.mdindex 2f898dc88..9ee39b855 100644--- a/docs/README.md+++ b/docs/README.md@@ -1,63 +1,109 @@# repowise documentation-The codebase intelligence layer for your AI coding agent. Index once, and give-your agent a dependency graph, git history, auto-generated docs, architectural-decisions, and a defect-validated code-health score, all through task-shaped MCP-tools.+Index your codebase once. Your agent stops greping, your team stops guessing+which PR is dangerous, and both get their answers from the same place.-New here? Start with the [Quickstart](QUICKSTART.md) (under 5 minutes, no API-key), then wire up [your agent](MCP_TOOLS.md).+<div align="center">+ <img src="../.github/assets/one-index.svg" alt="One index producing code health, a dependency graph, git history, generated docs, architectural decisions, and ten MCP tools" width="100%" />+</div>++New here? **[Quickstart](start/QUICKSTART.md)** gets you indexed and connected to+your agent in under five minutes, with no API key.++---++## Pick your path++| You are | Start here | Then |+|---|---|---|+| **A developer wiring up an AI agent** | [Quickstart](start/QUICKSTART.md) | [MCP tools](agent/MCP_TOOLS.md) · [Hooks](agent/HOOKS.md) · [Distill](agent/DISTILL.md) |+| **Living in an editor** | [VS Code extension](agent/VSCODE.md) | [Codex](agent/CODEX.md) · [opencode](agent/OPENCODE.md) |+| **A team lead watching what ships** | [Change risk](layers/CHANGE_RISK.md) | [Code health](layers/CODE_HEALTH.md) · [Bug history](layers/BUG_HISTORY.md) |+| **Running many repos** | [Workspaces](scale/WORKSPACES.md) | [Worktrees](scale/WORKTREES.md) · [Auto-sync](scale/AUTO_SYNC.md) |+| **Evaluating repowise to buy it** | [Commercial](business/COMMERCIAL.md) | [Security & compliance](business/SECURITY_COMPLIANCE.md) · [Benchmarks](BENCHMARKS.md) |+| **Contributing** | [Architecture](architecture/README.md) | [CONTRIBUTING](../.github/CONTRIBUTING.md) |++---## Get started| Doc | What it covers ||-----|----------------|-| [QUICKSTART.md](QUICKSTART.md) | Install, index your repo, and connect your agent in under 5 minutes |-| [USER_GUIDE.md](USER_GUIDE.md) | The everyday guide: the CLI, the local dashboard, and every view in it |-| [VSCODE.md](VSCODE.md) | The Repowise VS Code extension: health in the gutter, risk before you push, dashboards in the editor |+| [start/QUICKSTART.md](start/QUICKSTART.md) | Install, index your repo, and connect your agent in under 5 minutes |+| [start/USER_GUIDE.md](start/USER_GUIDE.md) | The everyday guide: how the pieces fit and the workflows they support |+| [start/DASHBOARD.md](start/DASHBOARD.md) | Every view in the local web dashboard, and what each one answers |## Connect your AI agent| Doc | What it covers ||-----|----------------|-| [MCP_TOOLS.md](MCP_TOOLS.md) | The MCP tools, what each answers, and worked multi-tool examples |-| [CODEX.md](CODEX.md) | Wiring repowise into the Codex CLI |-| [OPENCODE.md](OPENCODE.md) | Wiring repowise into opencode |-| [DISTILL.md](DISTILL.md) | `repowise distill`: compress noisy command output before your agent reads it |+| [agent/MCP_TOOLS.md](agent/MCP_TOOLS.md) | The ten task-shaped tools, what each answers, and worked multi-tool examples |+| [agent/HOOKS.md](agent/HOOKS.md) | Proactive delivery: context and warnings that arrive without the agent asking |+| [agent/DISTILL.md](agent/DISTILL.md) | `repowise distill`: compress noisy command output before your agent reads it |+| [agent/VSCODE.md](agent/VSCODE.md) | The VS Code extension: health in the gutter, risk before you push, dashboards in the editor |+| [agent/CODEX.md](agent/CODEX.md) | Wiring repowise into the Codex CLI |+| [agent/OPENCODE.md](agent/OPENCODE.md) | Wiring repowise into opencode |## The intelligence layers| Doc | What it covers ||-----|----------------|-| [INTELLIGENCE_LAYERS.md](INTELLIGENCE_LAYERS.md) | Overview of the five layers: graph, git, docs, decisions, code health |-| [CODE_HEALTH.md](CODE_HEALTH.md) | Defect risk, maintainability, and performance from 25 deterministic markers, plus refactoring targets |-| [REFACTORING.md](REFACTORING.md) | Concrete, graph-aware refactoring plans (Extract Class, Move Method, Break Cycle, …) |-| [CHANGE_RISK.md](CHANGE_RISK.md) | Score any commit or `base..HEAD` range 0–10 for defect risk |-| [LANGUAGE_SUPPORT.md](LANGUAGE_SUPPORT.md) | What works per language, across 15 parsed languages and 9 at the Full tier |-| [WORKSPACES.md](WORKSPACES.md) | Multi-repo intelligence: cross-repo contracts, co-changes, and federated MCP |-| [AUTO_SYNC.md](AUTO_SYNC.md) | Keep the index fresh automatically on every commit |-| [WIKI_STYLES.md](WIKI_STYLES.md) | Selectable documentation styles (comprehensive / reference / tutorial / caveman) |+| [layers/INTELLIGENCE_LAYERS.md](layers/INTELLIGENCE_LAYERS.md) | Overview of the five layers: graph, git, docs, decisions, code health |+| [layers/CODE_HEALTH.md](layers/CODE_HEALTH.md) | Defect risk, maintainability, and performance from 25 deterministic markers |+| [layers/REFACTORING.md](layers/REFACTORING.md) | Concrete, graph-aware refactoring plans (Extract Class, Move Method, Break Cycle) |+| [layers/CHANGE_RISK.md](layers/CHANGE_RISK.md) | Score any commit or `base..HEAD` range 0-10 for defect risk |+| [layers/BUG_HISTORY.md](layers/BUG_HISTORY.md) | Which files and symbols actually get bug-fixed, and how recently |+| [layers/TEST_INTELLIGENCE.md](layers/TEST_INTELLIGENCE.md) | Coverage ingestion, untested hotspots, and running only the tests a diff touches |+| [layers/DECISIONS.md](layers/DECISIONS.md) | Architectural decisions mined from your repo and from your own agent sessions |+| [layers/DEAD_CODE.md](layers/DEAD_CODE.md) | Unreachable files, unused exports, and zombie packages by confidence tier |+| [layers/LANGUAGE_SUPPORT.md](layers/LANGUAGE_SUPPORT.md) | What works per language, across 16 parsed languages and 11 at the Full tier |+| [layers/WIKI_STYLES.md](layers/WIKI_STYLES.md) | Selectable documentation styles (comprehensive / reference / tutorial / caveman) |++## Scale it++| Doc | What it covers |+|-----|----------------|+| [scale/WORKSPACES.md](scale/WORKSPACES.md) | Multi-repo intelligence: cross-repo contracts, co-changes, and federated MCP |+| [scale/WORKTREES.md](scale/WORKTREES.md) | Linked git worktrees seed their index from the base checkout, with no flags |+| [scale/AUTO_SYNC.md](scale/AUTO_SYNC.md) | Keep the index fresh automatically on every commit |+| [../docker/README.md](../docker/README.md) | Running repowise in Docker |## Reference| Doc | What it covers ||-----|----------------|-| [CLI_REFERENCE.md](CLI_REFERENCE.md) | Every command and flag |-| [CONFIG.md](CONFIG.md) | `.repowise/config.yaml`, `health-rules.json`, and environment variables |-| [COMPUTED_GLOSSARY.md](COMPUTED_GLOSSARY.md) | Definitions for every computed metric and term repowise reports |-| [TELEMETRY.md](TELEMETRY.md) | What anonymous telemetry collects, and how to turn it off |-| [UPGRADING.md](UPGRADING.md) | Notes for upgrading between versions |+| [reference/CLI_REFERENCE.md](reference/CLI_REFERENCE.md) | Every command and flag |+| [reference/CONFIG.md](reference/CONFIG.md) | `.repowise/config.yaml`, `health-rules.json`, and environment variables |+| [reference/COMPUTED_GLOSSARY.md](reference/COMPUTED_GLOSSARY.md) | Definitions for every computed metric and term repowise reports |+| [reference/TELEMETRY.md](reference/TELEMETRY.md) | What anonymous telemetry collects, and how to turn it off |+| [reference/UPGRADING.md](reference/UPGRADING.md) | Notes for upgrading between versions || [CHANGELOG.md](CHANGELOG.md) | Release history |+## Evidence++| Doc | What it covers |+|-----|----------------|+| [BENCHMARKS.md](BENCHMARKS.md) | Agent-efficiency, distillation, and defect-prediction results, each with what it does not show |+## Teams & business| Doc | What it covers ||-----|----------------|-| [COMMERCIAL.md](COMMERCIAL.md) | Hosted tier, enterprise (on-prem, SSO/SCIM), and commercial licensing |+| [business/COMMERCIAL.md](business/COMMERCIAL.md) | Hosted tier, enterprise (on-prem, SSO/SCIM), and commercial licensing |+| [business/SECURITY_COMPLIANCE.md](business/SECURITY_COMPLIANCE.md) | What leaves your machine, what gets stored, and the answers your security team wants |## Architecture & internals-How repowise is built, for contributors and the curious. See-[architecture/](architecture/README.md) for the full set: the system-architecture, code-health internals, the language pipeline, graph algorithms,-and more.+How repowise is built, for contributors and the curious.++| Doc | What it covers |+|-----|----------------|+| [architecture/ARCHITECTURE.md](architecture/ARCHITECTURE.md) | The system: package layout, pipelines, MCP server |+| [architecture/code-health.md](architecture/code-health.md) | Health internals: marker computation and calibrated weights |+| [architecture/graph-algorithms.md](architecture/graph-algorithms.md) | Every graph algorithm, the intuition plus the math |+| [architecture/language-support.md](architecture/language-support.md) | The language pipeline and how the tiers work |+| [architecture/chat.md](architecture/chat.md) | Codebase chat: agent loop, streaming, artifact panel |+| [architecture/editor-files.md](architecture/editor-files.md) | How `CLAUDE.md` and `AGENTS.md` get generated |+| [architecture/deep-dives.md](architecture/deep-dives.md) | Systems not covered elsewhere |+| [architecture/pluggable-storage.md](architecture/pluggable-storage.md) | The capability seams: storage, graph, vector, CLI, MCP |+| [design/theme-tokens.md](design/theme-tokens.md) | Resolved design tokens and the WCAG contrast matrix |diff --git a/docs/USER_GUIDE.md b/docs/USER_GUIDE.mddeleted file mode 100644index 3e4a5ee3e..000000000--- a/docs/USER_GUIDE.md+++ /dev/null@@ -1,1081 +0,0 @@-# Repowise User Guide--Everything you need to know to install, use, and get the most out of repowise.-------## Table of Contents--1. [Installation](#installation)-2. [Getting Started](#getting-started)-3. [CLI Command Reference](#cli-command-reference)- - [init](#repowise-init)- - [update](#repowise-update)- - [watch](#repowise-watch)- - [search](#repowise-search)- - [mcp](#repowise-mcp)- - [serve](#repowise-serve)- - [dead-code](#repowise-dead-code)- - [decision](#repowise-decision)- - [generate-claude-md](#repowise-generate-claude-md)- - [export](#repowise-export)- - [reindex](#repowise-reindex)- - [status](#repowise-status)- - [doctor](#repowise-doctor)- - [workspace](#repowise-workspace)- - [hook](#repowise-hook)-4. [Web Dashboard](#web-dashboard)-5. [MCP Integration with AI Editors](#mcp-integration-with-ai-editors)-6. [Proactive Context Enrichment (Hooks)](#proactive-context-enrichment-hooks)-7. [Output Distillation (Distill)](#output-distillation-distill)-8. [Auto-Sync](#auto-sync)-9. [Environment Variables](#environment-variables)-10. [Common Workflows](#common-workflows)-11. [Troubleshooting](#troubleshooting)-------## Installation--### From PyPI--```bash-pip install repowise-```--This installs the core engine, CLI, server, and MCP tools. No LLM provider SDK is included by default, install only the one you need:--```bash-pip install "repowise[anthropic]" # Claude (Anthropic)-pip install "repowise[openai]" # GPT (OpenAI)-pip install "repowise[gemini]" # Gemini (Google)-pip install "repowise[litellm]" # 100+ providers via LiteLLM (Together, Groq, Azure, Bedrock, etc.)-pip install "repowise[all]" # All LLM providers + PostgreSQL support-```--Codex CLI users can use the local subscription/auth flow without an API-key provider SDK:--```bash-pip install repowise-npm install -g @openai/codex-codex login-```--If you plan to use PostgreSQL instead of the default SQLite:--```bash-pip install "repowise[postgres]"-```--### Requirements--- Python 3.11 or later-- Git (repowise analyzes your repository's git history)-- An LLM API key or authenticated Codex CLI (for documentation generation, not needed for analysis-only mode)--### Verify Installation--```bash-repowise --version-repowise --help-```--### From Source with uv--For local development, use the workspace lockfile from the repository root:--```bash-git clone https://github.com/repowise-dev/repowise.git-cd repowise-uv sync --all-packages-uv run repowise --version-```-------## Getting Started--### 1. Set your API key--```bash-# Pick one:-export ANTHROPIC_API_KEY="sk-ant-..."-export OPENAI_API_KEY="sk-..."-export GEMINI_API_KEY="..."-```--For Codex CLI auth:--```bash-codex login status-```--On Windows PowerShell:--```powershell-$env:ANTHROPIC_API_KEY = "sk-ant-..."-```--### 2. Initialize your codebase--```bash-cd /path/to/your-repo-repowise init-```--In interactive mode, repowise asks you to choose:--- **Index-only**, free, no LLM. Parses code, builds dependency graph, indexes git history. Useful for analysis without documentation generation.-- **Full**, uses your chosen LLM to generate human-readable wiki pages for every file and module.-- **Advanced**, fine-tune every option (concurrency, exclusions, commit limits, etc.)--A typical first run on a medium codebase (~500 files) takes 5-15 minutes and costs $1-5 depending on the provider.--### 3. Start using the wiki--After init completes, you have several ways to access the generated documentation:--```bash-repowise search "authentication" # Search from the terminal-repowise serve # Browse in a web UI at localhost:7337-repowise mcp # Connect to Claude Code, Codex, Cursor, etc.-```--### What gets created--```-your-repo/-├── .repowise/-│ ├── wiki.db # SQLite database with all pages, symbols, graph, git data-│ ├── state.json # Sync metadata (last commit, pages, tokens used)-│ ├── config.yaml # Saved configuration (provider, model, excludes)-│ ├── .env # Saved API keys (gitignored)-│ └── lancedb/ # Vector store for semantic search-├── .claude/CLAUDE.md # Auto-generated Claude Code context-├── AGENTS.md # Auto-generated Codex context when enabled-└── .codex/ # Project-local Codex MCP/hooks config when --codex is used-```-------## CLI Command Reference--### `repowise init`--Generate complete wiki documentation for a codebase. This is the starting point.--```bash-repowise init [PATH]-```--**What it does (4 phases):**--1. **Ingestion**, walks every file, parses AST with tree-sitter, builds a dependency graph, indexes git history (churn, hotspots, ownership, bus factor)-2. **Analysis**, detects dead code, extracts architectural decisions from inline markers, READMEs, and git history-3. **Generation**, sends structured prompts to the LLM, generates file-level, module-level, and repo-level wiki pages, plus architecture diagrams-4. **Persistence**, stores everything in `.repowise/wiki.db`, builds search indexes, generates managed editor instruction files--**Options:**--| Flag | Description |-|------|-------------|-| `--provider` | LLM provider: `anthropic`, `openai`, `openrouter`, `gemini`, `deepseek`, `kimi`, `ollama`, `litellm`, `codex_cli`, `mock`. Auto-detected from env vars if not set. |-| `--model` | Model name override (e.g., `claude-sonnet-4-6`, `gpt-5.4-nano`) |-| `--embedder` | Embedder for semantic search: `gemini`, `openai`, `mock`. Auto-detected from env vars. |-| `--index-only` | Skip LLM generation entirely. Only parse, build graph, and index git. Free. |-| `--wiki-style` | Documentation voice: `comprehensive` (default), `caveman` (token-condensed), `reference` (API-manual), `tutorial`. Saved to config; switch later with `repowise restyle`. See [WIKI_STYLES.md](WIKI_STYLES.md). |-| `--language` | Output language for generated wiki pages (`en` default; also `zh`, `ru`, `hi`, `es`, `fr`, `de`, `ja`, `ko`, `it`, `pt`, `nl`, `pl`, `tr`, `ar`). Prose is translated; code, file paths, and symbol names are not. Saved to config so `update` keeps the language. |-| `--dry-run` | Show generation plan and cost estimate without running anything. |-| `--test-run` | Generate docs for only the top 10 files (by PageRank), quick validation. |-| `--skip-tests` | Exclude test files from documentation generation. |-| `--skip-infra` | Exclude infrastructure files (Dockerfiles, Makefiles, Terraform, shell scripts). |-| `--exclude / -x` | Gitignore-style exclusion patterns. Repeatable: `-x vendor/ -x "*.generated.*"` |-| `--concurrency` | Max concurrent LLM calls (default: 5). Higher = faster but more API pressure. |-| `--reasoning` | Reasoning mode for supported providers: `auto`, `off`/`none`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max` (default: `auto`). |-| `--resume` | Resume from the last checkpoint if a previous run was interrupted. |-| `--force` | Regenerate all pages even if they already exist. |-| `--commit-limit` | Max commits to analyze per file (default: 500, max: 10000). Saved to config. |-| `--follow-renames` | Track file renames in git history (slower but more accurate). |-| `--no-claude-md` | Don't generate `CLAUDE.md` at the end. |-| `--agents / --no-agents` | Generate or skip managed `AGENTS.md` for Codex. Persists the preference. |-| `--codex / --no-codex` | Generate or skip project-local Codex MCP config and hooks. |-| `--yes / -y` | Skip cost confirmation prompt (auto-confirms if cost > $2). |--**Examples:**--```bash-# Interactive mode (asks questions)-repowise init--# Fully automated-repowise init --provider anthropic --model claude-sonnet-4-6 --yes--# Use the authenticated local Codex CLI-repowise init --provider codex_cli --codex --yes--# Just index, no LLM cost-repowise init --index-only--# Preview what will happen-repowise init --provider openai --dry-run--# Quick test with 10 files-repowise init --provider gemini --test-run--# OpenRouter with minimal reasoning effort-repowise init --provider openrouter --model openai/gpt-5 --reasoning minimal--# Exclude vendor and generated code-repowise init -x vendor/ -x "*.gen.go" -x "**/__generated__/**"-```-------### `repowise update`--Incrementally update wiki pages for files that changed since the last sync.--```bash-repowise update [PATH]-```--Much faster and cheaper than a full `init`, only regenerates pages for changed files and their dependents.--**How it works:**--1. Diffs `HEAD` against the last sync commit (stored in `state.json`)-2. Re-parses changed files and rebuilds the dependency graph-3. Determines affected pages (direct changes + dependents via cascade analysis)-4. Regenerates only those pages-5. Updates `state.json` and configured editor instruction files--**Options:**--| Flag | Description |-|------|-------------|-| `--provider` | Override LLM provider for this run |-| `--model` | Override model |-| `--since` | Git ref to diff from (overrides `state.json`). Example: `--since v1.0.0` |-| `--reasoning` | Reasoning mode for supported providers: `auto`, `off`/`none`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max`. |-| `--cascade-budget` | Max pages to regenerate per run (default: 30). Prevents runaway regeneration. |-| `--dry-run` | Show what would be updated without regenerating. |-| `--full` | Upgrade a fast (`--mode fast`) index to a full one (single-repo). See below. |-| `--agents / --no-agents` | Generate or skip managed `AGENTS.md` after update. Persists the preference. |--**Upgrading a fast index to full (`--full`):**--If you first indexed a large repo with `repowise init --mode fast` (graph + essential git only, no LLM docs), `repowise update --full` upgrades it to a full index **without redoing the structural work**:--1. Backfills the git tier from *essential* to *full*, per-file blame and repo-wide co-change, via a resumable, checkpointed worker (re-run `--full` to resume if interrupted).-2. Rehydrates the dependency graph straight from the database instead of re-parsing and re-resolving it, so imports/calls/heritage resolution and centrality are **not** recomputed.-3. Generates the LLM documentation that fast mode skipped.--This is cheaper than re-running a full `init`, which would rebuild the graph from scratch. A provider is required, so pass `--provider`/`--model` or have one configured.--**Examples:**--```bash-# Update after pulling changes-git pull-repowise update--# See what changed without regenerating-repowise update --dry-run--# Update since a specific tag-repowise update --since v2.0.0--# Limit regeneration scope-repowise update --cascade-budget 10--# Disable reasoning for a supported provider/model for this run-repowise update --reasoning off--# Upgrade a fast index to a full one (backfill git + generate docs)-repowise update --full --provider anthropic-```-------### `repowise watch`--Watch for file changes and automatically update wiki pages.--```bash-repowise watch [PATH]-```--Runs continuously. Uses filesystem events (via watchdog) to detect saves, debounces them, and triggers `repowise update` automatically. Press `Ctrl+C` to stop.--**Options:**--| Flag | Description |-|------|-------------|-| `--provider` | LLM provider |-| `--model` | Model override |-| `--debounce` | Debounce delay in milliseconds (default: 2000). Collects changes for this long before triggering an update. |--**Example:**--```bash-# Start watching, wiki syncs as you code-repowise watch --debounce 3000-```-------### `repowise search`--Search wiki pages by keyword, meaning, or symbol name.--```bash-repowise search QUERY [PATH]-```--**Options:**--| Flag | Description |-|------|-------------|-| `--mode` | Search mode: `fulltext` (default), `semantic`, `symbol` |-| `--limit` | Max results (default: 10) |--**Search modes:**--- **fulltext**, SQLite FTS. Fast, exact keyword matching.-- **semantic**, Vector similarity search via LanceDB. Understands meaning ("how does auth work?" finds authentication code even without the word "auth"). Falls back to fulltext if vector store is unavailable.-- **symbol**, Searches the symbol index (function names, class names, etc.) with fuzzy matching.--**Examples:**--```bash-# Keyword search-repowise search "rate limiting"--# Semantic search, understands intent-repowise search "how are errors handled" --mode semantic--# Find a symbol-repowise search "AuthService" --mode symbol --limit 20-```-------### `repowise mcp`--Start the MCP (Model Context Protocol) server for AI editor integration.--```bash-repowise mcp [PATH]-```--This is how you connect repowise to Claude Code, Cursor, Cline, Windsurf, and other MCP-compatible editors.--**Options:**--| Flag | Description |-|------|-------------|-| `--transport` | Protocol: `stdio` (default, for editors), `streamable-http` (for HTTP clients), or `sse` (legacy) |-| `--port` | Port for HTTP/SSE transports (default: 7338) |--**Default single-repo MCP tools (11 tools):**--| Tool | What it does |-|------|-------------|-| `get_overview` | Repository architecture summary, key modules, entry points, git health, community summary |-| `get_answer` | One-call RAG: confidence-gated synthesis over the wiki, with cited 2–5 sentence answers and a per-repository question cache |-| `get_context` | Complete context for files/modules/symbols, docs, ownership, decisions, freshness, community membership. Defaults to `compact=True`; pass `compact=False` for the full structure block and importer list. In workspace mode, accepts `repo` parameter. |-| `get_symbol` | Raw source bytes for one indexed symbol with exact line bounds (cheaper/safer than `Read` + offset math) |-| `search_codebase` | Semantic search over wiki with git freshness boosting. In workspace mode, searches across all repos. |-| `get_risk` | Modification risk assessment, hotspot score, dependents, co-change partners, bus factor, blast radius, test gaps, 0–10 risk score |-| `get_change_risk` | Live commit or range risk score, ranked against recent commits in the same repository |-| `get_why` | Why code is structured the way it is, architectural decisions, git archaeology. Three modes: NL search, path-based, health dashboard. |-| `get_dead_code` | Tiered dead code report grouped by confidence with cleanup impact estimates |-| `get_health` | 25-marker code-health scores, dashboard KPIs + lowest-scoring files, or per-file findings; `include` for refactoring suggestions and trend alerts |-| `list_repos` | Repository aliases served by this MCP server |--In workspace mode, tools are workspace-aware, pass `repo="backend"` to target a specific repo or `repo="all"` to query across the entire workspace. The default repo is used when `repo` is omitted.--See [MCP Integration](#mcp-integration-with-ai-editors) for setup instructions. Full tool reference: [MCP_TOOLS.md](MCP_TOOLS.md)-------### `repowise serve`--Start the API server and web UI.--```bash-repowise serve [PATH]-```--If Node.js 20+ is installed, the web frontend is automatically downloaded (once, ~50 MB) and started alongside the API. No separate setup needed.--**Options:**--| Flag | Description |-|------|-------------|-| `--port` | API server port (default: 7337) |-| `--host` | Host to bind to (default: 127.0.0.1) |-| `--workers` | Uvicorn workers (default: 1) |-| `--ui-port` | Web UI port (default: 3000) |-| `--no-ui` | Start API server only, skip the web UI. |--**Examples:**--```bash-# Start everything (API + Web UI)-repowise serve--# API only-repowise serve --no-ui--# Custom ports-repowise serve --port 8080 --ui-port 8081-```-------### `repowise dead-code`--Detect dead and unused code in your codebase.--```bash-repowise dead-code [PATH]-```--**Options:**--| Flag | Description |-|------|-------------|-| `--min-confidence` | Minimum confidence threshold (default: 0.4) |-| `--safe-only` | Only show findings marked safe to delete |-| `--kind` | Filter: `unreachable_file`, `unused_export`, `unused_internal`, `zombie_package` |-| `--format` | Output: `table` (default), `json`, `md` |--**Examples:**--```bash-# Show all findings-repowise dead-code--# Only safe-to-delete items-repowise dead-code --safe-only --min-confidence 0.8--# JSON output for scripting-repowise dead-code --format json--# Only unused exports-repowise dead-code --kind unused_export-```-------### `repowise decision`--Manage architectural decision records. Repowise automatically extracts decisions from inline markers (`// DECISION: ...`), READMEs, and git history. You can also add them manually.--**Subcommands:**--```bash-repowise decision list [PATH] # List decisions-repowise decision show ID [PATH] # Show full details of a decision-repowise decision add [PATH] # Interactively add a new decision-repowise decision confirm ID [PATH] # Confirm a proposed decision (set to active)-repowise decision dismiss ID [PATH] # Dismiss a proposal (sticky; never re-proposed)-repowise decision deprecate ID [PATH] # Mark as deprecated-repowise decision health [PATH] # Decision health dashboard-```--**List options:**--| Flag | Description |-|------|-------------|-| `--status` | Filter: `active`, `proposed`, `deprecated`, `superseded`, `all` |-| `--source` | Filter: `git_archaeology`, `inline_marker`, `readme_mining`, `cli`, `all` |-| `--proposed` | Shortcut for `--status proposed` |-| `--stale-only` | Only show stale decisions |--**Examples:**--```bash-# See all active decisions-repowise decision list --status active--# Review auto-extracted proposals-repowise decision list --proposed--# Decision health overview-repowise decision health--# Confirm a proposed decision-repowise decision confirm abc123--# Deprecate, replaced by another-repowise decision deprecate abc123 --superseded-by def456-```-------### `repowise generate-claude-md`--Generate or update `CLAUDE.md` with codebase intelligence.--```bash-repowise generate-claude-md [PATH]-```--`CLAUDE.md` gives AI editors (Claude Code, Cursor, etc.) instant context about your codebase, architecture, key modules, hotspots, entry points, and conventions.--If you have custom instructions at the top of your `CLAUDE.md`, they are preserved. Only the auto-generated section (between markers) is updated.--**Options:**--| Flag | Description |-|------|-------------|-| `--output / -o` | Custom output path (default: `CLAUDE.md` in repo root) |-| `--stdout` | Print to stdout instead of file |-------### `repowise export`--Export wiki pages to files.--```bash-repowise export [PATH]-```--**Options:**--| Flag | Description |-|------|-------------|-| `--format` | `markdown` (default), `html`, `json` |-| `--output / -o` | Output directory (default: `.repowise/export`) |-| `--full` | Include decisions, dead code findings, hotspots, and provenance metadata (JSON format only) |--**Examples:**--```bash-# Export all pages as markdown files-repowise export--# Export as a single JSON file-repowise export --format json --output ./wiki-export/--# Export as HTML-repowise export --format html-```-------### `repowise reindex`--Rebuild vector search index from existing wiki pages. Useful after changing embedders or if the vector store gets corrupted.--```bash-repowise reindex [PATH]-```--**Options:**--| Flag | Description |-|------|-------------|-| `--embedder` | Embedder: `gemini`, `openai`, `auto` (default: auto-detect from config) |-| `--batch-size` | Pages per embedding batch (default: 20) |-------### `repowise status`--Show wiki sync state and page statistics.--```bash-repowise status [PATH]-```--Displays: last sync commit, total pages, pages by type, provider used, total tokens consumed.-------### `repowise doctor`--Run health checks on the wiki setup.--```bash-repowise doctor [PATH]-```--Checks:-- Git repository valid-- `.repowise/` directory exists-- Database connectable with page count-- `state.json` valid-- Providers installed and importable-- Stale page count-- **CLI version**, best-effort check of your installed CLI against the latest- PyPI release--The CLI version row is advisory: when a newer release exists it prints the-right upgrade command for your install method (`uv tool upgrade repowise`,-`pipx upgrade repowise`, or `python -m pip install -U repowise`) plus a reminder-to **restart Claude/Codex/Cursor or any MCP client** afterwards. It never-upgrades automatically and never fails `doctor` when PyPI is unavailable.-------### `repowise workspace`--Manage multi-repo workspaces. See [Workspaces](WORKSPACES.md) for the full guide.--**Subcommands:**--```bash-repowise workspace list # Show all repos with index status-repowise workspace add <path> [--alias NAME] # Add a repo to the workspace-repowise workspace remove <alias> # Remove a repo (doesn't delete files)-repowise workspace scan # Re-scan for new repos-repowise workspace set-default <alias> # Change the default repo for MCP queries-```--**Examples:**--```bash-# Initialize a workspace-cd my-workspace/-repowise init .--# Add a repo that lives outside the workspace directory-repowise workspace add /path/to/external-repo --alias api-gateway--# Update all workspace repos. Each repo regenerates docs or refreshes-# index-only based on its own docs_enabled, just like a single-repo update.-repowise update --workspace--# Force docs regeneration across every stale repo (needs a provider per repo)-repowise update --workspace --docs--# Update just one repo-repowise update --repo backend-```-------### `repowise hook`--Manage post-commit git hooks that auto-sync the wiki after every commit.--```bash-repowise hook install # Install hook for current repo-repowise hook install --workspace # Install for all workspace repos-repowise hook status # Check if hooks are installed-repowise hook status --workspace # Check all workspace repos-repowise hook uninstall # Remove the hook-repowise hook uninstall --workspace-```--The hook is marker-delimited, so it coexists safely with other tools' hooks (linters, formatters, etc.) in the same `post-commit` file. The hook runs `repowise update` in the background, your terminal is never blocked.-------## Web Dashboard--Repowise includes a full web dashboard built with Next.js, React, and D3.js.--### Automatic (with Node.js)--If you have Node.js 20+ installed, `repowise serve` handles everything:--```bash-repowise serve-# API: http://localhost:7337-# Web UI: http://localhost:3000-```--On first run, the pre-built frontend is downloaded (~50 MB) and cached in `~/.repowise/web/`. Subsequent runs start instantly.--### Docker (no Node.js needed)--```bash-git clone https://github.com/repowise-dev/repowise.git-cd repowise--# Build the image (one-time)-docker build -t repowise -f docker/Dockerfile .--# Run with your indexed repo's .repowise directory-docker run -p 7337:7337 -p 3000:3000 \- -v /path/to/your-repo/.repowise:/data \- -e GEMINI_API_KEY=your-key \- -e REPOWISE_EMBEDDER=gemini \- repowise-```--Or with docker compose:--```bash-git clone https://github.com/repowise-dev/repowise.git-cd repowise-export REPOWISE_DATA=/path/to/your-repo/.repowise-export GEMINI_API_KEY=your-key-docker compose -f docker/docker-compose.yml up-```--Open **http://localhost:3000** for the Web UI, **http://localhost:7337** for the API.--### From source (for development)--For working on the frontend code with hot reload:--```bash-# Terminal 1, API only-repowise serve --no-ui--# Terminal 2, Frontend with hot reload-cd /path/to/repowise-npm install-REPOWISE_API_URL=http://localhost:7337 npm run dev --workspace packages/web-```--On Windows PowerShell:--```powershell-$env:REPOWISE_API_URL = "http://localhost:7337"-npm run dev --workspace packages/web-```--Open **http://localhost:3000** in your browser.--### Navigation--Two global pages sit outside any repo: **Dashboard** (`/`, lists indexed repos and recent job status) and **Settings** (`/settings`, API connection, default provider/model, embedder, webhook/MCP setup).--Everything else lives under a repo: `/repos/{id}/...`. The sidebar groups repo pages like this:--| Page | Route | What it's for |-|------|-------|----------------|-| Overview | `/overview` | Repo health dashboard: aggregate score, attention panel (what needs action), hotspots, decisions timeline, community graph |-| Docs | `/docs` | Wiki browser: AI-generated documentation for every file and module, with an Explorer tab and a Coverage/freshness tab |-| Architecture | `/architecture` | One page, five tabs: Communities (default), Explore (full dependency graph with dead-code/hotspot overlays), Coupling (change-coupling graph), Dependencies (declared third-party deps), Symbols (functions, classes, exports) |-| Knowledge Graph | `/knowledge-graph` | The curated, layered architecture view (guided tour, personas, drill-down from system to module to file) |-| Code Health | `/code-health` | One page, seven tabs: Triage (default), Findings, Hotspots & churn, Coverage, Dead code, Impact (blast radius), Security |-| Refactoring | `/refactoring` | Ranked refactoring plan cards, with copy-to-agent export |-| Files | `/files` | Browsable file tree |-| Commits / Contributors / Decisions | `/commits`, `/owners`, `/decisions` | Grouped under "People & History": git activity, ownership/bus-factor risk, and architectural decisions |-| Chat | `/chat` | Natural-language Q&A over the codebase, using the same MCP tools as editor integrations |-| Stats / Usage & savings / Settings | `/stats`, `/costs`, `/settings` | Grouped under repo Settings: "by the numbers" stats, distill/LLM cost tracking, per-repo config |--A global command palette (`Ctrl+K` / `Cmd+K`, available on every page) is the fastest way to jump between pages or repos; it replaced the old standalone Search page.--Older top-level routes (`/risk`, `/hotspots`, `/security`, `/health`, `/coverage`, `/graph`, `/c4`, `/coupling`, `/ownership`, `/blast-radius`) still resolve and redirect into the tabs above, but don't link to them directly; use the tabbed pages instead.--**Index-only repos:** the dashboard itself isn't gated by mode. Views that depend on the generated wiki (Docs, Chat, and parts of Overview) just show empty or thin content if you ran `repowise init --index-only`; everything else (Architecture, Code Health, Files, Commits, Contributors) works off the parsed graph and git history alone.--### Workspace mode--In a multi-repo workspace, a collapsible **Workspace** nav section appears above the per-repo pages:--| Page | Route | What it's for |-|------|-------|----------------|-| Overview | `/workspace` | Aggregate stats across all repos |-| System Map | `/workspace/system-map` | Code-derived service diagram (HTTP, gRPC, events, package deps, co-change), health-colored, with drill-down into contracts |-| Conformance | `/workspace/conformance` | Dependency-cycle detection and a dependency structure matrix (DSM) |-| Contracts | `/workspace/contracts` | Detected API contracts (HTTP, gRPC, message topics) with provider/consumer matching |-| Co-Changes | `/workspace/co-changes` | Cross-repo file pairs ranked by co-change strength |-------## MCP Integration with AI Editors--### Claude Code--Add to your project's `.claude/settings.json` or run:--```bash-repowise mcp /path/to/your-repo --transport stdio-```--Claude Code auto-detects the `.repowise/.mcp.json` generated by `repowise init`.--### Codex--Run:--```bash-repowise init --codex-```--This writes project-local `.codex/config.toml`, `.codex/hooks.json`, and managed `AGENTS.md`. The Codex config uses `repowise mcp` from the repository root, so it does not require editing global `~/.codex/config.toml`. See [Codex Integration](CODEX.md).--### Cursor / Windsurf / Cline--Add an MCP server entry pointing to:--```json-{- "command": "repowise",- "args": ["mcp", "/path/to/your-repo", "--transport", "stdio"]-}-```--### HTTP MCP clients--```bash-repowise mcp /path/to/your-repo --transport streamable-http --port 7338-```--Connect to `http://localhost:7338/mcp`.--### What AI editors can do with MCP--Once connected, your AI editor can:-- Get an architecture overview before starting any task-- Fetch rich context for files before reading/modifying them (docs, ownership, decisions, freshness)-- Assess modification risk before changing hotspot files-- Understand *why* code is structured a certain way (architectural decisions)-- Search the wiki semantically ("how do we handle retries?")-- Trace dependency paths between modules-- Find dead code to clean up-- Generate architecture diagrams-------## Proactive Context Enrichment (Hooks)--Repowise installs lightweight AI-agent hooks during editor setup so graph, git,-health, and decision context reaches your agent (and your index stays fresh) with-zero effort. They fire from editor lifecycle and tool-use events, never call an-LLM or the network, and fail silently.--The full inventory, the SessionStart freshness + relevant-decisions block, the-PostToolUse Grep/Glob enrichment, git/edit freshness, read-intelligence, and-edit-time "governed by" notices, the opt-in distill command-rewrite hook, the-Codex hooks, and the exact `settings.json` entries, lives in a dedicated guide:-**[HOOKS.md →](HOOKS.md)**.--The post-commit git hook that auto-syncs the wiki is documented under-[`repowise hook`](#repowise-hook) above and in [AUTO_SYNC.md](AUTO_SYNC.md).-------## Output Distillation (Distill)--Most of an agent's context is spent on command output it never needed, 300-lines of passing tests to find 4 failures, a full `git log` for "what changed-recently". Distill compresses noisy output **before the agent reads it**,-errors-first and fully reversible. Full guide: [DISTILL.md](DISTILL.md).--**Try it from the terminal:**--```bash-repowise distill pytest -x # compact errors-first rendering, exit code preserved-repowise distill git log -50 # recent subjects + counts instead of full bodies-```--Dropped content is referenced by an inline marker and always recoverable:--```-[repowise#a1b2c3d4e5f6: 230 lines omitted (~6.1k tokens); restore: repowise expand a1b2c3d4e5f6]-```--```bash-repowise expand a1b2c3d4e5f6 # full original output-repowise expand a1b2c3d4e5f6 -q "FAILED" # just the matching lines-```--**Make your agent use it.** Two complementary ways:--1. `repowise init` adds an "Output Distillation" section to the managed- `CLAUDE.md`, so the agent prefers `repowise distill <cmd>` voluntarily -- works in any agent that runs shell commands.-2. Opt into the **command-rewrite hook** (Claude Code): noisy commands are- rewritten to `repowise distill <cmd>` automatically, pending your approval.--```bash-repowise hook rewrite install # or answer Yes at the `repowise init` prompt-```--The hook never rewrites pipes/compound commands or watch modes, and defaults-to `ask` so you see every rewritten command. Per-repo behavior lives under-`distill.commands` in `.repowise/config.yaml` (see [CONFIG.md](CONFIG.md)).--**Skeletons for large files.** For structure-level questions about an indexed-file, `get_context(["path"], include=["skeleton"])` returns every signature-plus the bodies of only the most central symbols, typically ~15% of the full-file's tokens. After a large `Read`, the PostToolUse hook nudges the agent-with the skeleton's cost once per file per session.--**Track what you save:**--```bash-repowise saved # per-filter rollup, totals, est. dollars-repowise saved --by day-```--The Costs page in the web UI leads with the same results — total agent tokens-and dollars saved, split across distill and the MCP tools — over the-per-operation and per-provider spend breakdown. The ledger combines the distill-command/hook path with MCP tool-response savings.-------## Auto-Sync--repowise supports five methods to keep your wiki in sync with code changes. See [Auto-Sync](AUTO_SYNC.md) for the full guide.--| Method | Command | Best for |-|--------|---------|----------|-| **Post-commit hook** | `repowise hook install` | Set-and-forget local dev |-| **File watcher** | `repowise watch` | Active development |-| **GitHub webhook** | Server endpoint | Teams, CI/CD |-| **GitLab webhook** | Server endpoint | Teams, CI/CD |-| **Polling fallback** | Automatic with `repowise serve` | Safety net |--### Quick setup--```bash-# Post-commit hook (recommended)-repowise hook install-repowise hook install --workspace # all workspace repos--# File watcher-repowise watch-repowise watch --workspace # all workspace repos-```-------## Environment Variables--| Variable | Required | Description |-|----------|----------|-------------|-| `ANTHROPIC_API_KEY` | If using Anthropic | Anthropic API key |-| `ANTHROPIC_BASE_URL` | No | Base URL override for Anthropic-compatible APIs |-| `OPENAI_API_KEY` | If using OpenAI | OpenAI API key |-| `OPENAI_BASE_URL` | No | Base URL override for OpenAI-compatible APIs |-| `GEMINI_API_KEY` | If using Gemini | Google Gemini API key |-| `GEMINI_BASE_URL` | No | Base URL override for Gemini-compatible APIs |-| `OLLAMA_BASE_URL` | If using Ollama | Ollama server URL (default: `http://localhost:11434`) |-| `LITELLM_BASE_URL` | No | Base URL override for LiteLLM proxy |-| `LITELLM_API_BASE` | No | LiteLLM base URL alias (same as `LITELLM_BASE_URL`) |-| `REPOWISE_DB_URL` | No | Database URL override (default: `.repowise/wiki.db`) |-| `REPOWISE_EMBEDDER` | No | Embedder for semantic search: `gemini`, `openai`, `mock` |-| `REPOWISE_API_URL` | Frontend only | Backend URL for the web UI (default: `http://localhost:7337`) |-| `REPOWISE_API_KEY` | No | Optional API key to protect the server |-------## Common Workflows--### First-time setup for a single repo--```bash-pip install "repowise[anthropic]"-export ANTHROPIC_API_KEY="sk-ant-..."-cd /path/to/your-project-repowise init-repowise hook install # auto-sync after every commit-```--### First-time setup for a multi-repo workspace--```bash-pip install "repowise[anthropic]"-export ANTHROPIC_API_KEY="sk-ant-..."-cd /path/to/workspace/ # parent dir with backend/, frontend/, etc.-repowise init .-repowise hook install --workspace-```--### Daily development workflow--```bash-# Option A: Manual update after pulling-git pull-repowise update--# Option B: Continuous sync while coding-repowise watch--# Option C: Set-and-forget (if hook installed)-# Just code and commit, the hook handles it-```--### Before a code review--```bash-# Check what's at risk-repowise dead-code --safe-only--# Review decision health-repowise decision health--# See hotspots-repowise status-```--### Team onboarding--```bash-# Generate full wiki for the new team member-repowise init --provider openai--# They can browse it-repowise serve--# Or use it in their editor-repowise mcp --transport stdio-```--### CI/CD integration--```bash-# Index-only in CI (free, no LLM calls)-repowise init --index-only--# Export docs as markdown for static hosting-repowise export --format markdown --output ./docs/wiki/-```--### Switching LLM providers--```bash-# Re-generate with a different provider-repowise init --provider openai --model gpt-5.4-nano --force--# Or just change the model for future updates-# (edit .repowise/config.yaml, then:)-repowise update --provider gemini-```-------## Troubleshooting--**"Provider X requires the Y package"**-Install the optional dependency: `pip install "repowise[anthropic]"` (or openai, gemini, litellm).--**Empty search results with semantic mode**-Check that an embedder is configured. Run `repowise reindex --embedder gemini` to rebuild the vector store.--**"embedder.mock_active" warning**-Set `REPOWISE_EMBEDDER=gemini` (or `openai`) for real vector search. Mock embedder produces random vectors, semantic search won't work meaningfully.--**Stale pages after code changes**-Run `repowise update` to sync. Or use `repowise watch` for automatic syncing.--**Cost seems high**-Use `--dry-run` to see the cost estimate first. Use `--test-run` to validate with just 10 files. Use `--skip-tests --skip-infra` to reduce scope. Lower `--concurrency` to slow down API usage.--**init was interrupted**-Run `repowise init --resume` to pick up where it left off.--**Vector store corrupted**-Run `repowise reindex` to rebuild from existing wiki pages.--**Doctor says database has 0 pages**-The init either failed or was run with `--index-only`. Run `repowise init` with a provider to generate pages.--**Frontend shows empty repo list**-Make sure `REPOWISE_DB_URL` (or `REPOWISE_API_URL` for the frontend) points to the correct database. The backend and frontend must point to the same wiki DB.--**CORS errors in the browser**-Ensure both the backend (`repowise serve`) and frontend (`npm run dev`) are running. The backend allows all origins by default.diff --git a/docs/CODEX.md b/docs/agent/CODEX.mdsimilarity index 100%rename from docs/CODEX.mdrename to docs/agent/CODEX.mddiff --git a/docs/DISTILL.md b/docs/agent/DISTILL.mdsimilarity index 98%rename from docs/DISTILL.mdrename to docs/agent/DISTILL.mdindex 5e5cad244..45288b483 100644--- a/docs/DISTILL.md+++ b/docs/agent/DISTILL.md@@ -396,7 +396,7 @@ and whether the rewrite hook is installed.## See also-- [CLI_REFERENCE.md](CLI_REFERENCE.md) — `distill`, `expand`, `saved`, `hook rewrite`+- [CLI_REFERENCE.md](../reference/CLI_REFERENCE.md) — `distill`, `expand`, `saved`, `hook rewrite`- [MCP_TOOLS.md](MCP_TOOLS.md) — `_meta.omitted`, skeleton include, `get_symbol` ref overload-- [CONFIG.md](CONFIG.md) — the `distill:` block-- [INTELLIGENCE_LAYERS.md](INTELLIGENCE_LAYERS.md) — the five layers whose index Distill reuses+- [CONFIG.md](../reference/CONFIG.md) — the `distill:` block+- [INTELLIGENCE_LAYERS.md](../layers/INTELLIGENCE_LAYERS.md) — the five layers whose index Distill reusesdiff --git a/docs/HOOKS.md b/docs/agent/HOOKS.mdsimilarity index 97%rename from docs/HOOKS.mdrename to docs/agent/HOOKS.mdindex d9ab27f68..bfccefd2e 100644--- a/docs/HOOKS.md+++ b/docs/agent/HOOKS.md@@ -44,7 +44,7 @@ repowise hook uninstall # remove itThe hook is **marker-delimited**, so it coexists safely with other tools' hooks(linters, formatters, commit-msg checks) in the same `post-commit` file: repowiseonly ever touches the block between its own markers. See-[AUTO_SYNC.md](AUTO_SYNC.md) for the full sync model, including how git worktrees+[AUTO_SYNC.md](../scale/AUTO_SYNC.md) for the full sync model, including how git worktreesseed from the base checkout.> Prefer to keep updates manual? Skip this hook and run `repowise update`@@ -133,8 +133,8 @@ Every injected decision id is recorded locally inchecks whether the guidance was followed or contradicted by your corrections inthat session, and relaxes or bumps the decision's staleness accordingly, soguidance that stops being true stops being injected. This is the feedback loop-behind "learns from your sessions" (see the [README](../README.md) and-[decisions layer](INTELLIGENCE_LAYERS.md)).+behind "learns from your sessions" (see the [README](../../README.md) and+[decisions layer](../layers/INTELLIGENCE_LAYERS.md)).---@@ -159,7 +159,7 @@ repowise hook rewrite uninstallre-prompting just because its string changed.Per-repo behavior lives under `distill.commands` in `.repowise/config.yaml`-([CONFIG.md](CONFIG.md)). Track what it saved with `repowise saved`.+([CONFIG.md](../reference/CONFIG.md)). Track what it saved with `repowise saved`.---diff --git a/docs/MCP_TOOLS.md b/docs/agent/MCP_TOOLS.mdsimilarity index 98%rename from docs/MCP_TOOLS.mdrename to docs/agent/MCP_TOOLS.mdindex ae620892a..ea604eaf7 100644--- a/docs/MCP_TOOLS.md+++ b/docs/agent/MCP_TOOLS.md@@ -318,8 +318,8 @@ When `changed_files` is passed, the response leads with a `directive` block. Its- `will_break_consumers`: services in *other* repos that depend on this one (structural impact), each with `repo`, `service`, `distance`, `score`, and the edge kinds carrying the impact.- `missing_cross_repo_cochanges`: services in other repos that historically co-change with this one but aren't in the diff.-- `breaking_changes`: provider contracts in this repo that changed *incompatibly* since the last index (a removed route or field, a type or field-number change, a newly-required field), each with the changed `contract_id`, the change `kind`/`severity`, and the `impacted_consumers` (repo, service, file) it endangers across repos. Schema-level truth, distinct from the topology-level `will_break_consumers`; non-breaking changes (added optional field, new endpoint) never appear. See [Breaking-Change Guard](WORKSPACES.md#breaking-change-guard).-- `conformance_violations`: declared dependency-rule breaches the diff's repo participates in, each with the offending `source`/`target` services, the `rule` (e.g. `frontend !-> db`), and `edge_kind`. See [Architecture Conformance](WORKSPACES.md#architecture-conformance).+- `breaking_changes`: provider contracts in this repo that changed *incompatibly* since the last index (a removed route or field, a type or field-number change, a newly-required field), each with the changed `contract_id`, the change `kind`/`severity`, and the `impacted_consumers` (repo, service, file) it endangers across repos. Schema-level truth, distinct from the topology-level `will_break_consumers`; non-breaking changes (added optional field, new endpoint) never appear. See [Breaking-Change Guard](../scale/WORKSPACES.md#breaking-change-guard).+- `conformance_violations`: declared dependency-rule breaches the diff's repo participates in, each with the offending `source`/`target` services, the `rule` (e.g. `frontend !-> db`), and `edge_kind`. See [Architecture Conformance](../scale/WORKSPACES.md#architecture-conformance).- `dependency_cycles`: circular service dependencies involving this repo, each with the participating `nodes` and `length`.**When to use:** Before modifying files, especially hotspots. Understand what could break, who to involve in review, and whether tests cover the affected area.@@ -528,7 +528,7 @@ The opt-in enrichments:file-leverage-first (by the file's `weighted_deficit`, then per-plan impact), soplans on the files that move the headline surface first; `refactoring_plans_total`reports the full count behind the cap. Each plan echoes its- `file_weighted_deficit`. Full shapes in [`docs/REFACTORING.md`](REFACTORING.md).+ `file_weighted_deficit`. Full shapes in [`docs/layers/REFACTORING.md`](../layers/REFACTORING.md).- **dimension filter** narrows the returned findings to one pillar. Pair with`"biomarkers"` for the full (uncapped) finding set, e.g.`include=["biomarkers", "performance"]`.@@ -584,7 +584,7 @@ Cross-repo downstream impact: if you change this service, what breaks across the**Returns:** The impacted services ranked by impact `score`, each with `distance` (hops), `structural` (a real dependency vs co-change only), and the edge kinds that carried the impact; plus `impacted_repos`, `structural_count` / `behavioral_count`, `total_impacted`, and any `unresolved_targets`.-**When to use:** Before changing a high-fan-out provider, see who consumes it across repo boundaries. Structural impact ("will break") outweighs behavioral co-change ("may drift"). Reads the same system graph the [Live System Map](WORKSPACES.md#live-system-map) renders.+**When to use:** Before changing a high-fan-out provider, see who consumes it across repo boundaries. Structural impact ("will break") outweighs behavioral co-change ("may drift"). Reads the same system graph the [Live System Map](../scale/WORKSPACES.md#live-system-map) renders.```get_blast_radius(targets=["backend"])@@ -603,7 +603,7 @@ Architecture governance: does the live system graph obey the declared dependency**Returns:** `violations` (each with the offending `source`/`target` services, the `rule_source`/`rule_target` matchers that fired, and the `edge_kind`), `cycles` (each with the participating `nodes` and `length`), and the `violation_count` / `cycle_count` / `rules_evaluated` rollups.-**When to use:** Before a refactor that changes service boundaries, or to audit whether the live architecture still matches the intended one. Rules are declared under `conformance:` in `.repowise-workspace.yaml`. See [Architecture Conformance](WORKSPACES.md#architecture-conformance).+**When to use:** Before a refactor that changes service boundaries, or to audit whether the live architecture still matches the intended one. Rules are declared under `conformance:` in `.repowise-workspace.yaml`. See [Architecture Conformance](../scale/WORKSPACES.md#architecture-conformance).```get_conformance()@@ -616,7 +616,7 @@ The one evaluative read of the whole system: how coupled is it, where is the arc**Returns:** `score` (1-10), `architecture_type` (`core-periphery` or `hierarchical`), `propagation_cost_pct` (share of other services the average service reaches), `core_size` / `core_ratio` / `core_members` (the largest cyclic group), `cycle_count`, `conformance_violations`, a `role_breakdown` (count of Core / Shared / Control / Peripheral services), and a one-line `summary`.-**When to use:** Before a cross-service refactor, or to gauge and compare overall system structure over time. See [Architecture Metrics](WORKSPACES.md#architecture-metrics).+**When to use:** Before a cross-service refactor, or to gauge and compare overall system structure over time. See [Architecture Metrics](../scale/WORKSPACES.md#architecture-metrics).```get_architecture()@@ -712,4 +712,4 @@ In addition to the MCP tools above, `repowise init` installs AI-agent hooks (Cla- **Codex SessionStart/UserPromptSubmit**: Codex receives concise repowise MCP workflow guidance when a session or prompt starts.- **Codex PostToolUse**: after edits or git operations, Codex receives a freshness reminder when indexed context may be stale.-Hooks are lightweight reminders. MCP tools are for deeper, on-demand investigation. See [Auto-Sync](AUTO_SYNC.md) and [Codex Integration](CODEX.md) for details.+Hooks are lightweight reminders. MCP tools are for deeper, on-demand investigation. See [Auto-Sync](../scale/AUTO_SYNC.md) and [Codex Integration](CODEX.md) for details.diff --git a/docs/OPENCODE.md b/docs/agent/OPENCODE.mdsimilarity index 100%rename from docs/OPENCODE.mdrename to docs/agent/OPENCODE.mddiff --git a/docs/VSCODE.md b/docs/agent/VSCODE.mdsimilarity index 99%rename from docs/VSCODE.mdrename to docs/agent/VSCODE.mdindex fefabc0b7..e034e2561 100644--- a/docs/VSCODE.md+++ b/docs/agent/VSCODE.md@@ -136,4 +136,4 @@ and reads the index under `.repowise/`. It sends no telemetry of its own. TheCLI's own telemetry opt-out is respected because the extension itself sendsnothing.-The extension source lives in [`packages/vscode`](../packages/vscode).+The extension source lives in [`packages/vscode`](../../packages/vscode).diff --git a/docs/architecture/code-health.md b/docs/architecture/code-health.mdindex 9ae572f7f..b25e6f56b 100644--- a/docs/architecture/code-health.md+++ b/docs/architecture/code-health.md@@ -1,6 +1,6 @@# Code Health: Architecture & Internals-Companion to the user-facing [`docs/CODE_HEALTH.md`](../CODE_HEALTH.md). This+Companion to the user-facing [`docs/layers/CODE_HEALTH.md`](../layers/CODE_HEALTH.md). Thisdocument is for contributors: where every piece lives, how data flows fromparsed source to the dashboard, and the extension points for addingmarkers, languages, coverage formats, or alerts.@@ -478,7 +478,7 @@ independent, expert-set weight table (the floored smells deduct at full weightthere), and the **performance** signal under its own bounded `performance`category. The three signals share one scoring kernel against separateweight/category/cap tables and never feed back into each other; see the-[user guide](../CODE_HEALTH.md#three-health-signals-defect-risk-maintainability-and-performance)+[user guide](../layers/CODE_HEALTH.md#three-health-signals-defect-risk-maintainability-and-performance)for what each signal surfaces and why the overall score stays the defect score.---@@ -771,7 +771,7 @@ glob over the repo-relative POSIX path (`path`, with `path_glob` and `glob` asaccepted aliases). `to_analyzer_config(file_paths)` resolves the globs toper-file disabled sets, which the engine honors in `_evaluate_file()`. Theschema and examples are in the-[user guide](../CODE_HEALTH.md#configuration).+[user guide](../layers/CODE_HEALTH.md#configuration).---@@ -906,7 +906,7 @@ phases may revisit; the constraints kept v1 shippable.## See also-- [`docs/CODE_HEALTH.md`](../CODE_HEALTH.md): user-facing guide.+- [`docs/layers/CODE_HEALTH.md`](../layers/CODE_HEALTH.md): user-facing guide.- [`packages/core/src/repowise/core/analysis/health/README.md`](../../packages/core/src/repowise/core/analysis/health/README.md): developer overview at the layer root.- Sub-package READMEs under `complexity/`, `coverage/`, `duplication/`, `biomarkers/`.-- [`docs/architecture/graph-algorithms.md`](./graph-algorithms.md): the graph layer health depends on.+- [`docs/architecture/graph-algorithms.md`](graph-algorithms.md): the graph layer health depends on.diff --git a/docs/architecture/language-support.md b/docs/architecture/language-support.mdindex c123663d2..87274a440 100644--- a/docs/architecture/language-support.md+++ b/docs/architecture/language-support.md@@ -2,7 +2,7 @@How the language pipeline is built, and how to add a new language. For theuser-facing "what works today" matrix, see-[docs/LANGUAGE_SUPPORT.md](../LANGUAGE_SUPPORT.md).+[docs/layers/LANGUAGE_SUPPORT.md](../layers/LANGUAGE_SUPPORT.md).The pipeline is fully modular. Language identity data lives in a centralised`LanguageRegistry`; per-language extraction logic lives in `extractors/`;@@ -367,13 +367,13 @@ tuple, no orchestrator edits.| **gRPC** | `.proto` IDL, Go, Java, Python, NestJS (`@GrpcMethod`), C# (gRPC-dotnet) | Go, Java, Python, C# || **Data** | DDL `CREATE`/`ALTER`, Alembic `op.create_table`, ORM entities (SQLAlchemy, SQLModel, Django, JPA, EF Core, ActiveRecord, Eloquent) | SQL string literals in app code (sqlglot-parsed, verb-anchored-regex fallback) |-See [docs/WORKSPACES.md](../WORKSPACES.md) for the user-facing workspace guide.+See [docs/scale/WORKSPACES.md](../scale/WORKSPACES.md) for the user-facing workspace guide.---## See also-- [docs/LANGUAGE_SUPPORT.md](../LANGUAGE_SUPPORT.md), user-facing support matrix-- [docs/CODE_HEALTH.md](../CODE_HEALTH.md), code-health markers and per-language precision hazards+- [docs/layers/LANGUAGE_SUPPORT.md](../layers/LANGUAGE_SUPPORT.md), user-facing support matrix+- [docs/layers/CODE_HEALTH.md](../layers/CODE_HEALTH.md), code-health markers and per-language precision hazards- [architecture/code-health.md](code-health.md), code-health layer internals- [architecture/ARCHITECTURE.md](ARCHITECTURE.md), full system architecturediff --git a/docs/architecture/pluggable-storage.md b/docs/architecture/pluggable-storage.mdindex 743007424..ed3c2f321 100644--- a/docs/architecture/pluggable-storage.md+++ b/docs/architecture/pluggable-storage.md@@ -216,7 +216,7 @@ broken plugin cannot derail the pipeline.The seams add a layer of indirection but no behavior change for usersof the OSS defaults: `repowise init` still writes to`.repowise/wiki.db`, the in-process graph still owns ingestion, the-nine MCP tools still expose the same surface, and `repowise --help`+ten MCP tools still expose the same surface, and `repowise --help`lists the same commands in the same order. Plugins extend thedefaults; they don't replace them unless an integration explicitlyswaps an implementation in.diff --git a/docs/COMMERCIAL.md b/docs/business/COMMERCIAL.mdsimilarity index 93%rename from docs/COMMERCIAL.mdrename to docs/business/COMMERCIAL.mdindex d15a14314..1dd589002 100644--- a/docs/COMMERCIAL.md+++ b/docs/business/COMMERCIAL.md@@ -10,8 +10,8 @@ license adds on top, the honest GA / in-development / planned status of eachcommercial capability, the on-premise deployment model, and the available pricingmodels. Specific pricing figures are provided in a separate proposal.-> **Looking for the open-source feature set?** The [README](../README.md) and-> [docs/](.) cover everything in the AGPL distribution. This document is about what+> **Looking for the open-source feature set?** The [README](../../README.md) and+> [docs/](..) cover everything in the AGPL distribution. This document is about what> sits *on top* of it commercially.---@@ -19,7 +19,7 @@ models. Specific pricing figures are provided in a separate proposal.## 1. Who the commercial license is forThe open-source distribution covers the full developer-experience surface — the five-intelligence layers, the nine MCP tools, multi-repo workspaces, the local dashboard,+intelligence layers, the ten MCP tools, multi-repo workspaces, the local dashboard,auto-sync, and auto-generated `CLAUDE.md`. That is everything an engineer or a teamneeds to make their AI coding agents codebase-aware.@@ -41,7 +41,7 @@ scale, in a regulated or security-sensitive environment**:All of the following ship in `pip install repowise` today, free for internal use.-- **Five intelligence layers** — Graph (tree-sitter AST across 15 languages, two-tier+- **Five intelligence layers** — Graph (tree-sitter AST across 16 languages, two-tierdependency graph, call resolution, heritage extraction, Leiden communities,PageRank / betweenness / SCC), Git (hotspots, ownership, co-change pairs, busfactor, significant commits, contributor profiles, module health), Documentation@@ -68,20 +68,26 @@ All of the following ship in `pip install repowise` today, free for internal useSecurity (local pattern scan), Knowledge Map, and the workspace views.- **Dead-code detection** — pure graph traversal, confidence-tiered, framework-aware(ASP.NET, Django, FastAPI, Flask, Rails, Laravel), dynamic-import aware.-- **Privacy** — self-hosted; source never leaves your infrastructure; BYOK or fully- offline via Ollama; zero telemetry. Stored: graph, non-reversible embeddings, wiki- pages, git metadata, decision records. Raw source is processed transiently and- never persisted.+- **Privacy** (self-hosted): source never leaves your infrastructure, BYOK or fully+ offline via Ollama. Anonymous, opt-out usage telemetry (command names and coarse+ environment only, never code, paths or repo names) can be turned off with+ `repowise telemetry disable`, `DO_NOT_TRACK=1`, or by running offline. Stored:+ graph, non-reversible embeddings, wiki pages, git metadata, decision records. Raw+ source is processed transiently and never persisted. Full detail:+ [SECURITY_COMPLIANCE.md](SECURITY_COMPLIANCE.md) and+ [TELEMETRY.md](../reference/TELEMETRY.md).---## 3. First-class language coverage-Repowise treats **9 languages at Full tier** — Python, TypeScript, JavaScript, Java,-Kotlin, Go, Rust, C++, and **C#** — with AST parsing, import resolution, named-bindings, call resolution, heritage extraction, multi-project workspace resolvers,-framework-aware edges, and per-language dynamic-hint extractors. A further 5 languages-(C, Ruby, Swift, Scala, PHP) sit at Good tier.+Repowise treats **11 languages at Full tier** (Python, TypeScript, JavaScript, Java,+Kotlin, Go, Rust, C++, **C#**, Scala, and Ruby) with AST parsing, import resolution,+named bindings, call resolution, heritage extraction, multi-project workspace+resolvers, framework-aware edges, per-language dynamic-hint extractors, and+code-health markers. A further 4 languages (C, Swift, PHP, Dart) sit at Good tier,+and Luau is partial. SQL/dbt, shell, and the config formats are handled by dedicated+extractors on top of that.For estates built on a particular stack, the relevant Full-tier capabilities areworth calling out. For **.NET**, as one example:diff --git a/docs/business/SECURITY_COMPLIANCE.md b/docs/business/SECURITY_COMPLIANCE.mdnew file mode 100644index 000000000..6a5806868--- /dev/null+++ b/docs/business/SECURITY_COMPLIANCE.md@@ -0,0 +1,260 @@+# Security & Compliance++Written for the person who has to sign off before Repowise touches source code.+It covers what Repowise processes, what it persists, what leaves the machine+under each deployment mode, and how to reduce that to zero.++Short version: Repowise is self-hosted by default. Your source code is read from+disk, parsed in memory, and never persisted. The only content that leaves your+infrastructure is what you send to your own LLM provider under your own key, and+even that is optional. Anonymous CLI telemetry is the one outbound channel we+add, it contains no code, paths, or repo names, and it has three independent+off switches.++- Open-source feature set: [README](../../README.md) · [docs/](..)+- Commercial layer, on-prem topology, licensing: [COMMERCIAL.md](COMMERCIAL.md)+- Telemetry field-by-field: [docs/reference/TELEMETRY.md](../reference/TELEMETRY.md)+- Security-specific contact: [[email protected]](mailto:[email protected])++---++## 1. Data processed vs data persisted++This is the distinction most security reviews turn on. Repowise reads a lot more+than it keeps.++| Artifact | Processed | Persisted | Where |+|---|---|---|---|+| Raw source code | Yes, read from disk and parsed into an AST in memory | **No** | transient only |+| Dependency graph (NetworkX) | Yes | Yes | local index (`.repowise/`) |+| Embeddings (LanceDB) | Yes | Yes, as non-reversible vectors | local index |+| Generated wiki pages | Yes | Yes | local index |+| Git metadata (commits, authors, churn, co-change) | Yes | Yes | local index |+| Architectural decision records | Yes | Yes | local index |+| Code-health scores and findings | Yes | Yes | local index |++Raw source is processed transiently and never persisted. What survives an index+is a structural and statistical description of the codebase plus the+documentation generated from it.++**On embeddings.** LanceDB stores float vectors produced by the configured+embedding model. They are not encrypted source and they are not reversible back+into the original text. They are, however, derived from your code, so treat the+index directory with the same access controls as the repository itself.++**Where the index lives.** In the OSS distribution, everything above sits in the+`.repowise/` directory inside the repository, on the machine that ran+`repowise init`. Nothing is uploaded. A commercial on-prem install swaps the+local stores for Postgres (metadata) and LanceDB or pgvector (embeddings) inside+your own network, as described in [COMMERCIAL.md §6](COMMERCIAL.md#6-on-premise-deployment).++---++## 2. LLM usage, BYOK, and zero retention++Repowise splits cleanly into layers that need an LLM and layers that do not.++**Zero-LLM layers.** Graph, git, dead code, code health, change risk, and the+security pattern scan are pure local computation over tree-sitter and git data.+`repowise init --index-only` builds all of them with **no outbound LLM calls at+all**. The health pass in particular is deterministic Python: no model, no+network.++**LLM layers.** Wiki/documentation generation, chat, decision extraction, and+the opt-in refactoring code-gen call a model. These are the only paths that can+send code-derived content off the machine.++**BYOK.** You bring your own key: Anthropic, OpenAI, Azure OpenAI in your own+tenant, or a local runtime. Calls go directly from your infrastructure to the+provider you configured. We never see your LLM traffic, and we never proxy it.+Zero data retention applies through your provider's own policy (Anthropic's API+zero-retention terms, your Azure tenant's data-handling terms, and so on), which+means the retention question is settled by a contract you already hold rather+than by us.++**Per-repository provider choice.** The provider is configured per repo, so a+sensitive repository can run fully offline while a lower-sensitivity tooling+repo uses a hosted model.++**Fully offline.** Ollama plus a local embedding model means **zero external API+calls**: no LLM provider, no embedding provider, nothing outbound from the+indexing path. Combined with telemetry disabled (see §3), Repowise makes no+network calls whatsoever.++---++## 3. Telemetry++The CLI reports anonymous, opt-out usage telemetry so we can prioritize work. It+is documented field by field in+[docs/reference/TELEMETRY.md](../reference/TELEMETRY.md).++**What is collected:** an anonymous envelope (`anon_id`, `session_id`,+`cli_version`, `os`, `arch`, `python_version` at major.minor only, `is_ci`),+plus per-event properties: the command name, a known subcommand name, flag+**names** only, a status enum, an exception **class name**, and a duration. For+`init` / `update`, coarse buckets describe the shape of the run (file-count+bucket, top language, docs mode on/off, provider and model, embedder, pages+bucket). MCP tool calls report the tool name, status, duration, and coarse+enums (confidence, retrieval quality, results bucket, index-behind flag).++**What is never collected:** source code or file contents, file paths or+directory names, repository names, package names, symbol or function names,+generated documentation text, flag values, environment-variable values, API keys+or credentials, error messages or stack traces, IP addresses, usernames,+hostnames, email, or anything personally identifiable.++**`anon_id` is a random UUID** stored in `~/.repowise/platform.json`. It is not+derived from a hostname, username, or machine identifier, so it cannot be+reversed to a person. Delete the file and a new, unrelated id is generated.++**Verify before you trust us.** Print the exact payload without sending it:++```bash+REPOWISE_TELEMETRY_DEBUG=1 repowise status+```++**Three independent ways to disable it**, any one of which is sufficient:++```bash+repowise telemetry disable # persisted to ~/.repowise/platform.json+export REPOWISE_TELEMETRY_DISABLED=1+export DO_NOT_TRACK=1 # the cross-tool standard+```++Running fully offline (§2) also means nothing is sent. Check state with+`repowise telemetry status`.++**Retention:** events are kept for 90 days, then deleted. Only aggregate figures+are used or shared.++Note that [COMMERCIAL.md §2](COMMERCIAL.md#2-what-ships-in-open-source-agpl-30)+summarizes this as "zero telemetry". The precise statement is the one here and+in the telemetry reference: anonymous, opt-out, no code or identifiers, three+off switches.++---++## 4. Self-hosted vs hosted: where the boundary sits++| | Self-hosted (OSS, `pip install repowise`) | Self-hosted commercial (on-prem) | Hosted platform |+|---|---|---|---|+| Where source is read | your machine | your VPC | the hosted indexer |+| Where the index lives | `.repowise/` on your machine | Postgres + LanceDB/pgvector in your network | Repowise-operated infrastructure |+| Who calls the LLM | you, with your key | you, with your key | the platform, or your key |+| Outbound from your network | anonymous telemetry (disableable), your LLM provider | same, plus configured integrations | n/a, you are sending code to the platform |+| Commercial security features (CVE triage, SBOM/VEX, secret history scan, compliance reports, audit trail) | not included | per [COMMERCIAL.md §5](COMMERCIAL.md#5-commercial-capabilities--in-detail) | GA today |++The honest framing: **several commercial security capabilities are GA on the+hosted platform first.** If your requirement is on-prem *and* CVE-aware+dependency analysis, SBOM/VEX, or compliance reporting, that sequencing is a+scoping conversation, not a checkbox. The status of each capability (GA / in+development / planned) is listed unvarnished in+[COMMERCIAL.md §4](COMMERCIAL.md#4-commercial-capabilities--at-a-glance).++**Secrets handling on the hosted secret-detection feature:** only a fingerprint+and a redacted preview are stored, never the secret value.++---++## 5. On-prem and air-gapped topology++A self-hosted commercial install is a set of containers on your infrastructure.+The reference topology is Kubernetes; the same containers run on Nomad or plain+Docker. The OSS Docker images are documented in+[docker/README.md](../../docker/README.md): a full-stack image (API plus Web UI)+and a lean MCP-only image that speaks JSON-RPC over stdio, carries no Web UI, and+exposes no ports.++Components:++1. **API server** (FastAPI), **indexer workers**, and **dashboard** (Next.js).+2. **Postgres** for metadata, **LanceDB** (or pgvector) for embeddings, and an+ in-memory NetworkX graph.+3. **Optional Ollama container** for fully-offline LLM use.+4. **Webhook receivers** for GitHub Enterprise, GitLab self-managed, or Azure+ DevOps, configured per tracked repository.+5. **SSO** through your existing Entra ID / Okta tenant, and **outbound+ integrations** configured with signed service tokens held in the Repowise+ secret store. Availability per [COMMERCIAL.md §5.2](COMMERCIAL.md#52-workflow-integrations-rolling-out).++**Air-gapped.** All services run inside your VPC or air-gapped network. The LLM+provider and the git server sit inside the same boundary. **No outbound+connectivity is required in air-gapped mode.** A packaged air-gapped install+bundle (bundled grammars, embedding model, optional Ollama runtime) is on the+roadmap and marked *planned* in COMMERCIAL.md; today an air-gapped install is+assembled from the containers above rather than from a single bundle.++**Indexing cost profile, for capacity planning.** Graph, git, dead-code, and+code-health layers build in minutes with zero LLM calls+(`repowise init --index-only`). One-time wiki generation scales with repo size+and can run in the background. Incremental updates after each commit complete in+under 30 seconds.++---++## 6. Compliance posture++**Repowise holds no security certifications.** We do not claim SOC 2, ISO 27001,+or any other audited attestation, and you should not accept a vendor answer that+implies otherwise without a report to read.++What does exist:++- **PCI-DSS 4.0 and SOC 2 control-coverage reports** are GA on the hosted+ platform (Teams+). These are derived from live security findings with+ per-control evidence drill-ins and JSON / Markdown export. They are framed+ in-product and in every export as **coverage signals, not an audit or a+ certification**. Controls that automated findings cannot evidence are marked+ for manual attestation rather than silently passed.+- **ISO 27001 Annex A** and **GDPR / data-residency mappings** are on the+ extended roadmap, not shipped.+- **SBOM (CycloneDX 1.6) with per-dependency license detection, plus VEX+ export** is GA on the hosted platform (Pro+). SPDX and cross-format conversion+ are roadmap.+- **Audit trail** covering the hosted security surface (scans, vulnerability and+ secret views, SBOM/VEX exports, compliance views, finding-status changes, and+ MCP reads by AI agents) is insert-only with user, IP, and timestamp,+ exportable to JSON/CSV, with an opt-in signed-webhook stream. Coverage beyond+ the security surface is in development.+- **Audit rights.** The commercial license grants you the right to audit+ Repowise's own security and compliance practices+ ([COMMERCIAL.md §7.1](COMMERCIAL.md#71-what-the-commercial-license-grants)).+- **IP indemnification and a defensive patent grant** are GA under the+ commercial license.++**Licensing, since it usually shares a review cycle:** the core engine is+AGPL-3.0, free for individuals, teams, and companies using it internally. A+commercial license removes the AGPL obligations for embedding Repowise in your+own product and adds the layer above.++---++## 7. Questions your security team will ask++| Question | Answer |+|---|---|+| Does our source code leave our infrastructure? | Not in the self-hosted distribution. Code is read from disk and parsed in memory. The only path that can send code-derived content out is the LLM call for documentation, chat, and decision extraction, and that goes to the provider you configured with your key. `--index-only` and offline mode remove it entirely. |+| Is raw source stored anywhere? | No. Raw source is processed transiently and never persisted. The index holds the graph, embeddings, wiki pages, git metadata, decisions, and health data. |+| Can the embeddings be reversed back into our code? | They are non-reversible vectors, not encrypted source. They are still derived from your code, so protect the index directory like the repo. |+| Can we run with no network access at all? | Yes. Ollama plus a local embedding model gives zero external API calls; disable telemetry and the process makes no outbound requests. In air-gapped mode the LLM provider and git server sit inside your boundary. |+| Do you see our LLM API traffic? | No. BYOK calls go directly from your infrastructure to your provider. We do not proxy them. |+| What is your data retention on LLM prompts? | Governed by your own provider contract (for example Anthropic's API zero-retention policy), not by us. |+| What telemetry is sent, and can we turn it off? | Anonymous command names and coarse environment only, with no code, paths, repo names, flag values, IPs, or identifiers. Disable via `repowise telemetry disable`, `DO_NOT_TRACK=1`, `REPOWISE_TELEMETRY_DISABLED=1`, or by running offline. Verify the exact payload with `REPOWISE_TELEMETRY_DEBUG=1`. |+| How long is telemetry retained? | 90 days, then deleted. Only aggregates are used. |+| Can telemetry be tied back to a user or a repo? | No. `anon_id` is a random UUID in `~/.repowise/platform.json`, not derived from any machine or user identifier, and no repo-identifying field is sent. |+| Are you SOC 2 or ISO 27001 certified? | No. We publish PCI-DSS 4.0 and SOC 2 **control-coverage reports** on the hosted platform, explicitly labeled as coverage signals rather than an audit or certification. ISO 27001 Annex A mapping is roadmap. |+| Can we deploy on-prem or air-gapped? | Yes. Containerized API, indexer workers, and dashboard, backed by Postgres and LanceDB/pgvector, with optional Ollama. No outbound connectivity is required in air-gapped mode. A single packaged air-gapped bundle is planned, not shipped. |+| Do you support SSO and SCIM? | SAML / OIDC SSO (Okta, Entra ID, Auth0, Google Workspace, generic SAML 2.0) and SCIM provisioning are rolling out commercially. RBAC and multi-tenant are planned. Confirm current status against [COMMERCIAL.md §4](COMMERCIAL.md#4-commercial-capabilities--at-a-glance). |+| Is there an audit log? | On the hosted platform, insert-only, covering the security surface, with user, IP, and timestamp, JSON/CSV export, and an opt-in signed-webhook stream. Broader coverage is in development. |+| Do you store secrets you find? | Only a fingerprint and a redacted preview. Never the secret value. |+| What does the MCP server expose to an AI agent? | Read-only query tools over the local index. The lean MCP container exposes no ports and speaks stdio only. |+| What license are we accepting? | AGPL-3.0 for the OSS engine, free for internal use. A commercial license is required to embed Repowise in a product without AGPL obligations. |+| Who do we contact for a security review? | [[email protected]](mailto:[email protected]). Commercial scoping: [[email protected]](mailto:[email protected]). |++---++## 8. Reporting a vulnerability++Send it to [[email protected]](mailto:[email protected]). Please include+reproduction steps and the affected version (`repowise --version`).diff --git a/docs/layers/BUG_HISTORY.md b/docs/layers/BUG_HISTORY.mdnew file mode 100644index 000000000..4ea2964b7--- /dev/null+++ b/docs/layers/BUG_HISTORY.md@@ -0,0 +1,333 @@+# Bug-fix history++Repowise records which files and which functions have actually been fixed, how+recently, and how often. The output is a small set of honest numbers: a+per-file fix count over a trailing 180-day window, a per-symbol breakdown, a+decayed "bug magnet" flag, and the age of the most recent fix. They surface in+the pre-edit hook, in `get_risk` and `get_change_risk` over MCP, in the health+drawer, and on the symbols views.++**No LLM calls.** This is git history, a `-U0` diff pass, and arithmetic. It+runs inside the existing git phase of `repowise init` and `repowise update`.++The reason to care: a file's churn tells you it changes a lot, which is often+just where the work is. A file's fix history tells you it *breaks* a lot, which+is a different and more actionable thing. On this repo the top bug magnets+(`pipeline/persist.py`, `pipeline/incremental.py`, `dead_code/analyzer.py`,+`update_cmd/command.py`) match the churn hotspot list, arrived at independently+from bug fixes rather than commit counts.++## Fix-shape filtering: what counts as a bug fix++A commit whose subject matches the fix keywords is a candidate, not a fact.+Plenty of `fix:` commits fix a typo in the README, tighten a test, or bump a+version. Counting those inflates every downstream number.++So each candidate's `-U0` diff is classified into one shape, and only one shape+counts:++| Shape | Counted | Example |+|---|---|---|+| `code_fix` | yes | production source lines changed |+| `test_only` | no | only files under `tests/` or matching a test naming rule |+| `doc_only` | no | only `.md` / `.mdx` / `.rst` / `.txt` / `.adoc` or `docs/` |+| `config_other` | no | only lockfiles, CI YAML, `*.config.*`, dotfile rc |+| `comment_only` | no | code files touched, but the changed lines are comments or docstrings |+| `empty` | no | merge commits and no-op diffs |++The comment-only rule is line-level, not path-level: it strips trailing comments+and compares the code part of each removed and added line, so a commit that+rewords a docstring in a `.py` file does not count as a bug fix.++The classifier was validated against 240 hand-labelled fix commits across four+repos (repowise, flask, django, zod) and agrees with the labels **98.3%** of the+time (repowise, flask and django all 60/60; zod 56/60). The four residual+disagreements are all the same shape, "a file with a code extension changed but+no product code did", and were left as honest disagreements rather than closed+with repo-specific ignore lists.++The effect is real and varies enormously by repo. On flask, **58.7%** of+keyword-matched fix commits are noise and filtering removes half the raw+attributions. On repowise it is 7.0%. That is the point: a number that means the+same thing in both repos is worth more than a bigger number in one.++`GitMetadata` stores both `prior_defect_count` (filtered) and+`prior_defect_raw_count` (unfiltered), so the delta stays inspectable.++One thing filtering deliberately did not do: change the health score.+Re-running the defect-weight calibration on the 21-repo corpus showed filtering+moves pooled OOF AUC by +0.0002, inside noise. The `prior_defect` marker stays+at weight 1.0. Phase 1 shipped for count honesty, not for a score change, and+the doc says so rather than implying a win that was not measured.++## The `fix_events` table++Each counted fix produces one row per file it touched:++```+fix_events(repository_id, fix_sha, file_path, shape_kind,+ old_ranges_json, fixed_at, ...)+```++`old_ranges_json` holds the line ranges the fix replaced, numbered on the fix's+own parent commit. Persisting the events, rather than only a count, is what+makes per-symbol attribution and changed-line overlap possible later without+re-walking git.++The table is populated during a full index and extended incrementally by+`repowise update`. A pre-existing database picks the new columns up through the+additive reconciler with no migration code; rollups sit at their defaults until+the next update.++## Per-symbol attribution++After both `fix_events` and `wiki_symbols` are persisted, each event's replaced+line ranges are matched against the symbol spans in that file, producing a+`fix_symbol_counts` map per file: which function or class absorbed each fix.++Measured attribution rate, walking the shipped tracer live and joining against+each repo's existing index:++| Repo | Events | In-envelope rate |+|---|---|---|+| django | 2,179 | 97.4% |+| flask | 125 | 96.3% |+| zod | 337 | 81.8% |+| repowise | 1,145 | 96.8% |++"In-envelope" means the event's lines land somewhere between the file's first+and last indexed symbol. Gaps *between* symbols still count as misses, so this+remains a test of the join rather than a restatement of it. The two causes of+the loose-denominator misses were measured, not argued: django and flask are+line drift (symbol spans are at HEAD, ranges are at each fix's parent, so a 2011+fix is matched against lines that moved a decade ago, and 99.8% of django's+events are 3+ years old), and zod is symbol density in test files the parser+indexes with one or two named symbols.++**The counts are approximate and every surface says so.** Symbol spans are+current-tree, fix ranges are historical. Read them as "mostly here", not as an+exact ledger.++## The bug magnet rollup++Each file's counted fixes are collapsed into one decayed mass:++```+mass = Σ 0.5 ^ (age_days / 90)+bug_magnet = mass >= 3.0+```++The 90-day half-life was picked from a sweep of 60 / 90 / 180 days against the+21-repo calibration corpus. Decay was the only lever that moved the+`prior_defect` coefficient at all (0.15 undecayed to 0.23 decayed); 90d and 180d+tied inside noise and 90d is the tighter of the two.++Read the threshold with the decay in mind. Only a same-day fix is worth a full+1.0, so three real fixes spread over a couple of weeks land near 2.9 and do+**not** flag. In practice the flag needs four recent fixes, or three very recent+ones. That is deliberately the conservative end: the flag exists to interrupt+someone mid-edit, so it should be rare enough to be worth reading.++The rollup recomputes the whole repo on every index and update rather than+patching the files an update touched, because decay ages a rollup with nothing+in the file changing. It costs about 0.25s on this repo (1,172 events, 739+files): two indexed queries and arithmetic.++## The recency contract++This is the rule that keeps the feature honest, and it is enforced in the type+definitions rather than left to each surface:++> `bug_magnet` is the decayed fix mass past its trigger, so it is a recency+> claim. Any copy that shows it must show `last_fix_at` too.++Two consequences:++1. **A magnet claim never appears without its age.** If `last_fix_at` is null,+ the flag is dropped rather than shown unanchored. Pre-merge review caught+ three surfaces violating this (the health panel badge, the VS Code hover, and+ the MCP `defect_profile`); all three now drop the flag, and there is a test+ on the null-timestamp path.+2. **The surface goes silent outside the window.** The pre-edit hook does not+ fire at all when the last fix is older than 180 days, no matter how large the+ historical count is. "This file was fixed nine times, in 2019" is not a+ warning, it is trivia.++A related bug worth knowing about, since it is the kind that hides: `last_fix_at`+was originally serialized without a timezone. SQLite's DATETIME bind processor+drops `tzinfo`, so `.isoformat()` produced a string JavaScript parses as local+time. West of UTC, a fix committed two hours ago landed in the future, tripped+the relative-time future-guard, and the age silently vanished from all four+surfaces required to carry it, worst for the freshest fixes. Fixed once+upstream, not four times in the consumers.++## Where it surfaces++### Pre-edit hook++When an agent is about to edit a file with a real recent run of fixes, one line+goes into its context:++```+[repowise] pipeline/persist.py has been bug-fixed 5x in the last 6 months,+last 2 weeks ago (bug magnet); mostly in run_pipeline.+```++Three gates, all of which must hold: at least 3 counted fixes, a last fix inside+180 days, and one claim per file per session (an atomic ledger, so two racing+hook processes cannot double-fire). A file that also has a governing+architectural decision emits two lines, never more. Wired into both the Claude+Code and Codex hook paths. See [docs/agent/HOOKS.md](../agent/HOOKS.md).++### `get_risk`++Files with counted fixes gain a `defect_profile` block:++```python+get_risk(targets=["packages/core/src/repowise/core/pipeline/persist.py"])+# defect_profile: {fix_count, window, last_fix_days_ago,+# bug_magnet, top_symbols}+```++`bug_magnet` appears only when true, `top_symbols` is the top three with the+path prefix stripped, and the whole block is omitted on repos with no fix data.+Measured at 46 tokens mean, 80 worst case, against a 150-token ceiling across+803 files. The approximation caveat lives in the tool docstring, stated once,+rather than as a constant string repeated on every row.++Shipping `defect_profile` also let the old keyword `risk_type="bug-prone"`+derivation retire. It used to scan commit subjects for `/fix|bug|patch/`, which+counted doc and test commits, had no recency, and disagreed with the count every+other surface showed. It now reads `bug_magnet` or `prior_defect_count >= 3`.+That does silently reclassify some files: a high-traffic file with 3 fixes in+200 commits now reads `bug-prone` where it read `churn-heavy`.++### `get_change_risk`++A diff or commit range gains a `prior_fixes` block: per changed file, how many+past fixes it carries and how many of the change's lines fall inside a past+fix's replaced ranges. The per-file counts are exact (counted by+`COUNT(DISTINCT fix_sha)`, so one commit fixing three files reports one fix, not+three). The line overlap is labelled `approximate` in the payload, because past+ranges are numbered on their own parent commit. Files are ranked by overlap then+count, and the list carries a `truncated` flag rather than silently dropping the+tail.++See [CHANGE_RISK.md](CHANGE_RISK.md) for the rest of that tool.++### Dashboard++- **Health drawer**: a collapsed **Bug history** section with per-symbol counts,+ the last-fix age on the toggle, and an approximation footnote.+- **File signals panel**: the bug-fix tile gains a **Bug magnet** badge and+ folds the last-fix age into its caption.+- **Symbol detail** (modal and routed page): a **Bug fixes** stat tile beside+ **Modifications**. How often it changes next to how often it breaks is the+ contrast that earns the cell.+- **Symbols list**: a **Bug-fixed** facet and a per-row fix chip. The filter is+ symbol-level, unlike the file-level filters beside it, because a bug-fixed+ file says very little about the one function you are reading.+- **VS Code**: one line on the file hover, off the same signals block.++See [docs/start/DASHBOARD.md](../start/DASHBOARD.md) for where each of these+lives.++## What was built, measured, and deliberately not shipped++The most useful thing this layer can tell you is what it refuses to tell you.++### SZZ inducing-commit attribution: built, measured, deleted++The obvious next step from "this line was fixed" is "and here is the commit that+introduced the bug". That is the SZZ algorithm, and it was fully built: a blame+pass walking each fix's replaced lines back through history, refactor-aware, with+overlap-based ranking of the candidates.++Then it was measured against a hand-labelled set. Fifty-three judged rows, five+reviewers. **File-level SZZ tops out at 74.5% top-candidate precision on this+corpus. The gate was 80%.**++74.5% is not a bad algorithm. It is a *good* SZZ implementation. It is also not+good enough to put a commit SHA and a person's name in a UI, because one time in+four the UI would be accusing the wrong commit, and there is no way for the+reader to tell which time. So the blame pass was deleted, `szz.py` is gone, and+**no repowise surface names an inducing commit.** The planned+"(last: `<sha>` `<subject>`)" tail on `get_change_risk` was cut. The planned+inducing-commit link on commit rows was cut.++Deleting it was verified rather than assumed: `inducing_shas_json` appeared in+exactly four places in the tree (the model, the migration, the writer, and the+writer's tests), and neither the hosted backend nor the PR bot referenced+`fix_events` in any spelling. There was no consumer to break. Removing the pass+also gave back 9.1s of index time on this repo and 5.9s on zod.++The findings are kept here so they do not vanish with the code, because they are+reusable by anyone attempting this again:++- **Refactor-aware blame is worth building.** Walking through+ behaviour-preserving moves to the parent lifted strict precision from 70.6% to+ 74.5%. All 14 of the initial false calls were refactors inheriting moved lines.+- **Overlap ranking beats earliest-commit ranking by 12 points** on judged rows.+ Earliest-commit's apparent 80% was an artefact of its wrong answers going+ unjudged: 7 of its 16 unknowns were this repo's initial commit, and all 7 came+ back "not plausible" once judged. This is the finding most likely to be+ re-litigated, so, plainly: it was tested twice, and it settled the other way+ from the first read.+- **The two residual failure modes are properties of SZZ, not bugs.** An initial+ import has no earlier commit to name, and package splits that move lines+ wholesale while re-sorting imports defeat the carried-through test on exactly+ the lines that moved.++Restoring the tracer is a `git revert` of one commit, not a re-derivation. If+someone finds a ranking that clears 80% on the frozen label set, the data layer+is ready for it.++### "AI vs human introduced bugs": cut++A repo-level card comparing defects introduced by AI-authored commits against+human-authored ones, per KLOC. It is an obvious feature to want given that+repowise already detects agent provenance on commits, and it was planned.++It was gated on a concentration check before build, and the check failed. **The+top 5 inducing commits held 30.3% of all traced mass against a 20% ceiling, with+the initial import alone at 13.9%.** SZZ error does not average out: when blame+concentrates on a handful of enormous commits, any aggregate built on inducing+commits inherits that concentration, and the aggregate is then mostly a+statement about who happened to author the repo's five biggest commits. A stat+like "AI introduces N% more bugs" is exactly the kind of number that gets+screenshotted and quoted, which raises the bar rather than lowering it.++So it was killed before it was built, and the provenance join it depended on was+cut with it.++### What survived the cuts++Counts and recency survived. Accusations did not. Everything shipped here+answers "this code has been broken before, recently, and roughly here", and+nothing answers "and it was your fault". The first question is answerable from+git with measurable accuracy. The second is not, yet.++## Limitations++- **Symbol counts are approximate.** Current-tree spans against historical line+ ranges. Stated on every surface that shows them.+- **Keyword-matched fix detection.** A bug fixed in a commit whose subject does+ not say so is invisible. The shape filter improves precision, not recall.+- **The 180-day window is fixed.** A file fixed heavily two years ago and quiet+ since reads as clean, which is intentional but is a choice, not a truth.+- **Workspace lookup in the hook does not filter by `repository_id`,** matching+ the co-change query beside it. In a workspace whose members lack their own+ `.repowise` this degrades to silence rather than a wrong answer.+- **The hook's usefulness is unproven.** It shipped without the planned week of+ live-session dogfooding, so whether the notice changes behaviour or becomes+ ignorable noise is an open question. If it is noise, the plan is to cut or+ reword the hook surface and keep every data layer beneath it.++## See also++- [CODE_HEALTH.md](CODE_HEALTH.md): the `prior_defect` marker and the+ "does the score find the bugs?" self-check that reads the same counts.+- [CHANGE_RISK.md](CHANGE_RISK.md): `get_change_risk` and its scoring.+- [docs/agent/MCP_TOOLS.md](../agent/MCP_TOOLS.md): `get_risk` and+ `get_change_risk` schemas.+- [docs/agent/HOOKS.md](../agent/HOOKS.md): the pre-edit hook.diff --git a/docs/CHANGE_RISK.md b/docs/layers/CHANGE_RISK.mdsimilarity index 96%rename from docs/CHANGE_RISK.mdrename to docs/layers/CHANGE_RISK.mdindex 146baef47..0e0ae8e50 100644--- a/docs/CHANGE_RISK.md+++ b/docs/layers/CHANGE_RISK.md@@ -97,7 +97,7 @@ live in `packages/core/src/repowise/core/analysis/change_risk/model.py`.In a workspace, a change rarely stops at the repo boundary. When `get_risk` iscalled in PR mode (`changed_files`), its `directive` block gains two cross-repo-fields derived from the [system graph](WORKSPACES.md#system-graph):+fields derived from the [system graph](../scale/WORKSPACES.md#system-graph):- `will_break_consumers`: services in *other* repos that structurally depend onthe changed repo (a contract or package import). These are the consumers most@@ -111,7 +111,7 @@ The same reachability powers the `get_blast_radius` MCP tool, theblast-radius ripple. Structural edges outweigh behavioral co-change in theranking (one named constant, `BEHAVIORAL_EDGE_WEIGHT`, in`packages/core/src/repowise/core/workspace/blast_radius.py`). See-[Cross-Repo Blast Radius](WORKSPACES.md#cross-repo-blast-radius) for the full+[Cross-Repo Blast Radius](../scale/WORKSPACES.md#cross-repo-blast-radius) for the fullmodel.The directive carries a third cross-repo field, `breaking_changes`, when a@@ -124,4 +124,4 @@ the consumer files it endangers across repos. It is computed by diffing thecurrent contracts against the previously-indexed set during`repowise update --workspace`; non-breaking changes (an added optional field, anew endpoint) never appear. See-[Breaking-Change Guard](WORKSPACES.md#breaking-change-guard) for the full model.+[Breaking-Change Guard](../scale/WORKSPACES.md#breaking-change-guard) for the full model.diff --git a/docs/CODE_HEALTH.md b/docs/layers/CODE_HEALTH.mdsimilarity index 98%rename from docs/CODE_HEALTH.mdrename to docs/layers/CODE_HEALTH.mdindex cabfcdeaa..451fe8f7f 100644--- a/docs/CODE_HEALTH.md+++ b/docs/layers/CODE_HEALTH.md@@ -9,14 +9,14 @@ and more. **No LLM calls, no cloud requirement.** Pure Python over tree-sitterand git data, designed to finish in under 30 seconds on a 3,000-file repo.<div align="center">-<img src="../.github/assets/health-loop.svg" alt="repowise code-health loop: 25 deterministic markers fan into three signals (defect risk, maintainability, performance), the graph and git history locate where risk concentrates, and refactoring intelligence emits concrete plans (Extract Class, Extract Helper, Move Method, Break Cycle, Split File) your agent executes" width="100%" />+<img src="../../.github/assets/health-loop.svg" alt="repowise code-health loop: 25 deterministic markers fan into three signals (defect risk, maintainability, performance), the graph and git history locate where risk concentrates, and refactoring intelligence emits concrete plans (Extract Class, Extract Helper, Move Method, Break Cycle, Split File) your agent executes" width="100%" /></div>Code health runs as a loop: **measure** every file across three signals,**locate** where the risk concentrates through the dependency graph and githistory, then **fix** it with a concrete refactoring plan an agent can execute(see [Refactoring targets](#refactoring-targets) and-[docs/REFACTORING.md](REFACTORING.md)).+[docs/layers/REFACTORING.md](REFACTORING.md)).Linters check patterns. The health score predicts risk. A linter flags a linethat matches a known-bad shape; the score estimates which files are likely to@@ -69,7 +69,7 @@ stays deterministic; only the learned constants ship. The strongest predictorsare `co_change_scatter`, `change_entropy`, `ownership_risk`, and`nested_complexity`; widely-firing smells that proved weak under leakage-freescoring are floored. The full per-marker table lives in the-[architecture doc](architecture/code-health.md#61-calibrated-weight-multipliers),+[architecture doc](../architecture/code-health.md#61-calibrated-weight-multipliers),and the calibration with confidence intervals is in the[benchmark report](https://github.com/repowise-dev/repowise-bench/blob/master/health-defect/BENCHMARK_REPORT.md).@@ -664,7 +664,7 @@ opt-in **Generate code** action that expands a plan into generated code plus aunified diff. Code generation runs only on an explicit request, never in theindexing hot path. It is enabled by default and can be turned off with`refactoring.llm.enabled: false`. Full reference:-**[docs/REFACTORING.md](REFACTORING.md)**.+**[docs/layers/REFACTORING.md](REFACTORING.md)**.## Trendsdiff --git a/docs/layers/DEAD_CODE.md b/docs/layers/DEAD_CODE.mdnew file mode 100644index 000000000..e1154140e--- /dev/null+++ b/docs/layers/DEAD_CODE.md@@ -0,0 +1,271 @@+# Dead Code++Repowise reports the files nothing imports, the exported symbols nothing uses,+and the packages nothing depends on, each with a confidence score and the+evidence behind it. Pure graph traversal and SQL: no LLM calls, no network, and+it finishes in under 10 seconds on any repo size.++The layer surfaces candidates. You decide. Static reachability can prove that+nothing *imports* a file; it can never prove nothing *loads* it. Everything below+is built around that asymmetry.++## Quick start++```bash+repowise init # dead-code findings populate during indexing+repowise dead-code # the report+repowise dead-code --safe-only --min-confidence 0.8 # cleanup-ready only+repowise dead-code --kind unused_export --format json+repowise dead-code --repo backend # workspace, one repo+```++```+repowise dead-code++ 23 findings · 4 safe to delete++ ✓ utils/legacy_parser.ts file 1.00 safe to delete+ ✓ auth/session.ts file 0.92 safe to delete+ ✓ helpers/formatDate export 0.71 safe to delete+ ✗ analytics/v1/tracker.ts file 0.41 recent activity, review first+```++From an agent:++```python+get_dead_code()+get_dead_code(min_confidence=0.8, tier="high", safe_only=True)+get_dead_code(kind="unused_export", group_by="owner")+```++## The four finding kinds++| Kind | What it means | How it is computed | Base confidence |+|------|---------------|--------------------|-----------------|+| `unreachable_file` | No file in the repo imports this one. | File-node in-degree of 0 on the dependency graph, after entry points and the never-flag allowlist are removed. | Scored from git age (below) |+| `unused_export` | A public symbol nothing imports. | No `imports` edge names the symbol (or `*`, or a TypeScript `export { local as alias }` rename), and no `calls` / `method_implements` / `reads` / `extends` / `implements` / `type_use` edge reaches it. | `1.00` when the containing file *does* have importers (so the file is alive and only this symbol is not), `0.70` when it does not, `0.30` when the name ends in `_DEPRECATED` / `_LEGACY` / `_COMPAT` |+| `unused_internal` | A private or underscore-prefixed symbol nothing calls. | No `calls` edge, and no cross-file importer pulls the name (which would mean a dispatch-table lookup). Off by default. | `0.65` |+| `zombie_package` | A whole top-level package no other package imports. | No inter-package import edges into it. Never marked safe to delete. | `0.50` |++`unused_internal` is opt-in (`--include-internals`); `zombie_package` is on by+default and can be turned off with `--no-include-zombie-packages`. Passing+`--kind` overrides both toggles, so `--kind unused_internal` enables internals on+its own.++Two caveats on the numbers. `unused_internal` is disabled entirely for Rust,+where the graph does not yet emit intra-file call edges, so a private Rust helper+is never flagged. And the `lines` count on file and package findings is an+estimate (symbol count times ten), not a real line count, so treat the+"reclaimable lines" roll-up as an order of magnitude rather than a figure.++### How unreachable-file confidence is scored++An orphaned file that nobody has touched in a year is a much stronger signal than+one added last week. Confidence starts from git activity:++| Condition | Confidence |+|-----------|-----------|+| No commits in 90 days, last touched over a year ago | `1.00` |+| No commits in 90 days, last touched over 180 days ago | `0.90` |+| No commits in 90 days, last touched over 90 days ago | `0.80` |+| No commits in 90 days, no other signal | `0.70` |+| No commits in 90 days, but the file is under 30 days old | `0.55` (may be work in progress) |+| Still being committed to | `0.40` |++Then it only ever goes down. Two caps apply:++- **Dynamic imports nearby.** If any file in the same directory uses a runtime+ loader, confidence is capped at `0.40`.+- **Runtime-load risk factors.** If the path looks like config, environment,+ bootstrap, database, or script code (`config`, `settings`, `env`, `bootstrap`,+ `startup`, `entrypoint`, `database`, `db`, `schema`, `seed`, `migration`, or a+ `scripts/` / `bin/` / `tasks/` directory), confidence is capped at `0.40` and+ the finding carries an evidence line explaining why. These are exactly the+ files wired up by a config key or a string path rather than an import, so+ "nothing imports it" is weak evidence.++## Confidence tiers and `safe_to_delete`++A finding is presented as **safe to delete** only when confidence is at or above+`0.70` **and** the path carries no runtime-load risk factor **and** the name does+not match a dynamic-dispatch pattern (`*Plugin`, `*Handler`, `*Adapter`,+`*Middleware`, `*Mixin`, `*Command`, `register_*`, `on_*`, `*_view`,+`*_endpoint`, `*_route`, `*_callback`, `*_signal`, `*_task`). Zombie packages are+never safe to delete regardless of confidence.++The safety re-derivation is monotonic: it only ever downgrades a stored flag,+never upgrades it, so findings written by an older version stay honest.++The two surfaces bracket the tiers differently, which is worth knowing before you+compare numbers:++| Surface | High | Medium | Low | Default floor |+|---------|------|--------|-----|---------------|+| CLI (`repowise dead-code`) | `>= 0.7` | `0.4` to `0.7` | `< 0.4` | `--min-confidence 0.4` |+| MCP (`get_dead_code`) | `>= 0.8` | `0.5` to `0.8` | `< 0.5` | `min_confidence=0.5` |++The MCP surface is deliberately stricter: an agent acting on a finding is riskier+than a human reading a table.++## What is exempt by construction++Before anything is scored, repowise removes what it knows is framework-loaded,+generated, or convention-wired. Static reachability is simply the wrong tool for+these, so they are never flagged rather than flagged and down-weighted.++| Group | Examples |+|-------|---------|+| Entry points | Anything the graph marked `is_entry_point`, plus `__init__.py`, `__main__.py`, `conftest.py`, `manage.py`, `wsgi.py`, `asgi.py`, `setup.py`, `main.go`, `build.rs` |+| Shell scripts | `*.sh`, `*.bash`, `*.zsh`. Invoked by name from CI configs and Makefiles; static reachability is meaningless |+| Framework routes | Next.js `page.tsx` / `layout.tsx` / `route.ts` / `middleware.ts`, SvelteKit `+page.svelte`, Nuxt `pages/*.vue`, Remix entry files, ASP.NET minimal-API `Apis/` / `Endpoints/`, Blazor and Razor code-behind |+| Test files | `*_test.go`, `*.test.ts`, `*.spec.ts`, `*_test.cc`, `*Test.java`, `**/tests/*.rs`, `src/test/java/`, MSTest and xUnit project layouts, `__tests__/`, `__mocks__/` |+| Generated code | protoc `*.pb.go` / `*.pb.cs` / `*.pb.cc`, Qt MOC/UIC/RCC, Bison/Flex, SWIG, Cython, stringer, MapStruct `*MapperImpl.java`, Dagger, AutoValue, Roslyn `*.g.cs`, Dart `*.g.dart` / `*.freezed.dart`, `**/generated/**` |+| Reflective loading | Alembic `versions/*.py`, Django migrations, EF entity configurations, COM `*ClassFactory.cpp`, Win32 `*NativeMethods.cs`, ETW event classes |+| Vendored trees | `vendor/`, `third_party/`, `deps/`, `external/`, `extern/`, `contrib/`, `submodules/` |+| Build artifacts | `build/`, `cmake-build-*/`, `_deps/`, `*.min.js`, `*.bundle.js` |+| Non-code languages | Config and infra languages from the language registry, plus anything the parser could not identify |++Symbols decorated by a framework are treated as live too: pytest fixtures, Flask+and FastAPI routes, Django `admin.register` and signal receivers, Celery tasks,+Click and Typer commands, and the JVM stereotype and routing annotations+(`@Component`, `@Service`, `@RestController`, `@Entity`, `@KafkaListener`,+`@GetMapping`, `@Test`, JAX-RS `@Path` / `@GET`). Decorator *suffixes* are matched+too, so `@my_local_group.command` and `@api.get` register even when the receiver+has a project-local name.++Two more targeted rescues: an `interface` in a file with no incoming `implements`+edges is capped at `0.40` (implementor detection is heuristic, and missing+evidence is not evidence of absence), and COM contract methods+(`QueryInterface`, `AddRef`, `Release`) are capped the same way because they are+dispatched through native vtables.++Zombie-package detection additionally ignores directories that are not packages+at all: `.github`, `.vscode`, `.devcontainer`, `docs`, `scripts`, `assets`,+`static`, `public`, `tests`, `benches`, `fuzz`, and their siblings.++## Dynamic-import awareness++When a file uses a runtime loader, repowise assumes its neighbours may be reached+through it and caps their confidence at `0.40`. Detected markers include:++- **Python**: `importlib.import_module`, `__import__(`, `importlib.reload`, `pkgutil.iter_modules`+- **JS/TS**: dynamic `import(`, `require.context(`, `import.meta.glob(`,+ `React.lazy(`, `next/dynamic`, `jest.mock(` / `vi.mock(`, and the+ `'use server'` / `'use client'` boundary directives++This is a text scan over source, grouped by file extension. Languages without+markers in the table get no dynamic-import protection, which is one of the honest+limits below.++## Workspaces: cross-repo consumers++In a workspace, a file that is dead inside its own repo may still be the surface+another repo depends on. `get_dead_code` checks every finding against the+cross-repo graph before returning it:++- **The file cross-changes with files in other repos.** Confidence is halved and+ the finding gains a `cross_repo_note` naming those repos. This is a behavioral+ signal drawn from git co-change history, not an import edge, so read it as+ "something over there moves when this moves".+- **Another repo depends on this one as a package**, the finding is an+ `unused_export`, and there was no co-change signal. Confidence is cut to 30% of+ its value with a note saying the export may be consumed and should be verified.++The adjustment runs after tiering, so it lowers the displayed confidence without+moving a finding between tiers. `repo="all"` aggregates every workspace repo,+sorts by confidence then size, and tags each finding with its repo alias.++The CLI has no cross-repo pass yet: `repowise dead-code --repo <alias>` analyzes+that one repo in isolation. See [WORKSPACES.md](../scale/WORKSPACES.md) for how+the cross-repo graph is built.++## Known false-positive sources++The layer is conservative, but it is still a static analysis over a static graph.+These are the cases where a finding is most likely wrong:++- **Reflection and string-keyed dispatch.** A class instantiated from a name in a+ config file, a handler looked up in a registry dict, a Java class loaded by+ `Class.forName`. The dynamic-pattern name list and the `.register` decorator+ suffix catch the common shapes; nothing catches all of them.+- **Dynamic imports in unmodelled languages.** The marker table covers Python and+ JS/TS. Go, Ruby, PHP, Kotlin, Swift, and Scala runtime loading is not detected+ yet, so an orphan in those languages carries no dynamic-import cap.+- **Entry points the graph did not mark.** A binary target, a CLI script, or a+ serverless handler that neither the allowlist nor the entry-point pass+ recognized reads as unreachable every time. If you see a whole directory light+ up, that is usually the cause.+- **Barrel re-exports.** `__init__.py` and index barrels are exempt from being+ flagged as unreachable *files*, but they are deliberately not exempt in the+ unused-export pass: a symbol defined in a barrel that nobody imports should+ still be reported. A symbol re-exported through a barrel to external callers+ can therefore surface as an unused export.+- **Python `__all__` is not read.** The dead-code layer never consults `__all__`,+ so declaring a public API there does not by itself rescue a symbol. The+ rescues that do apply are the `__init__.py` exemption, the dunder-name skip,+ and intra-module reference tracking.+- **Test-only usage reads as usage.** A test file's import produces a real graph+ edge, so a symbol only its tests touch is not flagged. That is deliberate, but+ it also means repowise will not tell you a symbol is *exclusively* exercised by+ tests. There is no "used only in tests" classification.+- **Recently added code.** A file under 30 days old with no importers is capped+ at `0.55` precisely because it is often unfinished, not dead.+- **Interfaces and abstract bases.** Reached only through implementors, which is+ heuristic detection. Capped, not suppressed.++The evidence list on every finding tells you which of these applied. Read it+before deleting anything.++## CLI reference++| Flag | Description |+|------|-------------|+| `--min-confidence` | Minimum confidence threshold (default `0.4`) |+| `--safe-only` | Only findings marked safe to delete |+| `--kind` | `unreachable_file`, `unused_export`, `unused_internal`, `zombie_package` |+| `--format` | `table` (default), `json`, `md` |+| `--include-internals` / `--no-include-internals` | Private and underscore symbols (default: off) |+| `--include-zombie-packages` / `--no-include-zombie-packages` | Unused declared packages (default: on) |+| `--no-unreachable` | Skip unreachable-file findings |+| `--no-unused-exports` | Skip unused-export findings |+| `--repo` | Workspace mode: target one repo (defaults to primary) |+| `--workspace` / `--no-workspace` | Force workspace or single-repo mode |++Full command reference: [CLI_REFERENCE.md](../reference/CLI_REFERENCE.md#repowise-dead-code-path).++## The `get_dead_code` MCP tool++Findings come back grouped into high, medium, and low tiers, each with the file+path, kind, confidence, line count, and a cleanup impact estimate.++| Parameter | Default | Notes |+|-----------|---------|-------|+| `kind` | all | One of the four finding kinds |+| `min_confidence` | `0.5` | `0.7` and above is cleanup-ready only |+| `tier` | all | `high` (`>= 0.8`), `medium`, `low` |+| `safe_only` | `false` | Deletion-ready only, excluding runtime-load risk |+| `limit` | `20` | Per tier, clamped to 25 |+| `directory` / `owner` | none | Path-prefix and primary-owner filters |+| `group_by` | none | Roll up by `directory` or `owner` instead of a flat list |+| `include_internals` | `false` | Private and underscore symbols |+| `include_zombie_packages` | `true` | |+| `no_unreachable` / `no_unused_exports` | `false` | |+| `repo` | primary | Workspace mode |++This is a tool for cleanup sweeps, not targeted fixes. Turn it off entirely with+`mcp: {tools: ["-get_dead_code"]}` in `.repowise/config.yaml`. Parameter details:+[MCP_TOOLS.md](../agent/MCP_TOOLS.md#get_dead_code).++## Where else it shows up++- The generated `CLAUDE.md` lists dead-code candidates alongside hotspots and+ decisions.+- Contributor profiles carry a dead-code burden per author.+- Module health folds dead-code percentage into its 0-100 composite.+- `repowise update` recomputes findings for changed files only.++## See also++- [INTELLIGENCE_LAYERS.md](INTELLIGENCE_LAYERS.md): how dead code fits the wider index.+- [CODE_HEALTH.md](CODE_HEALTH.md): the scoring layer that shares the same graph and git data.+- [LANGUAGE_SUPPORT.md](LANGUAGE_SUPPORT.md): which languages parse into the graph the analysis walks.diff --git a/docs/layers/DECISIONS.md b/docs/layers/DECISIONS.mdnew file mode 100644index 000000000..5650fb342--- /dev/null+++ b/docs/layers/DECISIONS.md@@ -0,0 +1,278 @@+# Architectural Decisions++Repowise mines the *why* out of your repo: the ADRs, commit bodies, PR+descriptions, and `# WHY:` comments where your team already wrote down its+reasoning, plus the choices you make in coding-agent sessions. Every record is+tied to the files it governs, backed by a verbatim quote, tracked for staleness,+and pushed back at your agent at the moment it is about to violate or honor it.++## Quick start++```bash+repowise init # extraction runs as part of indexing+repowise decision list # what has been captured+repowise decision list --proposed # auto-proposed, awaiting your review+repowise decision confirm a1b2c3d4 # promote a proposal to active+repowise decision health # stale, conflicting, ungoverned hotspots+repowise decision add # guided interactive capture+```++```+repowise decision health++ Decision Health++ Active decisions 14+ Proposed (needs review) 3+ Stale decisions 2+ Deprecated 1++ Stale decisions (2):+ 9f3c1a44 JWT over sessions (staleness: 0.72)+ 2b70de91 EventBus stays in-process (staleness: 0.58)++ Ungoverned hotspots (1):+ payments/processor.ts+```++From an agent:++```python+get_why(query="why JWT over sessions?") # NL search+get_why(query="src/payments/processor.ts") # what governs this file+get_why(query="why is caching split?", targets=["src/cache"])+get_why() # health dashboard+```++## Where decisions come from++Eight capture sources run at index time. Seven are deterministic passes over the+repo and its git history; the eighth is a harvest during LLM doc generation, and+it is the only one that needs a provider.++| Source | Key | Reads | Notes |+|--------|-----|-------|-------|+| ADR files | `adr` | `adr/`, `adrs/`, `docs/adr/`, `docs/adrs/`, `docs/decisions/`, `decisions/`, `architecture/`, `doc/adr/` | Nygard and MADR headings plus YAML frontmatter, parsed without an LLM. Up to 60 files. `accepted`/`approved` map to `active`, `draft` to `proposed`, `rejected` to `deprecated`. |+| Inline markers | `inline_marker` | `# WHY:` / `# DECISION:` / `# TRADEOFF:` / `# ADR:` / `# RATIONALE:` / `# REJECTED:` | Any comment syntax (`#`, `//`, `--`, `/*`, `*`). Up to 5 continuation lines, plus 20 lines of surrounding context. Fenced code blocks in Markdown are skipped. |+| Git archaeology | `git_archaeology` | Commit messages | Gated on 19 decision verbs (migrate, switch to, replace, adopt, deprecate, drop, rewrite, split, revert, and the rest). |+| PR bodies | `pr` | Squash-merge and PR commit bodies | A body only qualifies when it looks like a PR description (`## Why`, `## Motivation`, `## Context`, `Closes #`, `Before:` / `After:`). Up to 25 bodies. |+| CHANGELOG | `changelog` | `CHANGELOG` / `HISTORY` / `NEWS` / `CHANGES` / release notes | keep-a-changelog `Changed` / `Removed` / `Deprecated` / `Security` sections only. `Added` is deliberately excluded: a new feature is rarely a structural decision. Up to 15 versions. |+| README and docs | `readme_mining` | README and docs prose | Implicit decisions stated in prose. |+| Code comments | `comment` | Block comments and docstrings on high-centrality files | Bounded to 30 nodes, and to prose carrying a rationale cue ("because", "instead of", "rather than", "trade-off", "we chose", "deliberately"). Centrality-bounded on purpose: comment archaeology across a whole repo is noise. |+| Doc generation | `llm_inferred` | The wiki generation pass | The page generator proposes decisions it inferred while writing a page. Every field must survive the grounding gate below. |++Two more sources sit outside the index-time set: `session` (mined from your+coding-agent transcripts, below) and `cli` (a decision you typed yourself, the+most authoritative source there is).++Turn any source off per repo in `.repowise/config.yaml`:++```yaml+decisions:+ session_mining: true+ sources:+ comment: false # skip comment archaeology+ # inline_marker: false+ # git_archaeology: false+ # readme_mining: false+ # adr: false+ # changelog: false+ # pr: false+```++Sources you do not mention stay on, and unknown keys are ignored, so an old+config never breaks extraction. Full block reference:+[CONFIG.md](../reference/CONFIG.md).++## Evidence: verified, fuzzy, unverified++Every produced field (`decision`, `rationale`, `source_quote`) is checked against+the verbatim source span the extractor recorded. This is the anti-hallucination+gate, and it matters most for the generated sources: the page generator *writes*+candidate decisions rather than only reading them, and the gate is what stops a+fluent invention from being stored as institutional memory.++| Verdict | Fires when | Effect on confidence |+|---------|-----------|----------------------|+| `exact` | The normalized quote is a substring of the source span. | No penalty. |+| `fuzzy` | Token overlap with the source span is at least 0.6 (a paraphrase or a reflow). | Multiplied by 0.85. |+| `unverified` | Neither, or there was no source span to check against. | Multiplied by 0.6. |++An ungrounded field is cleared, not kept. A candidate whose every produced field+is ungrounded is rejected outright. A candidate with no source text at all is+kept but stamped `unverified`: repowise never fabricates a rejection it cannot+justify.++Confidence then rises with how authoritative the source is and how many+independent sources corroborate it:++```+confidence = 0.4 + 0.5 * (best_source_rank / 9)+ + min(0.12, 0.04 * (corroborating_sources - 1))+ x verification penalty+```++The rank ladder is `cli` 9, `adr` 8, `session` and `pr` 7, `commit` and+`git_archaeology` 6, `changelog` 5, `inline_marker` 4, `comment` and+`readme_mining` 3, and the heuristic tiers below that. The result is clamped to+`[0, 0.99]`: nothing is ever certain.++**Sources corroborate, they do not overwrite.** The same decision found in an ADR+and in a commit body becomes one record with two evidence rows. Headline fields+come from the highest-ranked row; the lower-ranked one is kept as corroboration+and pushes confidence up. A decision resting only on a plain code comment is+decayed a further 0.85 so it never reads as confident as an ADR.++## The decision graph++Decisions are not a flat list. Typed edges connect them:++| Edge | Meaning |+|------|---------|+| `supersedes` | The newer decision replaces the older one. Above 0.85 supersession confidence the older record auto-flips to `superseded`; below that it is recorded as a reviewable proposal instead. |+| `refines` | Narrows or extends a decision without reversing it. |+| `relates_to` | Same topic, no ordering claim. |+| `conflicts_with` | Two *active* decisions contradict each other. A governance smell, surfaced in `decision health` and in the code-health layer. |++Detection is deterministic first. Two decisions have to share a topic (at least+two shared content tokens after stopword removal) and then either straddle an+opposing verb pair (`adopt` / `use` / `introduce` against `drop` / `remove` /+`deprecate` / `revert`) or carry a reversal signal ("replace", "migrate",+"switch to", "no longer", "in favor of"). An LLM tiebreaker only runs on the+pairs the heuristic cannot call.++`supersedes` and `refines` chain into a **lineage**, so `get_why` can answer+"why is auth structured this way?" with `sessions -> JWT -> OAuth2` rather than+three disconnected records. `get_why(query="<path>")` returns the lineage+whenever the chain has more than one node.++Edges accrete rather than clobber, and confirmations are sticky in both+directions: `repowise decision dismiss` keeps a `dismissed` tombstone so+reindexing never re-proposes the same thing, and a confirmed `active` decision is+never walked back to `proposed` by a later extraction.++## Staleness++A decision is only useful while it still describes the code. Every record carries+a `staleness_score` between 0 and 1, recomputed per affected file:++- The file no longer exists: `1.0`.+- The file has not changed since the decision was recorded: `0.0`.+- Otherwise it grows with 90-day commit count and file age.+- Plus `0.3` when a commit *after* the decision was recorded contains a conflict+ signal ("replace", "remove", "deprecate", "migrate away", "revert", "drop")+ and shares topic words with the decision text.++The record's score is the mean across its affected files. `>= 0.5` is stale+everywhere: `repowise decision list --stale-only`, the health summary, and the+staleness column in the CLI table.++Staleness also decays the relevance of a decision when it is injected into a+session, so guidance that stopped being true stops being pushed.++## Session-mined decisions++`repowise update` (docs mode) reads your local coding-agent transcripts and mines+the durable decisions out of them: user corrections, explicit choices with a+stated reason, and failed approaches replaced by working ones. Claude Code+transcripts come from `~/.claude/projects/`, read incrementally from a cursor so+each line is processed once.++Three stages, in order:++1. **Deterministic gates.** A user correction needs a pushback lead ("no,",+ "don't", "not like that", "actually,", "instead"). An explicit choice needs a+ decision verb ("use", "went with", "switched to", "chose", "always", "never")+ *paired* with a causal marker. A dead end needs three consecutive failures of+ the same command anchor.+2. **One batched LLM structuring call per update**, capped at 60 candidates.+ Every produced field must quote the transcript verbatim or it is dropped;+ an ungrounded `source_quote` rejects the candidate.+3. **Observation-counted promotion.** A decision seen in two or more distinct+ sessions is promoted to `active` with `source: session`. A direct user+ correction promotes after one.++Everything stays on your machine. Transcripts are read locally, staging lives in+`.repowise/sessions/sessions.db`, and only the distilled decision text about the+codebase is stored. Turn the pipeline off with `decisions.session_mining: false`.++## Getting decisions back to your agent++Capture is half the loop. The other half is delivery, and it happens at two+moments without the agent asking (see [HOOKS.md](../agent/HOOKS.md)):++**At session start.** Repowise scores active decisions against the session's+likely working set (dirty and staged files, files changed on the branch versus+`main`, the previous session's edited files, branch-name tokens), expands that+one hop through import edges and co-change partners, and injects the top few+under a hard ~400-token cap. Relevance is multiplied by confidence and by+freshness, so a stale or low-confidence record has to be *much* more relevant to+make the cut. Nothing clears the floor means nothing is injected: decisions are+never shown just for being high-confidence.++**At edit time.** When the agent edits a file governed by a decision (through the+`file` and `module` node links), it gets a one-line notice with the rationale, at+most once per session per decision. This is the moment that matters, right before+the code is written.++Every injected decision id is recorded locally. On the next `repowise update` the+session miner checks whether the guidance was followed or contradicted by your+corrections in that session and adjusts the decision's staleness accordingly.+That is the feedback loop: guidance you keep overriding fades out.++Decisions also land in the generated `CLAUDE.md` (active records, freshest+first) and in `get_overview()`, `get_context()`, and the `governance_risk` flag+in `get_risk()` PR review.++## CLI reference++Every subcommand takes an optional trailing `PATH`; in workspace mode it targets+the primary repo. Decision ids accept an 8-character prefix.++| Command | What it does |+|---------|--------------|+| `repowise decision add` | Guided interactive capture: title, context, decision, rationale, rejected alternatives, tradeoffs, affected files, tags. Stored `active` at confidence 1.0. |+| `repowise decision list` | Table of id, title, status, source, confidence, staleness, created date. |+| `repowise decision show ID` | Full record including alternatives, consequences, affected files, and the evidence file and line. |+| `repowise decision confirm ID` | Promote a proposal to `active`. |+| `repowise decision dismiss ID` | Tombstone it. Never re-proposed on reindex. |+| `repowise decision deprecate ID` | Mark deprecated, optionally `--superseded-by <ID>`. |+| `repowise decision health` | Counts, stale decisions, ungoverned hotspots, proposals awaiting review. |++`list` filters:++| Flag | Values |+|------|--------|+| `--status` | `proposed`, `active`, `deprecated`, `superseded`, `dismissed`, `all` (default) |+| `--source` | `git_archaeology`, `inline_marker`, `readme_mining`, `cli`, `all` (default) |+| `--proposed` | Shortcut for `--status proposed` |+| `--stale-only` | Only records with staleness at or above 0.5 |++Full flag reference: [CLI_REFERENCE.md](../reference/CLI_REFERENCE.md#repowise-decision).++## The `get_why` MCP tool++`get_why(query=None, targets=None, repo=None)` dispatches into four modes:++| Call shape | Mode | Returns |+|------------|------|---------|+| No `query` | health | `counts`, `stale_decisions`, `proposed_awaiting_review`, `ungoverned_hotspots`, `conflicts` |+| `query` is a path | path | The decisions governing that file (with `lineage` when the chain is longer than one), an `origin_story` from git, and an `alignment` read |+| `query` is a question | search | Ranked decision records plus `related_documentation`, optionally anchored with `targets` |+| `repo="all"` | workspace search | The same records across every workspace repo, each tagged with its alias |++It is designed never to come back empty-handed. If no decision record covers a+path, it falls back to git archaeology on that file. If git history is silent+too, it mines a rationale comment live from the source and returns it as+`code_rationale`. Semantic decision search falls back to full-text search when+the vector store is unavailable.++See [MCP_TOOLS.md](../agent/MCP_TOOLS.md#get_why) for parameters and worked+examples.++## See also++- [INTELLIGENCE_LAYERS.md](INTELLIGENCE_LAYERS.md): where decisions sit among the five layers.+- [CODE_HEALTH.md](CODE_HEALTH.md): the `ungoverned_hotspot`, `stale_governance`, and `contradictory_decision` findings.+- [HOOKS.md](../agent/HOOKS.md): the SessionStart and edit-time injection hooks in detail.+- [CONFIG.md](../reference/CONFIG.md): the `decisions:` block.diff --git a/docs/INTELLIGENCE_LAYERS.md b/docs/layers/INTELLIGENCE_LAYERS.mdsimilarity index 93%rename from docs/INTELLIGENCE_LAYERS.mdrename to docs/layers/INTELLIGENCE_LAYERS.mdindex 8988d972e..dca482501 100644--- a/docs/INTELLIGENCE_LAYERS.md+++ b/docs/layers/INTELLIGENCE_LAYERS.md@@ -5,7 +5,7 @@ keeps them in sync on every commit. This document is the deep dive; the READMEgives the one-paragraph version of each layer and links here for the detail.<div align="center">-<img src="../.github/assets/intelligence-layers.svg" alt="repowise's five intelligence layers: one index (repowise init) fans into Graph, Git, Docs, Decisions, and Code Health, each surfaced through its signature MCP tool and delivered through 9 task-shaped tools, the CLI, the local dashboard, auto-generated CLAUDE.md/AGENTS.md, and the PR bot" width="100%" />+<img src="../../.github/assets/intelligence-layers.svg" alt="repowise's five intelligence layers: one index (repowise init) fans into Graph, Git, Docs, Decisions, and Code Health, each surfaced through its signature MCP tool and delivered through 10 task-shaped tools, the CLI, the local dashboard, auto-generated CLAUDE.md/AGENTS.md, and the PR bot" width="100%" /></div>The layers compound. The graph locates what git flags,@@ -28,7 +28,7 @@ Two cross-cutting capabilities sit on top of the layers:## Graph Intelligence-tree-sitter parses every file across 15 languages into a **two-tier dependency+tree-sitter parses every file across 16 languages into a **two-tier dependencygraph**: file nodes and symbol nodes (functions, classes, methods). A 3-tiercall resolver with confidence scoring handles import aliases, barrelre-exports, and namespace imports. Heritage extraction covers `extends`,@@ -43,8 +43,8 @@ re-exports, and namespace imports. Heritage extraction covers `extends`,Flask, ASP.NET, Spring Boot, Express/NestJS, Gin/Echo/Chi, Axum/Actix, Rails,Laravel, and more.-See [`docs/LANGUAGE_SUPPORT.md`](LANGUAGE_SUPPORT.md) for per-language coverage-and [`docs/COMPUTED_GLOSSARY.md`](COMPUTED_GLOSSARY.md) for every derived metric.+See [`docs/layers/LANGUAGE_SUPPORT.md`](LANGUAGE_SUPPORT.md) for per-language coverage+and [`docs/reference/COMPUTED_GLOSSARY.md`](../reference/COMPUTED_GLOSSARY.md) for every derived metric.---@@ -121,7 +121,7 @@ staleness as code evolves.Every decision is **evidence-backed**: each rationale traces to a verbatimsource span (ADR quote, commit body, code comment), and an anti-hallucination-substring gate stamps each as **verified / fuzzy / unverified**: corroborating+substring gate stamps each as **exact / fuzzy / unverified**: corroboratingsources raise confidence rather than overwrite each other.Decisions form a **graph**: typed edges (`supersedes` / `refines` /@@ -207,11 +207,11 @@ repowise status # one-line summary in the status reportcentrality × blast radius`, on the dashboard **Refactoring** tab, via `repowisehealth --refactoring-targets`, and via `get_health(include=["refactoring"])`. Anopt-in LLM pass expands any plan into generated code + a diff. See- [`docs/REFACTORING.md`](REFACTORING.md).+ [`docs/layers/REFACTORING.md`](REFACTORING.md).- **Per-file overrides** via `.repowise/health-rules.json`.Validated against real defect history; see-[`docs/CODE_HEALTH.md`](CODE_HEALTH.md) for the full user guide, the per-marker+[`docs/layers/CODE_HEALTH.md`](CODE_HEALTH.md) for the full user guide, the per-markerreference, and the calibration story, and[repowise-bench](https://github.com/repowise-dev/repowise-bench) for thereproducible defect-prediction and head-to-head benchmarks.@@ -251,7 +251,7 @@ and notifies the agent:Run `repowise update` to refresh documentation and graph context.```-> **Related capability:** [Distill](DISTILL.md) reuses these layers' index+> **Related capability:** [Distill](../agent/DISTILL.md) reuses these layers' index> (symbol bounds, centrality, hotspots) to compress noisy command output and> large file reads before the agent sees them, a capability built *on* the> five layers, not a sixth layer.@@ -280,7 +280,7 @@ repowise watch --workspace # all workspace repos```A typical single-commit update touches 3–10 pages and completes in under 30-seconds. Full guide: [`docs/AUTO_SYNC.md`](AUTO_SYNC.md).+seconds. Full guide: [`docs/scale/AUTO_SYNC.md`](../scale/AUTO_SYNC.md).---diff --git a/docs/LANGUAGE_SUPPORT.md b/docs/layers/LANGUAGE_SUPPORT.mdsimilarity index 97%rename from docs/LANGUAGE_SUPPORT.mdrename to docs/layers/LANGUAGE_SUPPORT.mdindex 465547cdc..4126a45ec 100644--- a/docs/LANGUAGE_SUPPORT.md+++ b/docs/layers/LANGUAGE_SUPPORT.md@@ -6,7 +6,7 @@ Everything else in your repo is still tracked through git history and appears inthe wiki. This page is the "what works for my language today" reference.> **How to add a language, and how the pipeline works internally:** see-> [architecture/language-support.md](architecture/language-support.md). Adding+> [architecture/language-support.md](../architecture/language-support.md). Adding> a language needs one `.scm` query file and one config entry, with no changes> to the parser core.@@ -91,7 +91,7 @@ implementations, and ORM entities to relationships:The dead-code analyzer understands each ecosystem's entry points, generated-fileconventions, and never-flag globs so build products and framework-invoked codearen't reported as unreachable. (Full per-language detail:-[architecture/language-support.md](architecture/language-support.md).)+[architecture/language-support.md](../architecture/language-support.md).)---@@ -128,7 +128,7 @@ rather than tree-sitter, plus the lightweight import tier for dbt lineage.- **App-to-database contracts** (workspace mode), pairs table *providers* (DDL,Alembic, ORM entities) with table *consumers* (SQL string literals in appcode) into `data` contracts on the Live System Map. See- [WORKSPACES.md](WORKSPACES.md).+ [WORKSPACES.md](../scale/WORKSPACES.md).- **Health markers**, stored routines get cyclomatic complexity;`sql_select_star`, `sql_update_delete_without_where`, and `sql_cartesian_join`ride the sqlglot AST. All uncalibrated by construction and never move the@@ -264,6 +264,6 @@ where a dialect isn't wired yet. Per-marker mechanics and precision hazards:## See also-- [architecture/language-support.md](architecture/language-support.md), pipeline internals + how to add a language+- [architecture/language-support.md](../architecture/language-support.md), pipeline internals + how to add a language- [CODE_HEALTH.md](CODE_HEALTH.md), code-health markers and per-language precision-- [WORKSPACES.md](WORKSPACES.md), cross-repo contracts and co-change+- [WORKSPACES.md](../scale/WORKSPACES.md), cross-repo contracts and co-changediff --git a/docs/REFACTORING.md b/docs/layers/REFACTORING.mdsimilarity index 95%rename from docs/REFACTORING.mdrename to docs/layers/REFACTORING.mdindex 36c506211..4037e8b01 100644--- a/docs/REFACTORING.md+++ b/docs/layers/REFACTORING.md@@ -20,7 +20,7 @@ computed with no re-parse, **no LLM, no network**, inside the same <30s budget.LLM layer (code generation) is a separate, strictly opt-in step ([below](#opt-in-code-generation)).<div align="center">-<img src="../.github/assets/health-loop.svg" alt="repowise code-health loop: markers fan into three signals, the graph and git history locate risk, and refactoring intelligence emits concrete plans an agent executes" width="100%" />+<img src="../../.github/assets/health-loop.svg" alt="repowise code-health loop: markers fan into three signals, the graph and git history locate risk, and refactoring intelligence emits concrete plans an agent executes" width="100%" /></div>## The six detectors@@ -180,9 +180,9 @@ the same way a marker is:## See also-- [`docs/CODE_HEALTH.md`](CODE_HEALTH.md): the markers and the three health+- [`docs/layers/CODE_HEALTH.md`](CODE_HEALTH.md): the markers and the three healthsignals the suggestions are built on.-- [`docs/INTELLIGENCE_LAYERS.md`](INTELLIGENCE_LAYERS.md): how code health fits+- [`docs/layers/INTELLIGENCE_LAYERS.md`](INTELLIGENCE_LAYERS.md): how code health fitsthe five-layer index.-- [`docs/MCP_TOOLS.md`](MCP_TOOLS.md): the `get_health(include=["refactoring"])`+- [`docs/agent/MCP_TOOLS.md`](../agent/MCP_TOOLS.md): the `get_health(include=["refactoring"])`response shape.diff --git a/docs/layers/TEST_INTELLIGENCE.md b/docs/layers/TEST_INTELLIGENCE.mdnew file mode 100644index 000000000..3dfd9f381--- /dev/null+++ b/docs/layers/TEST_INTELLIGENCE.md@@ -0,0 +1,268 @@+# Test Intelligence++Ingest a coverage report and repowise can answer two questions your CI cannot:+which files are risky *and* untested, and which tests a given diff actually+exercises. That second one turns a 4,000-test suite into the 40 tests that guard+the change you just made.++Everything here is an index lookup: no LLM, no network.++## Quick start++```bash+# 1. Produce a report. Any of these work.+pytest --cov --cov-report=lcov:coverage.lcov+coverage run --contexts=test -m pytest # also builds the per-test map++# 2. Ingest it.+repowise coverage add coverage.lcov+repowise coverage add .coverage # per-file coverage + per-test map+repowise coverage status++# 3. Use it.+repowise health # untested hotspots now light up+repowise impacted-tests main..HEAD # the tests guarding this branch+repowise impacted-tests main..HEAD --format list | xargs pytest+```++```+repowise coverage status++ Coverage (lcov)+ Files: 412+ Lines: 71.4%+ Branch: 63.9%++ Test-to-code map (coverage.py)+ Tests: 1,204+ Files: 388+ Records: 19,551+```++## Two dimensions, one command++`repowise coverage add` stores two different things, and the difference matters+for everything below.++| Dimension | What a row says | Powers |+|-----------|-----------------|--------|+| **Per-file aggregate** | This file is 71% covered, merged across every test. | `untested_hotspot`, `coverage_gap`, `coverage_gradient` in [code health](CODE_HEALTH.md), the coverage dashboard |+| **Per-test map** | Test `tests/test_auth.py::test_login` covered lines 40-58 of `src/auth/service.py`. | `repowise impacted-tests`, `get_change_risk`'s `impacted_tests`, `get_risk`'s `tests_to_run` |++The aggregate always gets stored. The map is only built when the report carries+per-test contexts. A report without contexts still ingests fine, it just skips+the map.++Both are point-in-time: each ingest replaces the previous rows rather than+appending history. Ingest at the same commit you intend to query, so line numbers+line up.++## Supported formats++| Format | Detected by | Per-test map |+|--------|-------------|--------------|+| **LCOV** | Leading `TN:` / `SF:`, or any `TN\|SF\|DA\|BRDA\|LF\|LH\|BRF\|BRH:` line | Yes, when each record carries a non-blank `TN:` test name |+| **Cobertura** XML | `<coverage` plus `<packages` or `line-rate` | No |+| **Clover** XML | `<coverage` plus `<project` | No |+| **coverage.py `.coverage`** | SQLite magic bytes | Yes, when written with `--contexts` |+| **Normalized JSON** (`repowise-coverage-v1`) | Leading `{` plus `repowise-coverage` or `line_coverage_pct` | No |++Force a parser with `--format lcov|cobertura|clover|repowise-json`. The normalized+JSON shape lets you feed any runner once you map it:++```json+{ "format": "repowise-coverage-v1",+ "files": { "src/foo.py": { "line_coverage_pct": 87.5,+ "total_coverable_lines": 40 } } }+```++With no path argument, `add` auto-discovers `coverage/lcov.info`, `lcov.info`,+`coverage.lcov`, `coverage.xml`, `**/cobertura.xml`, `**/clover.xml`,+`target/llvm-cov/**/*.lcov`, and a repo-root `.coverage`. Multiple reports merge+with hit-wins: covered lines union, coverable counts take the max.++Report paths are matched to indexed files by exact key first, then basename, then+the longest trailing-path overlap. A tie refuses to guess and is reported as+ambiguous rather than mapped to the wrong file. If a whole report comes back+unmatched, set `coverage.strip_prefix` in `.repowise/config.yaml`.++## Building a per-test map++The map needs a report that records *which test* covered each line. Two paths+exist today.++**coverage.py dynamic contexts** (the main one):++```bash+coverage run --contexts=test -m pytest+repowise coverage add .coverage+```++The `.coverage` file is read directly as read-only SQLite. Repowise decodes the+`numbits` line bitmaps itself, so it has no runtime dependency on coverage.py,+and falls back to the `arc` table when line bits are absent. Contexts look like+`tests/test_auth.py::TestLogin::test_ok|run`; the leading path becomes the test's+own file when it is resolvable.++**Per-test LCOV:** a report where each `end_of_record` block carries a distinct+`TN:` name. Blocks with a blank `TN:` are skipped. A bare suite label with no+path resolves to a test id with no test file, which is still usable for "run+these" but not for staleness reasoning.++If you ran without contexts, `coverage add` says so explicitly rather than+silently producing an empty map.++Rows land in a `test_coverage` table indexed both ways (repo plus source file for+the reverse lookup, repo plus test id for the forward one), capped at 250,000+rows. The CLI reports how many were dropped if you hit the cap.++## Impacted tests++`repowise impacted-tests` diffs a change, looks up the changed *lines* in the+map, and returns the tests whose recorded coverage intersects them.++```bash+repowise impacted-tests # staged changes (the default)+repowise impacted-tests main..HEAD # a branch or PR range+repowise impacted-tests abc123 # a single commit+repowise impacted-tests main..HEAD --format list | xargs pytest+```++| Flag | Values |+|------|--------|+| `--path` | Repo path (defaults to cwd, or the workspace primary) |+| `--staged` | Diff `git diff --cached`. Implied when no range is given |+| `--format` | `table` (default), `json` (full report), `list` (test ids, one per line) |++It always says which path fired, and it never lets a guess pass for evidence:++| Situation | Reported as |+|-----------|-------------|+| Changed file has per-test coverage on the changed lines | The exact covering tests, `via: coverage` |+| Changed file has no coverage rows | A filename-pattern **guess** at its paired test, labelled `via: filename-pattern-guess` and printed in its own "NOT coverage-backed" table |+| Neither coverage nor a paired test | "unknown, run the full suite to be safe" |+| No map ingested at all | A prompt to run `coverage add` on a report with contexts |++Deletion-only files are dropped from the diff (there are no new lines to cover).+With `--format list` the caveats go to stderr so the stdout pipe into `pytest`+stays clean. The command exits `0` in every one of these cases, including "no+tests found": it is a reporting tool, not a gate.++## Untested hotspots++Coverage feeds the [code health](CODE_HEALTH.md) layer's test-coverage markers.+The sharpest of them is `untested_hotspot`, the textbook "write tests before you+refactor" case. It fires only when a file is all three of:++1. **A hotspot.** Flagged as one by the git layer, or 8+ commits in 90 days, or a+ temporal hotspot score at or above 0.8.+2. **Centrally depended on.** At least 4 dependents. Below that, a churning file+ is usually a leaf one author is iterating on, and flagging it is noise.+3. **Under-tested.** Line coverage below 40%. When no coverage has been ingested+ at all, it falls back to firing only when the file has no paired test file+ either, which is the conservative reading.++Severity is `CRITICAL` at 15% coverage or less with 10+ dependents, `HIGH` at one+of those two, `MEDIUM` otherwise. Its sibling `coverage_gap` handles the+has-coverage-but-thin case, and `coverage_gradient` applies a continuous+deduction proportional to the uncovered fraction, so a file is penalised in+proportion to how much of it is untested rather than only at a cliff.++## From an agent++Two MCP tools carry test information, at two different granularities.++**`get_risk(changed_files=[...])`** leads with a `directive` block whose+`tests_to_run` names the tests the map proves exercise the changed *files*. It is+file-level and scoped to the diff itself, capped at ten, and holds test node ids+rather than paths.++**`get_change_risk(revspec=...)`** returns `impacted_tests`, computed from the+changed *lines*, so it is a strictly narrower and more useful set:++```json+{+ "status": "map_present",+ "map_present": true,+ "tests": ["tests/test_auth.py::test_login", "..."],+ "total": 23,+ "truncated": true,+ "missing_tests": {+ "untested_changes": [{"source_file": "...", "uncovered_lines": [...]}],+ "stale_test_candidates": [...],+ "covered": [...],+ "no_coverage_data": [...]+ },+ "summary": "23 test(s) cover the changed lines; showing first 10."+}+```++The `missing_tests` buckets are the honest breakdown: `untested_changes` is the+strong signal (the file *is* in the map, but nothing covers the lines you+touched), `stale_test_candidates` flags covered lines whose guarding test file is+absent from the diff, and `no_coverage_data` means the file is simply not in the+map.++`get_change_risk` deliberately omits the CLI's filename-pattern guess. An agent+cannot tell a guess from real coverage, and `no_coverage_data` already reports+those files honestly.++## Empty means unknown, not "no tests"++This is the contract that makes the whole layer safe to act on, and it is worth+stating plainly: **an empty test list never means the change is untested.**++Both tools carry an explicit discriminator alongside the list:++- `get_change_risk` sets `status` to `"map_present"` only when a map exists.+ With no map ingested it returns `status: "no_map"`, `map_present: false`, and a+ summary that says "run the full suite" plus the two commands that build the+ map. Other degraded statuses are `no_index` (nothing indexed yet), `unknown`+ (the git read failed), and `no_source_line_changes`.+- `get_risk` produces `tests_to_run` from a `guarding_tests` block whose+ `map_present` flag is `false` when no map is ingested. Note that the+ `directive` lifts `tests_to_run` but not `map_present`, so read+ `pr_blast_radius.guarding_tests.map_present` to tell the two cases apart.++Only `status: "map_present"` with an empty `tests` list means "the map exists and+nothing in it covers this change". That is a real finding. Everything else is an+absence of evidence, and repowise says so rather than implying a clean bill of+health. The same rule runs through the CLI ("unknown, run the full suite"), the+`no_coverage_data` bucket, and the coverage lookup helpers, which document+absence as unknown at every layer.++## Configuration++The `coverage:` block in `.repowise/config.yaml`:++```yaml+coverage:+ auto_discover: true+ artifacts: # override the discovery globs+ - "coverage/lcov.info"+ format: lcov # skip format sniffing+ strip_prefix: "/build/src/" # trim an absolute prefix from report paths+ reingest_on_update: false+```++Coverage is also auto-discovered and ingested during `init` and `update`, and+`repowise init --coverage-report <path>` takes explicit reports (repeatable).+Note that `--coverage-report` is test coverage, while `--coverage` controls+*documentation* breadth. Two different things, similarly named.++## CLI reference++| Command | What it does |+|---------|--------------|+| `repowise coverage add [PATHS...]` | Ingest reports. Auto-discovers when no path is given, merges multiple, builds the per-test map when contexts are present. Flags: `--path`, `--format`, `--verbose` |+| `repowise coverage status` | Coverage summary plus test-to-code map counts. Flag: `--path` |+| `repowise impacted-tests [REVSPEC]` | The tests a change exercises. Flags: `--path`, `--staged`, `--format` |++Full reference: [CLI_REFERENCE.md](../reference/CLI_REFERENCE.md#repowise-coverage).++## See also++- [CODE_HEALTH.md](CODE_HEALTH.md): the coverage markers and how they deduct from the score.+- [CHANGE_RISK.md](CHANGE_RISK.md): the risk score that `impacted_tests` rides alongside.+- [MCP_TOOLS.md](../agent/MCP_TOOLS.md#get_change_risk): full parameter and response reference.+- [CONFIG.md](../reference/CONFIG.md): the `coverage:` block.diff --git a/docs/WIKI_STYLES.md b/docs/layers/WIKI_STYLES.mdsimilarity index 100%rename from docs/WIKI_STYLES.mdrename to docs/layers/WIKI_STYLES.mddiff --git a/docs/CLI_REFERENCE.md b/docs/reference/CLI_REFERENCE.mdsimilarity index 97%rename from docs/CLI_REFERENCE.mdrename to docs/reference/CLI_REFERENCE.mdindex ee0e13a05..4faf3b73e 100644--- a/docs/CLI_REFERENCE.md+++ b/docs/reference/CLI_REFERENCE.md@@ -1,6 +1,6 @@# CLI Reference-Complete reference for all `repowise` commands. For a guided introduction, see the [Quickstart](QUICKSTART.md).+Complete reference for all `repowise` commands. For a guided introduction, see the [Quickstart](../start/QUICKSTART.md).Command list (in `--help` order): `augment`, `init`, `delete`, `generate-claude-md`, `costs`, `update`, `dead-code`, `health`, `risk`, `decision`, `coverage`, `impacted-tests`, `search`, `distill`, `expand`, `saved`, `corrections`, `export`, `hook`, `status`, `doctor`, `watch`, `serve`, `mcp`, `reindex`, `restyle`, `wiki-styles`, `whats-new`, `telemetry`, `login`, `logout`, `whoami`, `workspace`. Two more ship as separate console scripts, not subcommands: `repowise-augment`, `repowise-rewrite` (both hook entry points, not meant to be run by hand).@@ -77,7 +77,7 @@ All three reach the indexing knobs; the LLM-only knobs appear only when docs are| `--coverage-report` | Test-coverage report to ingest (LCOV / Cobertura / Clover). Repeatable. Auto-discovered when omitted. Distinct from `--coverage`, which controls documentation breadth. || `--onboarding` / `--no-onboarding` | Generate the curated Onboarding collection (up to 8 overview pages). Default: on; slots without enough signal are skipped. || `--harvest-decisions` / `--no-harvest-decisions` | Harvest architectural decisions during page generation (verified against source before storage). Default: on. |-| `--wiki-style` | Documentation voice/density: `comprehensive` (default), `caveman` (token-condensed, AI-first), `reference` (API-manual), `tutorial` (beginner-friendly). Interactive full runs prompt when omitted. Saved to config so `update` keeps the style. See [WIKI_STYLES.md](WIKI_STYLES.md). |+| `--wiki-style` | Documentation voice/density: `comprehensive` (default), `caveman` (token-condensed, AI-first), `reference` (API-manual), `tutorial` (beginner-friendly). Interactive full runs prompt when omitted. Saved to config so `update` keeps the style. See [WIKI_STYLES.md](../layers/WIKI_STYLES.md). || `--language` | Output language for generated wiki pages: `en` (default), `ar`, `de`, `es`, `fr`, `hi`, `it`, `ja`, `ko`, `nl`, `pl`, `pt`, `ru`, `tr`, `zh`. Code, file paths, and symbol names stay untranslated. Saved to config so `update` keeps the language. Also asked in advanced interactive mode. To switch an existing wiki's language, set the flag and re-run `init --force`. || `--resume` | Resume from the last checkpoint if interrupted || `--force` | Regenerate all pages even if they exist |@@ -86,8 +86,8 @@ All three reach the indexing knobs; the LLM-only knobs appear only when docs are| `--no-claude-md` | Don't generate `CLAUDE.md` || `--agents` / `--no-agents` | Generate or skip managed `AGENTS.md` for Codex. Persists the preference. || `--codex` / `--no-codex` | Generate or skip project-local Codex MCP/hooks setup. Interactive runs prompt when Codex CLI is installed and logged in; non-interactive runs require `--codex`. |-| `--distill-hook` / `--no-distill-hook` | Install or skip the Distill command-rewrite hook (Claude Code PreToolUse). Strictly opt-in: interactive runs prompt (default No); `--no-distill-hook` also gates the repo off in config so a globally installed hook stays inert here. In workspace mode the verdict applies to every selected repo. See [DISTILL.md](DISTILL.md). |-| `--seed-from` | Seed the index from an explicit base checkout instead of the auto-detected one. Rarely needed: inside a linked git worktree the base is detected and seeded automatically. See [WORKTREES.md](WORKTREES.md). |+| `--distill-hook` / `--no-distill-hook` | Install or skip the Distill command-rewrite hook (Claude Code PreToolUse). Strictly opt-in: interactive runs prompt (default No); `--no-distill-hook` also gates the repo off in config so a globally installed hook stays inert here. In workspace mode the verdict applies to every selected repo. See [DISTILL.md](../agent/DISTILL.md). |+| `--seed-from` | Seed the index from an explicit base checkout instead of the auto-detected one. Rarely needed: inside a linked git worktree the base is detected and seeded automatically. See [WORKTREES.md](../scale/WORKTREES.md). || `--no-seed` | Disable worktree auto-seeding and run a full init even inside a linked worktree. || `--yes` / `-y` | Skip confirmation prompts || `--dry-run` | Show generation plan and cost estimate without running |@@ -145,7 +145,7 @@ prompt-hash check skips them.Inside an unindexed linked git worktree, `update` first seeds the index fromthe base checkout automatically, then proceeds with the incremental update.-See [WORKTREES.md](WORKTREES.md).+See [WORKTREES.md](../scale/WORKTREES.md).**Options:**@@ -200,7 +200,7 @@ With no `STYLE`, prints the current style and the available choices.Styles only differ in voice and density; the markdown structure (headings,sections) stays the same, so search, the table of contents, and cross-links keep-working. See [WIKI_STYLES.md](WIKI_STYLES.md).+working. See [WIKI_STYLES.md](../layers/WIKI_STYLES.md).**Options:**@@ -402,7 +402,7 @@ repowise risk --ext .ts,.tsx # restrict to specific suffixesrepowise risk main..HEAD -x 'tests/' -x '*.spec.ts' # omit tests from scoring```-See [`docs/CHANGE_RISK.md`](./CHANGE_RISK.md) for the scoring model.+See [`docs/layers/CHANGE_RISK.md`](../layers/CHANGE_RISK.md) for the scoring model.---@@ -447,7 +447,7 @@ repowise impacted-tests main..HEAD --format list | xargs pytest### `repowise health [PATH]`-Compute per-file code-health scores from 25 deterministic markers (McCabe complexity, nesting, brain methods, LCOM4 cohesion, god classes, native clone detection, untested hotspots, coverage gradient, function/ownership/churn/change-entropy organizational risk, test-quality smells, and more). Zero LLM calls by default, pure Python over tree-sitter + git data. See [`docs/CODE_HEALTH.md`](./CODE_HEALTH.md) for the user guide and [`docs/architecture/code-health.md`](./architecture/code-health.md) for the internals.+Compute per-file code-health scores from 25 deterministic markers (McCabe complexity, nesting, brain methods, LCOM4 cohesion, god classes, native clone detection, untested hotspots, coverage gradient, function/ownership/churn/change-entropy organizational risk, test-quality smells, and more). Zero LLM calls by default, pure Python over tree-sitter + git data. See [`docs/layers/CODE_HEALTH.md`](../layers/CODE_HEALTH.md) for the user guide and [`docs/architecture/code-health.md`](../architecture/code-health.md) for the internals.**Options:**@@ -455,7 +455,7 @@ Compute per-file code-health scores from 25 deterministic markers (McCabe comple|------|-------------|| `--file <path>` | Deep-dive a single file (relative path) || `--module <prefix>` | Restrict the report to files whose path starts with this prefix |-| `--refactoring-targets` | Print structured, graph-aware refactoring plans (Extract Class / Helper / Move Method / Break Cycle), ranked `impact × centrality × blast radius`. See [REFACTORING.md](REFACTORING.md) |+| `--refactoring-targets` | Print structured, graph-aware refactoring plans (Extract Class / Helper / Move Method / Break Cycle), ranked `impact × centrality × blast radius`. See [REFACTORING.md](../layers/REFACTORING.md) || `--generate-code <selector>` | Generate an actual refactoring patch for one target. The only `health` flag that calls an LLM; needs a configured provider. || `--trend` | Print the last 10 health snapshots + any active alerts (declining / predicted decline) || `--badge` | Print a shields.io-compatible badge URL/JSON for the repo's health score |@@ -566,7 +566,7 @@ Run a command and print a compact, reversible rendering of its output. Noisesummaries always survive; the command's exit code is preserved. Droppedcontent is stored in `.repowise/omissions/` and referenced by an inline`[repowise#<ref>: ...]` marker. On any filter problem the raw output is-printed unchanged. See [DISTILL.md](DISTILL.md) for the full feature guide.+printed unchanged. See [DISTILL.md](../agent/DISTILL.md) for the full feature guide.```bashrepowise distill pytest -x@@ -626,7 +626,7 @@ repowise saved --missed # what's slipping past the hookMine local agent transcripts for recurring command fumbles, consecutive runsof the same base command where the first failed and a later variant succeeded(wrong tool, wrong path, unknown flag, missing argument). Report-only by-default; entirely local. See [DISTILL.md](DISTILL.md#repowise-corrections--recurring-command-fumbles).+default; entirely local. See [DISTILL.md](../agent/DISTILL.md#repowise-corrections--recurring-command-fumbles).| Flag | Description ||------|-------------|@@ -775,7 +775,7 @@ repowise workspace metricsrepowise workspace metrics --json```-See [Workspaces](WORKSPACES.md) for the full multi-repo guide.+See [Workspaces](../scale/WORKSPACES.md) for the full multi-repo guide.---@@ -808,7 +808,7 @@ repowise hook uninstallrepowise hook uninstall --workspace```-See [Auto-Sync](AUTO_SYNC.md) for all sync methods (hooks, file watcher, webhooks, polling).+See [Auto-Sync](../scale/AUTO_SYNC.md) for all sync methods (hooks, file watcher, webhooks, polling).### `repowise hook rewrite install|uninstall|status`@@ -832,7 +832,7 @@ every workspace repo with `--workspace`/`-w` (accepts an optional `PATH` andglobal hook entries plus the repo's AGENTS.md awareness section and leavesper-repo config untouched. Per-repo posture (`permission: ask | allow`,per-family overrides) lives under `distill.commands` in-`.repowise/config.yaml`, see [DISTILL.md](DISTILL.md#configuration).+`.repowise/config.yaml`, see [DISTILL.md](../agent/DISTILL.md#configuration).When `~/.codex` exists, `install` also writes a Codex hook entry to`~/.codex/hooks.json` (Codex ≥ 0.137 only, older builds can't apply a@@ -840,7 +840,7 @@ rewrite) and maintains an "Output Distillation" section in the repo's`AGENTS.md` that works without any hook. Codex cannot show a rewrittencommand for approval, so there rewrites fire only for families set to`permission: allow`; `status` reports exactly what your build supports. See-[DISTILL.md](DISTILL.md#3-the-command-rewrite-hook-claude-code--codex).+[DISTILL.md](../agent/DISTILL.md#3-the-command-rewrite-hook-claude-code--codex).---@@ -870,7 +870,7 @@ repowise mcp --tools leanrepowise mcp --all```-See [MCP Tools](MCP_TOOLS.md) for all exposed tools.+See [MCP Tools](../agent/MCP_TOOLS.md) for all exposed tools.---@@ -982,7 +982,7 @@ repowise whats-new --all # full history`repowise update` shows a short "what's new" panel automatically after youupgrade to a newer version, and both `update` and `serve` print a one-line,non-blocking notice when a newer release is available on PyPI. See-[docs/UPGRADING.md](UPGRADING.md) for the full upgrade flow.+[docs/reference/UPGRADING.md](UPGRADING.md) for the full upgrade flow.---diff --git a/docs/COMPUTED_GLOSSARY.md b/docs/reference/COMPUTED_GLOSSARY.mdsimilarity index 99%rename from docs/COMPUTED_GLOSSARY.mdrename to docs/reference/COMPUTED_GLOSSARY.mdindex 5522a9afa..5aab88504 100644--- a/docs/COMPUTED_GLOSSARY.md+++ b/docs/reference/COMPUTED_GLOSSARY.md@@ -360,7 +360,7 @@ workspace overlays, MCP responses, and CLI output.| `repowise workspace` | Workspace repo discovery, config entries, update status, cross-repo hook output. | `Found 2 new repo(s)` || `repowise generate-claude-md` | Editor-file data and rendered `.claude/CLAUDE.md`. | `hotspots`, `key_modules`, `decisions` in markdown || `repowise augment` | Hook-time graph/search enrichment for AI tool calls. | Related files, symbols, importers, dependencies |-| `repowise distill` / `expand` / `saved` | Compact errors-first command output with reversible omission markers, marker restoration, and the savings ledger rollup ([DISTILL.md](DISTILL.md)). | `[repowise#a1b2c3d4e5f6: 230 lines omitted (~6.1k tokens); ...]` |+| `repowise distill` / `expand` / `saved` | Compact errors-first command output with reversible omission markers, marker restoration, and the savings ledger rollup ([DISTILL.md](../agent/DISTILL.md)). | `[repowise#a1b2c3d4e5f6: 230 lines omitted (~6.1k tokens); ...]` || `repowise mcp` | FastMCP server exposing the computed graph/wiki/risk tools below. | stdio, streamable HTTP, or SSE transport |## MCP And API-Visible Computed Payloadsdiff --git a/docs/CONFIG.md b/docs/reference/CONFIG.mdsimilarity index 97%rename from docs/CONFIG.mdrename to docs/reference/CONFIG.mdindex f7fa66dde..97ae99455 100644--- a/docs/CONFIG.md+++ b/docs/reference/CONFIG.md@@ -97,7 +97,7 @@ an API call.`wiki_style` controls the voice and density of generated wiki pages. Set it with`init --wiki-style` or switch later with `repowise restyle <style>` (which alsoregenerates the wiki). Power users can define their own style under-`.repowise/styles/<name>/style.yaml`. Full guide: [WIKI_STYLES.md](WIKI_STYLES.md).+`.repowise/styles/<name>/style.yaml`. Full guide: [WIKI_STYLES.md](../layers/WIKI_STYLES.md).Note: hand-editing `wiki_style` here and running `update` does not regenerateexisting pages, use `restyle`.@@ -120,7 +120,7 @@ to `config.yaml`. `--include-submodules` is recorded in `state.json` instead### The `distill:` block-Controls [output distillation](DISTILL.md) for this repo. Everything defaults+Controls [output distillation](../agent/DISTILL.md) for this repo. Everything defaultssensibly when the block is absent; `repowise doctor` validates it.```yaml@@ -172,7 +172,7 @@ mcp:workspace mode).- Workspace-only tools (`get_blast_radius`, `get_architecture`) are addedautomatically in workspace mode and ignored if named in single-repo mode. See- [MCP_TOOLS.md](MCP_TOOLS.md#configuring-the-tool-surface).+ [MCP_TOOLS.md](../agent/MCP_TOOLS.md#configuring-the-tool-surface).### The `decisions:` block@@ -244,7 +244,7 @@ refactoring:only narrow further from this floor, not below it.- Per-path disables reuse the `.repowise/health-rules.json` glob mechanism (thesame one markers use).-- Full reference: [REFACTORING.md](REFACTORING.md).+- Full reference: [REFACTORING.md](../layers/REFACTORING.md).---@@ -287,7 +287,7 @@ Valid severity labels are `low`, `medium`, `high`, `critical`. Only theseverity **label** is overridable this way, never the underlying numericweights or caps that produce the health score.-Full reference: [CODE_HEALTH.md](CODE_HEALTH.md#configuration).+Full reference: [CODE_HEALTH.md](../layers/CODE_HEALTH.md#configuration).---@@ -380,7 +380,6 @@ repowise init --provider ollama --model llama3.2### LiteLLM (100+ providers)```bash-pip install "repowise[litellm]"export LITELLM_API_KEY="..."repowise init --provider litellm --model azure/gpt-4```@@ -576,7 +575,7 @@ honored. The schema is managed with Alembic migrations.## Workspace config (`.repowise-workspace.yaml`)-A multi-repo [workspace](WORKSPACES.md) is configured by a `.repowise-workspace.yaml` at the workspace root. Alongside the repo list it carries two optional blocks.+A multi-repo [workspace](../scale/WORKSPACES.md) is configured by a `.repowise-workspace.yaml` at the workspace root. Alongside the repo list it carries two optional blocks.### `repos[].tags`@@ -594,7 +593,7 @@ repos:### The `conformance:` block-Declares architecture conformance rules (allow/deny dependency rules) checked by `repowise workspace check` and the workspace Conformance view. See [Architecture Conformance](WORKSPACES.md#architecture-conformance).+Declares architecture conformance rules (allow/deny dependency rules) checked by `repowise workspace check` and the workspace Conformance view. See [Architecture Conformance](../scale/WORKSPACES.md#architecture-conformance).```yamlconformance:diff --git a/docs/TELEMETRY.md b/docs/reference/TELEMETRY.mdsimilarity index 100%rename from docs/TELEMETRY.mdrename to docs/reference/TELEMETRY.mddiff --git a/docs/UPGRADING.md b/docs/reference/UPGRADING.mdsimilarity index 100%rename from docs/UPGRADING.mdrename to docs/reference/UPGRADING.mddiff --git a/docs/AUTO_SYNC.md b/docs/scale/AUTO_SYNC.mdsimilarity index 100%rename from docs/AUTO_SYNC.mdrename to docs/scale/AUTO_SYNC.mddiff --git a/docs/WORKSPACES.md b/docs/scale/WORKSPACES.mdsimilarity index 100%rename from docs/WORKSPACES.mdrename to docs/scale/WORKSPACES.mddiff --git a/docs/WORKTREES.md b/docs/scale/WORKTREES.mdsimilarity index 100%rename from docs/WORKTREES.mdrename to docs/scale/WORKTREES.mddiff --git a/docs/start/DASHBOARD.md b/docs/start/DASHBOARD.mdnew file mode 100644index 000000000..91d0b550e--- /dev/null+++ b/docs/start/DASHBOARD.md@@ -0,0 +1,323 @@+# The dashboard++`repowise serve` starts a local web app on `http://localhost:7777` that reads+the same `.repowise/wiki.db` the CLI and MCP server read. Nothing leaves your+machine, and no view calls an LLM unless you click something that says it will+(Chat, refactoring code generation, doc regeneration).++```bash+repowise serve # http://localhost:7777+repowise serve --port 8080+```++The URL shape is `/repos/<repo-id>/<view>`. Every view is directly linkable,+including tab state, so a link you paste in a PR lands on exactly what you were+looking at.++## Two modes, and what changes between them++Repowise can index a repo without generating a wiki (`repowise init+--index-only`, or the fast option in the setup wizard). Everything derived from+the AST, the dependency graph, and git history works in both modes. The views+that read generated pages are the difference:++| Needs a generated wiki | Works index-only |+|---|---|+| Docs, Doc freshness, Present mode, Chat, semantic Search | Overview, Architecture, Knowledge Graph, Code Health, Refactoring, Files, Symbols, Commits, Contributors, Decisions, Stats, Usage, Settings, all Workspace views |++In index-only mode the docs-related counters honestly read `0` rather than+hiding, and the Docs view offers to run a generation job. You can upgrade an+index-only repo to a full one later without re-indexing from scratch.++## Overview++`/repos/<id>/overview`++**Answers:** what is this repo, and what should I look at first?++The landing view. Repo KPIs (files, symbols, entry points, dead exports, health+averages), an attention panel that promotes whatever currently deserves it+(declining health, a stale doc set, an alert-band file), a decisions timeline,+quick actions, and a live banner while an index or generation job is running.+If a job is in flight, the progress and log stream here.++## Docs++`/repos/<id>/docs`++**Answers:** how does this system work, in prose someone can read?++<img src="../../.github/assets/dashboard/docs.png" alt="Repowise docs reader: page tree on the left, generated wiki page with confidence and freshness badges in the center" width="100%" />++The generated wiki: a page tree on the left, the rendered page in the middle+with mermaid diagrams, code blocks that link into the file views, a confidence+badge, a freshness indicator, backlinks, and a regenerate action for a single+page. A command palette (`⌘K` / `Ctrl+K`) jumps between pages. Reader personas+re-filter prose for the audience you pick. You can attach human notes to a page,+and those notes survive regeneration.++The sidebar auto-collapses to icons here so the page gets the width, and+restores when you leave.++### Present mode (the hidden one)++Inside the docs header there is a **Present** button. It turns the wiki you+already generated into a full-screen, keyboard-driven presentation. Nothing is+generated for it: the deck is derived synchronously from the pages already+loaded, so there is no LLM call, no network round trip, and no extra cost. The+button only appears when the repo has a `repo_overview` page.++The state lives in the URL (`?present=deck` or `?present=walkthrough`), so a+particular mode is shareable.++**Deck** is a slide view assembled in a fixed order: a title slide from the+overview page, up to two architecture-diagram slides, up to five layer slides+(prose on the left and the layer's mermaid diagram on the right when it has+one), up to five module slides, a "where to start" slide built from the guided+tour metadata, and a closing slide. Each slide carries a freshness dot and an+"open in reader" link that drops you back into the docs view on that page.++**Walkthrough** is the guided-reading version of the same content: one step per+guided-tour stop, each with a "why this matters" callout, a longer excerpt from+the target page, and a reading-time estimate. A left rail tracks which steps+you have finished and shows the total estimate. If the index has no guided tour,+the walkthrough falls back to the deck's sections rather than showing an empty+pane.++Keys while the overlay is open: `→` / `Space` / `PageDown` next, `←` / `PageUp`+back, `Home` / `End` first and last, `Esc` to close. Deck and Walkthrough each+keep their own position, so toggling between them does not lose your place.++This is the fastest way to hand a repo to a new joiner: open Present, hit+Walkthrough, and let the guided tour do the talking.++### Doc freshness++`/repos/<id>/docs/coverage`++**Answers:** which docs still describe the code, and which have drifted?++A coverage donut, a drift banner when generated pages fall behind the commits+they describe, a per-page freshness table, and a confidence-by-freshness matrix+that separates "we were never sure about this page" from "we were sure and the+code has since moved". Use it to decide what to regenerate rather than+regenerating everything.++## Architecture++`/repos/<id>/architecture`++**Answers:** what talks to what?++<img src="../../.github/assets/dashboard/graph.png" alt="Repowise dependency graph: ELK-laid-out module graph with a context drawer showing a selected node's dependents" width="100%" />++Five views behind `?view=`:++- **map** (default): the layered architecture map.+- **explore**: the dependency-graph canvas with ELK layout, a context drawer+ per node, a centrality leaderboard, and detected communities.+- **deps**: the external dependency registry.+- **symbols**: the symbol index, covered below.+- **coupling**: change coupling, the files that keep changing together without+ an import edge between them. This is the view that catches the coupling+ static analysis cannot see.++Index-only safe: all of it is computed from the parse and git history.++## Knowledge Graph++`/repos/<id>/knowledge-graph`++**Answers:** where does this file or symbol sit in the whole system?++A continuous-zoom canvas over the full graph: repo at the top, then modules,+files, and symbols as you zoom, rendered by a custom camera and culling engine+so it stays smooth on large repos. Deep-link with `?focus=<node>` to land+zoomed on one node. The older `/c4` and `/zoom` URLs redirect here.++## Code Health++`/repos/<id>/code-health`++**Answers:** which files are likely to break next, and why?++<img src="../../.github/assets/dashboard/code-health.png" alt="Repowise code health: health ring, band distribution, KPI cards and the lowest-scoring file list" width="100%" />++Tabs behind `?tab=`:++- **triage** (default): the health ring, the band distribution, the three+ co-equal KPIs (defect risk, maintainability, performance), and the+ lowest-scoring files.+- **findings**: every marker finding, filterable by dimension and severity.+- **hotspots**: churn-versus-complexity and churn-versus-bus-factor scatters,+ with the refactor quadrant tinted.+- **coverage**: ingested test coverage joined against risk, so untested+ hotspots stand out.+- **dead-code**: unreachable files, unused exports, and zombie packages, tiered+ by confidence.+- **impact**: blast radius for a file or a set of changed files.+- **security**: the security findings table, by directory and by severity.++Clicking any file opens the health drawer: its markers, its file signals+(owners, churn, dependents), its score trend as a sparkline, and its **bug+history** section (see [BUG_HISTORY.md](../layers/BUG_HISTORY.md)).++The full scoring model is documented in+[docs/layers/CODE_HEALTH.md](../layers/CODE_HEALTH.md). Note that the per-file+score trend lives on the file's own Health tab and in the drawer rather than as+a separate top-level tab.++## Refactoring++`/repos/<id>/refactoring`++**Answers:** given that this file is in trouble, what exactly do I change?++<img src="../../.github/assets/dashboard/refactoring.gif" alt="Repowise refactoring board: an Extract Class plan expanded into its split groups, evidence, and blast radius" width="100%" />++A board of structured plans (Extract Class, Extract Helper, Move Method, Break+Cycle, Split File), each rendered as a card with its split groups, the evidence+that justifies it, its impact delta, an effort bucket, and the blast radius that+has to move with it. Filter by type with `?type=`. Two actions per card:+**copy-to-agent**, which produces a prompt you can hand to a coding agent, and+**Generate code**, an opt-in LLM expansion into code plus a unified diff.+Everything except that last button is deterministic.++Reference: [docs/layers/REFACTORING.md](../layers/REFACTORING.md).++## Files++`/repos/<id>/files`, `/repos/<id>/files/<path>`++**Answers:** what is in this file, and should I be careful with it?++<img src="../../.github/assets/dashboard/files-page.gif" alt="Repowise files view: treemap sized by lines and colored by health band, drilling into a single file page" width="100%" />++A treemap of the repo sized by code volume and colored by health band, so where+the risk sits is one glance rather than a sorted table. Drill into a file for+its tabs: overview, its generated doc page, health, coverage, graph+neighborhood, and history. `/repos/<id>/modules/<path>` is the same idea one+level up.++## Symbols++`/repos/<id>/architecture?view=symbols`, `/repos/<id>/symbols/<symbolId>`++**Answers:** where is this function defined, who calls it, and how often has it+been broken?++The symbol index with filters for kind, hot files, and a **Bug-fixed** facet+that keeps only symbols with a counted bug fix inside the window. Each row+carries a fix chip when it has one. The symbol detail page and drawer show the+signature, the call graph around it, modification count, and a **Bug fixes**+tile next to it, which is the contrast worth reading: how often it changes+against how often it breaks.++## Search++`/repos/<id>/search`++Full-text, symbol, and semantic search over the index, scoped to one repo or+the whole workspace. Semantic results need generated pages; symbol and+full-text search work index-only. `⌘K` opens the same thing as a palette from+anywhere.++## Commits++`/repos/<id>/commits`++**Answers:** what has been happening in this repo, and how risky was it?++<img src="../../.github/assets/dashboard/commits-page.gif" alt="Repowise commits view: commit table with risk scores, a risk distribution histogram and the code-evolution chart" width="100%" />++The commit table with a per-commit risk score, a risk distribution, a+code-evolution chart, commit-category breakdowns, and AI-agent provenance+badges plus their trend over time where the commits carry agent trailers. The+risk model is documented in+[docs/layers/CHANGE_RISK.md](../layers/CHANGE_RISK.md).++## Contributors++`/repos/<id>/owners`, `/repos/<id>/owners/<owner>`++**Answers:** who knows this code?++A contributor directory with ownership distribution, bus-factor views, and a+per-person profile showing what they own and where their knowledge is+concentrated. Useful before a reorg, and before assuming a file has an owner.++## Decisions++`/repos/<id>/decisions`, `/repos/<id>/decisions/<id>`++**Answers:** why is this code shaped this way?++Architectural decisions with their evidence drawer, supersession lineage, and a+decision graph. Decisions are mined from history and PR discussion and can be+confirmed, edited, or added by hand. This is the view that keeps a "we already+tried that" answer from being lost.++## Chat++`/repos/<id>/chat`++Ask questions against the indexed repo. Answers cite the pages and files they+came from, an artifacts panel collects code the answer produced, and you can+pick the model. This is the one view that always costs LLM tokens, and it needs+generated pages to retrieve over.++## Stats++`/repos/<id>/stats`++Repo trivia that is more useful than it sounds: activity trend, a commit punch+card, size class against comparable repos, and superlatives (largest file,+most-changed file, oldest untouched file).++## Usage & savings++`/repos/<id>/costs`++**Answers:** what has indexing cost, and what has it saved?++Daily LLM spend, a cost heatmap, provider comparison, and the savings attributed+to `repowise distill` compressing command output before it reaches an agent's+context window.++## Settings++`/repos/<id>/settings` for the repo (exclusions, generation options, sync),+`/settings` globally (server connection, LLM provider and keys, webhook, MCP+server config and tool toggles, display preferences).++## Workspace views++These appear only when repowise is running over a multi-repo workspace. See+[docs/scale/WORKSPACES.md](../scale/WORKSPACES.md) for setup.++- `/workspace`: repo cards across the workspace with per-repo status.+- `/workspace/system-map`: the cross-repo dependency picture, including a+ design-structure matrix and package dependencies.+- `/workspace/conformance`: where repos diverge from the shared patterns.+- `/workspace/contracts`: API contracts extracted on the producer side matched+ against their consumers, so a breaking change is visible before it ships.+- `/workspace/co-changes`: files in different repos that keep changing in the+ same window.++## Keyboard++| Key | Does |+|---|---|+| `⌘K` / `Ctrl+K` | Command palette (jump to a page, file, or symbol) |+| `→` `Space` `PageDown` | Present mode: next slide or step |+| `←` `PageUp` | Present mode: previous |+| `Home` `End` | Present mode: first / last |+| `Esc` | Close Present mode or the open drawer |++## See also++- [QUICKSTART.md](QUICKSTART.md): getting to a first index.+- [USER_GUIDE.md](USER_GUIDE.md): the CLI-side workflow.+- [docs/agent/MCP_TOOLS.md](../agent/MCP_TOOLS.md): the same data, for agents.+- [docs/reference/CLI_REFERENCE.md](../reference/CLI_REFERENCE.md): every+ command, including `serve` flags.diff --git a/docs/start/QUICKSTART.md b/docs/start/QUICKSTART.mdnew file mode 100644index 000000000..451e488a5--- /dev/null+++ b/docs/start/QUICKSTART.md@@ -0,0 +1,266 @@+# Quickstart++Index your repo and get your agent answering questions from it. The first three+steps need no API key and no configuration.++> Already indexed and looking for a specific command? See the+> [CLI Reference](../reference/CLI_REFERENCE.md). For everything else, the+> [User Guide](USER_GUIDE.md).++---++## 1. Install++```bash+pip install repowise+```++That is the whole install. Every LLM provider SDK (Anthropic, OpenAI, Gemini,+LiteLLM) ships in the base package, so there is nothing to pick at install time+and no extras to remember. You choose a provider later, at index time, and you+can change it whenever you want.++**Requirements:** Python 3.11+ and Git. On Windows use `python -m pip install repowise`.++Check it landed:++```bash+repowise --version+```++## 2. Index your repo, with no API key++```bash+cd /path/to/your-repo+repowise init --index-only -y+```++This is the step worth doing first, because it costs nothing and answers the+question "is this useful on my codebase". It parses every file to an AST, builds+the dependency graph, reads your git history, scores every file for code health,+and finds dead code. No LLM calls, no key, no network.++When it finishes you have a working index. Try it:++```bash+repowise health # the lowest-scoring files, and why+repowise dead-code # what nothing references any more+repowise risk HEAD~5..HEAD # how risky your recent work looks+```++`repowise health` ends with a self-check against your own git history, something+like *"16 of the 20 lowest-health files had a bug fix in the last 6 months, 3.3x+the 24% baseline"*. That number is computed on your repo, not ours. If it looks+bad, the score is not working for your codebase and you should say so.++## 3. Connect your agent++This is the payoff: your agent reads the index instead of your codebase.++<details open><summary><b>Claude Code</b></summary>++The plugin wires up the MCP server, the hooks and the slash commands together:++```text+/plugin marketplace add repowise-dev/repowise+/plugin install repowise@repowise+```++Or wire just the MCP server:++```bash+claude mcp add repowise -- repowise mcp+```++Or commit a project `.mcp.json` so your whole team gets it:++```json+{ "mcpServers": { "repowise": { "command": "repowise", "args": ["mcp"] } } }+```+</details>++<details><summary><b>Codex CLI</b></summary>++```bash+codex mcp add repowise -- repowise mcp+```++Or add to `~/.codex/config.toml`:++```toml+[mcp_servers.repowise]+command = "repowise"+args = ["mcp"]+```++`repowise init --codex` writes project-local `.codex/config.toml`,+`.codex/hooks.json` and a managed `AGENTS.md`. See+[Codex integration](../agent/CODEX.md).+</details>++<details><summary><b>Cursor, Cline, Windsurf, and other MCP clients</b></summary>++Point the client at `repowise mcp`, run from the repo directory, over stdio:++```bash+repowise mcp --transport stdio+```+</details>++<details><summary><b>VS Code</b></summary>++Install the **Repowise** extension from the Marketplace or Open VSX, then run+**Repowise: Set Up This Repository**. It registers the MCP server with VS Code+too, so the same index serves you and your agent. See [VS Code](../agent/VSCODE.md).+</details>++**Now ask your agent something it would normally grep for:**++> *"Use repowise `get_overview` to summarize this repo."*+>+> *"What's the blast radius if I change `src/auth.py`? Use `get_context` with+> `include: ["callers"]`."*+>+> *"Score my branch with `get_change_risk` for `main..HEAD`."*++You should get a graph-grounded answer immediately, instead of a run of greps and+file reads. That is the whole point.++> **What works without a key:** `get_overview`, `get_context`, `get_symbol`,+> `get_risk`, `get_change_risk`, `get_dead_code` and `get_health` all synthesize+> from the graph, git and health layers. `search_codebase`, `get_answer` and+> `get_why` need the generated wiki, which is step 4.++## 4. Optional: add a provider for the wiki and semantic search++Everything so far was deterministic. A provider adds the generated wiki (a+documentation page per module and file), semantic search, architectural decision+mining, and codebase chat.++```bash+export ANTHROPIC_API_KEY="sk-ant-..." # or OPENAI_API_KEY / GEMINI_API_KEY+repowise init --provider anthropic+```++On Windows PowerShell: `$env:ANTHROPIC_API_KEY = "sk-ant-..."`++`repowise init` on its own is interactive: it asks which provider to use, shows a+cost estimate, and waits for you to confirm before spending anything. How long it+runs and what it costs depend on repo size and the model you pick, both of which+the estimate shows you up front.++Three ways to avoid paying a provider at all:++- **Codex subscription:** `repowise init --provider codex_cli` uses your existing+ Codex CLI login, no API key. Run `codex login` first.+- **Fully local:** point it at Ollama with a local embedding model for zero+ external calls. See [Config](../reference/CONFIG.md).+- **Stay in index-only mode.** The graph, git, health, risk and dead-code layers+ never needed a provider.++## 5. Keep it in sync++An index that drifts is worse than no index, because your agent will not know it+is stale. Every response carries the indexed commit and warns when it diverges+from your live `HEAD`, but the fix is cheap:++```bash+repowise update # incremental, seconds+```++Better, make it automatic:++```bash+repowise hook install # re-index on every commit+repowise watch # or run a file watcher while you work+```++Working with `git worktree`? A new worktree seeds its index from your main+checkout on the first `init` or `update`, so there is no second full index and+nothing to configure. See [Worktrees](../scale/WORKTREES.md).++All the sync options (hooks, watcher, GitHub/GitLab webhooks, polling):+[Auto-Sync](../scale/AUTO_SYNC.md).++---++## See it++```bash+repowise serve+```++Starts the API on `http://localhost:7337` and the web dashboard on+`http://localhost:3000`, alongside the MCP server. If Node.js 20+ is installed+the dashboard starts automatically; the frontend downloads once (~50 MB) and+caches in `~/.repowise/web/`. Use `repowise serve --no-ui` for the API alone, or+run the [Docker image](../../docker/README.md) if you would rather not install Node.++Every view and what it answers: [Dashboard](DASHBOARD.md).++## Spend fewer tokens on command output++```bash+repowise distill pytest -x # errors first, raw output recoverable via `repowise expand`+repowise saved # tokens and dollars saved so far+```++Distill compresses noisy command output before your agent reads it, 60-90% fewer+tokens on noisy commands with no error lines dropped. Opt into the rewrite hook+during `init` (or `repowise hook rewrite install`) to have it applied+automatically, with each rewrite shown to you for approval.+See [Distill](../agent/DISTILL.md).++## More than one repo++If your project spans several repositories, index the parent directory instead:++```bash+cd my-workspace/ # contains backend/, frontend/, shared-libs/+repowise init .+```++repowise finds the git repos, asks which to index, and then runs the analysis that+only makes sense across repos: co-change pairs, API contracts between a producer+and its consumers, and package dependencies. One MCP server serves all of them.++```bash+repowise workspace list # repos and their status+repowise workspace add ../new-svc # add one+repowise update --workspace # update every stale repo+```++Full guide: [Workspaces](../scale/WORKSPACES.md).++---++## If something looks wrong++```bash+repowise doctor # checks install, API keys, index drift, store health+repowise doctor --repair # fixes what it safely can+repowise status # what is indexed, and how stale it is+```++## Environment variables++| Variable | When needed | Description |+|----------|-------------|-------------|+| `ANTHROPIC_API_KEY` | Using Anthropic | Anthropic API key |+| `OPENAI_API_KEY` | Using OpenAI | OpenAI API key |+| `GEMINI_API_KEY` | Using Gemini | Google Gemini API key |+| `REPOWISE_EMBEDDER` | Semantic search | Embedder: `gemini`, `openai`, or `mock` (default) |+| `REPOWISE_DB_URL` | Custom database | SQLite/PostgreSQL connection string (default: `.repowise/wiki.db`) |+| `REPOWISE_API_URL` | Frontend only | Backend URL for the web UI (default: `http://localhost:7337`) |++Full list, plus `.repowise/config.yaml`: [Config](../reference/CONFIG.md).++---++## Where to go next++- **[User Guide](USER_GUIDE.md)** for the everyday workflows+- **[MCP Tools](../agent/MCP_TOOLS.md)** for what each tool answers, with worked examples+- **[Hooks](../agent/HOOKS.md)** to have context arrive without the agent asking for it+- **[Code Health](../layers/CODE_HEALTH.md)** for what the score measures and how it is validated+- **[Dashboard](DASHBOARD.md)** for the web UI, view by viewdiff --git a/docs/start/USER_GUIDE.md b/docs/start/USER_GUIDE.mdnew file mode 100644index 000000000..3297263e2--- /dev/null+++ b/docs/start/USER_GUIDE.md@@ -0,0 +1,450 @@+# User Guide++How repowise fits into a normal working week: what to run, when to run it, and+what to do when something looks wrong.++This guide is deliberately not a flag reference. When you need the exact options+for a command, [CLI Reference](../reference/CLI_REFERENCE.md) has every one of+them, and it is the file that stays in sync with the code.++| If you want | Go to |+|---|---|+| To get running in five minutes | [Quickstart](QUICKSTART.md) |+| Every command and flag | [CLI Reference](../reference/CLI_REFERENCE.md) |+| Every config key and env var | [Config](../reference/CONFIG.md) |+| What each MCP tool answers | [MCP Tools](../agent/MCP_TOOLS.md) |+| The web dashboard, view by view | [Dashboard](DASHBOARD.md) |+| What a metric actually means | [Glossary](../reference/COMPUTED_GLOSSARY.md) |++---++## Table of contents++1. [Installation](#installation)+2. [The mental model](#the-mental-model)+3. [What gets created](#what-gets-created)+4. [The commands you will actually use](#the-commands-you-will-actually-use)+5. [Working with your agent](#working-with-your-agent)+6. [Keeping the index fresh](#keeping-the-index-fresh)+7. [Spending fewer tokens](#spending-fewer-tokens)+8. [The dashboard](#the-dashboard)+9. [Common workflows](#common-workflows)+10. [Troubleshooting](#troubleshooting)++---++## Installation++```bash+pip install repowise+```++That is the complete install. Every LLM provider SDK (Anthropic, OpenAI, Gemini,+and LiteLLM for 100+ others) ships in the base package, so there is no provider+extra to choose. You pick a provider at index time and can change it later.++Two extras exist, and neither is about providers:++```bash+pip install "repowise[postgres]" # PostgreSQL + pgvector instead of SQLite+pip install "repowise[graph-extra]" # optional graph algorithms via graspologic+```++**Requirements:** Python 3.11+ and Git. On Windows, use `python -m pip install repowise`.++For local development against a clone:++```bash+git clone https://github.com/repowise-dev/repowise.git+cd repowise+uv sync --all-packages+uv run repowise --version+```++Step-by-step first run: [Quickstart](QUICKSTART.md).++---++## The mental model++Three things happen, and only the first one is slow:++1. **Index.** `repowise init` parses every file to an AST, builds the dependency+ graph, reads git history, and scores code health. With a provider it also+ generates a wiki page per file and module. This is the one expensive step.+2. **Ask.** Everything after that is a read against the index: your agent through+ [MCP tools](../agent/MCP_TOOLS.md), you through the CLI or the dashboard.+ Nothing re-analyzes anything.+3. **Keep fresh.** `repowise update` catches the index up incrementally, in+ seconds. Automate it once and forget it.++The failure mode to avoid is a stale index, because a confidently wrong answer is+worse than no answer. Every MCP response carries the indexed commit and warns when+it has diverged from your live `HEAD`, but the real fix is step 3.++**Two modes.** `--index-only` gives you the graph, git intelligence, code health,+change risk and dead code, with no LLM, no key and no network. Adding a provider+gives you the generated wiki, semantic search, decision mining and chat on top.+You can start index-only and upgrade later without re-doing the parse.++---++## What gets created++```+your-repo/+├── .repowise/+│ ├── wiki.db # pages, symbols, graph, git data, health scores+│ ├── state.json # sync metadata (last commit, pages, tokens used)+│ ├── config.yaml # provider, model, embedder, excludes+│ ├── .env # saved API keys (gitignored)+│ └── lancedb/ # vector store for semantic search+├── .claude/CLAUDE.md # generated Claude Code context+├── AGENTS.md # generated Codex context, when enabled+└── .codex/ # project-local Codex MCP/hooks config, with --codex+```++`.repowise/` is safe to delete and rebuild, and safe to gitignore. Committing it+is a reasonable choice for a team that wants everyone on the same index without+each person paying to generate it.++---++## The commands you will actually use++Grouped by what you are trying to do. Every flag for every command lives in the+[CLI Reference](../reference/CLI_REFERENCE.md).++**Index and keep it current**++| Command | What it is for |+|---|---|+| `repowise init` | First index. Interactive: asks for a provider, shows a cost estimate, waits for confirmation. `--index-only` skips the LLM entirely. |+| `repowise update` | Incremental catch-up after pulling or committing. Seconds, not minutes. |+| `repowise watch` | File watcher that updates continuously while you work. |+| `repowise hook install` | Post-commit hook so syncing happens without you. |+| `repowise status` | What is indexed, and how far behind it is. |+| `repowise doctor` | Checks install, keys, index drift, store health. `--repair` fixes what it safely can. |++**Ask questions**++| Command | What it is for |+|---|---|+| `repowise search "<q>"` | Search the wiki. `--mode fulltext\|semantic\|symbol`. |+| `repowise health` | Lowest-scoring files and why. `--trend` for direction, `--refactoring-targets` for concrete plans. |+| `repowise risk main..HEAD` | Defect risk for a commit or range, scored 0-10. |+| `repowise dead-code` | What nothing references any more, by confidence tier. |+| `repowise decision list` | Architectural decisions, their evidence and status. |+| `repowise impacted-tests` | Only the tests a diff actually exercises. |++**Serve and connect**++| Command | What it is for |+|---|---|+| `repowise serve` | API, web dashboard and MCP server together. `--no-ui` for the API alone. |+| `repowise mcp` | MCP server on stdio, for editors and agents. |++**Spend fewer tokens**++| Command | What it is for |+|---|---|+| `repowise distill <cmd>` | Run a command, compress its output before the agent reads it. |+| `repowise expand <ref>` | Recover anything distill omitted. |+| `repowise saved` | Tokens and dollars saved so far. |++**More than one repo**++| Command | What it is for |+|---|---|+| `repowise workspace list` | Repos in the workspace and their status. |+| `repowise workspace add <path>` | Add a repo. |+| `repowise update --workspace` | Update every stale repo in one pass. |++**Occasional maintenance**++| Command | What it is for |+|---|---|+| `repowise reindex` | Rebuild the vector store from existing pages (embedding calls only, no LLM). |+| `repowise restyle` | Re-render the wiki in a different [style](../layers/WIKI_STYLES.md). |+| `repowise export` | Export the wiki, for static hosting or archival. |+| `repowise costs` | What indexing has cost you, by provider and operation. |+| `repowise generate-claude-md` | Regenerate `CLAUDE.md` / `AGENTS.md` on demand. |+| `repowise telemetry disable` | Turn off anonymous usage telemetry. |++---++## Working with your agent++This is the main event, and it has its own docs. The short version:++**Connect once.** `repowise mcp`, run from the repo directory, over stdio. For+Claude Code the plugin wires the MCP server, hooks and slash commands together;+for Codex, `repowise init --codex` writes project-local config. Setup per client+is in [Quickstart](QUICKSTART.md#3-connect-your-agent), and+[Codex](../agent/CODEX.md) / [opencode](../agent/OPENCODE.md) have their own guides.++**Ten tools, task-shaped.** Your agent gets architecture summaries, per-file+triage cards with callers and ownership, symbol source with exact bounds, risk+assessment for a set of changed files, decision lookups and health scores, each in+one call rather than a chain. What each one answers, and worked multi-tool+examples: [MCP Tools](../agent/MCP_TOOLS.md).++**Context that arrives unasked.** Hooks push the relevant thing into the session+at the right moment: a briefing at session start, the governing decision when your+agent edits a file that decision covers, a warning on files with a run of recent+bug fixes. They never call an LLM or the network, and they fail silently.+Inventory and exact settings: [Hooks](../agent/HOOKS.md).++**Agents that do not speak MCP** still benefit, because `init` generates+`CLAUDE.md` and `AGENTS.md` from the real index.++---++## Keeping the index fresh++Five ways, in rough order of how little thought they need. Full guide:+[Auto-Sync](../scale/AUTO_SYNC.md).++| Method | Command | Best for |+|--------|---------|----------|+| Post-commit hook | `repowise hook install` | Set-and-forget local dev |+| File watcher | `repowise watch` | Active development sessions |+| GitHub webhook | Server endpoint | Teams, CI/CD |+| GitLab webhook | Server endpoint | Teams, CI/CD |+| Polling fallback | Automatic with `repowise serve` | Safety net |++Both the hook and the watcher take `--workspace` to cover every repo at once.++Working in a `git worktree`? A new worktree seeds its index from your main+checkout on the first `init` or `update`, so there is no second full index and+nothing to configure. See [Worktrees](../scale/WORKTREES.md).++---++## Spending fewer tokens++Most of an agent's context goes to command output it never needed: 300 lines of+passing tests around 4 failures, a full `git log` for "what changed recently".++```bash+repowise distill pytest -x # errors first, exit code preserved+repowise distill git log -50 # subjects and counts instead of full bodies+```++Nothing is lost. Omissions leave a marker that is always recoverable:++```+[repowise#a1b2c3d4e5f6: 230 lines omitted (~6.1k tokens); restore: repowise expand a1b2c3d4e5f6]+```++```bash+repowise expand a1b2c3d4e5f6 # the full original output+repowise expand a1b2c3d4e5f6 -q "FAILED" # just the matching lines+```++**Getting your agent to use it.** `repowise init` adds a section to the managed+`CLAUDE.md` so the agent reaches for it voluntarily, which works in any agent that+runs shell commands. For Claude Code you can also opt into the command-rewrite+hook, which rewrites noisy commands automatically:++```bash+repowise hook rewrite install # or answer Yes at the init prompt+```++It never rewrites pipes, compound commands or watch modes, and defaults to `ask`+so you see every rewrite before it runs.++Track it with `repowise saved`, or the Costs page in the dashboard. Full guide:+[Distill](../agent/DISTILL.md).++---++## The dashboard++```bash+repowise serve+```++API on `http://localhost:7337`, dashboard on `http://localhost:3000`, MCP server+alongside both. With Node.js 20+ the frontend downloads once (~50 MB), caches in+`~/.repowise/web/` and starts automatically. Use `--no-ui` for the API alone, or+the [Docker image](../../docker/README.md) if you would rather not install Node.++`Ctrl+K` / `Cmd+K` opens a command palette from any page, which is the fastest way+to move between views and repos.++Views that need the generated wiki (Docs, Chat, parts of Overview) show thin+content on an index-only repo. Everything else, including Architecture, Code+Health, Files, Commits and Contributors, works off the parsed graph and git+history alone.++Every view and what it answers: **[Dashboard](DASHBOARD.md)**.++---++## Common workflows++### First index, single repo++```bash+pip install repowise+cd /path/to/your-project+repowise init --index-only -y # free, no key, seconds+repowise hook install # keep it current from here on+```++Add the wiki and semantic search when you want them:++```bash+export ANTHROPIC_API_KEY="sk-ant-..."+repowise init --provider anthropic+```++### First index, multi-repo workspace++```bash+cd /path/to/workspace/ # parent dir containing backend/, frontend/, ...+repowise init . # finds the repos, asks which to index+repowise hook install --workspace+```++Cross-repo contracts and co-change come out of this automatically. See+[Workspaces](../scale/WORKSPACES.md).++### Day to day++Pick one and stop thinking about it:++```bash+repowise hook install # A: syncs on every commit, nothing else to do+repowise watch # B: syncs continuously while you code+git pull && repowise update # C: manual, when you prefer control+```++### Before you open a pull request++```bash+repowise risk main..HEAD # how risky does this change look, and why+repowise impacted-tests # the tests this diff actually exercises+repowise health --trend # did anything you touched get worse+```++`repowise risk` in PR mode also tells you what a change is likely to break, which+companion files usually move with the ones you touched, and where tests are+missing.++### Reviewing someone else's pull request++```bash+repowise risk origin/main..their-branch+repowise health --file path/to/the/scariest/file.py+```++Or let the [PR bot](https://github.com/apps/repowise-bot) post it automatically on+every pull request, with no LLM calls.++### Onboarding someone new++Index with a provider so they get the wiki, then hand them either the dashboard or+their editor:++```bash+repowise init --provider anthropic+repowise serve # browsable wiki, graph, health+```++With the MCP server connected, their agent can answer "why is this like this"+instead of them interrupting someone.++### In CI++```bash+repowise init --index-only # free, no keys in CI+repowise risk "$BASE_SHA..$HEAD_SHA" # gate or annotate on risk+repowise export --format markdown --output ./docs/wiki/ # static hosting+```++### Changing provider or model++```bash+repowise init --provider openai --model gpt-5.4-nano --force # regenerate+repowise update --provider gemini # just future updates+```++Or edit `provider` / `model` in `.repowise/config.yaml`. The parse, graph, git and+health layers are provider-independent, so switching only affects generated prose.++### Cutting cost on a large repo++```bash+repowise init --dry-run # see the estimate before spending+repowise init --test-run # generate the top 10 files only+repowise init --skip-tests --skip-infra # narrow the scope+repowise init --provider ollama # or spend nothing at all+```++---++## Troubleshooting++Start with `repowise doctor`, which checks the install, API keys, index drift and+store health, and `repowise doctor --repair` to fix what it safely can.++**"Provider X requires the 'Y' package"**+Every provider SDK ships with `repowise`, so this points at a broken or partial+install rather than a missing extra. The error names the package it wants, so+`pip install <package>` clears it immediately, and+`pip install --force-reinstall repowise` fixes the underlying install.++**Empty results in semantic search mode**+An embedder is probably not configured. Set `REPOWISE_EMBEDDER=gemini` (or+`openai`) and rebuild the vector store with `repowise reindex --embedder gemini`.++**"embedder.mock_active" warning**+The mock embedder produces random vectors, so semantic search cannot work+meaningfully. Set a real embedder as above.++**Pages look stale after code changes**+`repowise update`. To stop it happening, `repowise hook install` or+`repowise watch`.++**The agent is answering from an old version of the code**+Check `repowise status` for drift. MCP responses carry the indexed commit and a+staleness warning, so if your agent is not surfacing that, it is worth asking it+to.++**Indexing cost more than expected**+Use `--dry-run` for the estimate before committing to a run, `--test-run` to+validate on 10 files, and `--skip-tests --skip-infra` to cut scope. Lower+`--concurrency` if you are hitting rate limits.++**init was interrupted**+`repowise init --resume` picks up from the last checkpoint.++**Vector store looks corrupted**+`repowise reindex` rebuilds it from the existing wiki pages, with no LLM calls.++**Doctor reports 0 pages**+Either init failed, or it ran with `--index-only`. Run `repowise init` with a+provider to generate pages.++**Dashboard shows an empty repo list**+The backend and frontend have to point at the same database. Check `REPOWISE_DB_URL`+on the backend and `REPOWISE_API_URL` on the frontend.++**CORS errors in the browser**+`repowise serve` runs the API and the dashboard together, so this should not come+up in normal use; the backend allows all origins by default. If you see it, the+API is probably not up, or you are running a frontend separately from source and+pointing it somewhere else with `REPOWISE_API_URL`.++---++## Where to go next++- **[MCP Tools](../agent/MCP_TOOLS.md)** for what your agent can actually ask+- **[Code Health](../layers/CODE_HEALTH.md)** for what the score measures and how it is validated+- **[Workspaces](../scale/WORKSPACES.md)** for multi-repo intelligence+- **[Config](../reference/CONFIG.md)** for every setting and environment variable+- **[CLI Reference](../reference/CLI_REFERENCE.md)** for every command and flag+- **[Architecture](../architecture/ARCHITECTURE.md)** for how repowise is builtdiff --git a/packages/cli/src/repowise/cli/commands/coverage_cmd.py b/packages/cli/src/repowise/cli/commands/coverage_cmd.pyindex 9f7aeeab3..7e5710472 100644--- a/packages/cli/src/repowise/cli/commands/coverage_cmd.py+++ b/packages/cli/src/repowise/cli/commands/coverage_cmd.py@@ -315,8 +315,9 @@ def coverage_status(repo: str | None) -> None:if not summary.get("file_count") and not map_summary.get("pair_count"):console.print("[yellow]No coverage ingested.[/yellow] Run "- "[cyan]repowise coverage add[/cyan] for per-file coverage, or "- "[cyan]repowise coverage contexts[/cyan] for the per-test map."+ "[cyan]repowise coverage add <report>[/cyan]. A .coverage file "+ "recorded with [cyan]--contexts=test[/cyan] also builds the "+ "per-test map.")return@@ -341,8 +342,9 @@ def coverage_status(repo: str | None) -> None:)else:console.print(- "[dim]No test-to-code map yet - build one with "- "[cyan]repowise coverage contexts[/cyan].[/dim]"+ "[dim]No test-to-code map yet - record one with "+ "[cyan]coverage run --contexts=test -m pytest[/cyan], then "+ "[cyan]repowise coverage add .coverage[/cyan].[/dim]")run_async(_do())diff --git a/packages/core/README.md b/packages/core/README.mdindex ab320319a..143967322 100644--- a/packages/core/README.md+++ b/packages/core/README.md@@ -256,4 +256,4 @@ uv pip install -e "packages/core[search]"pytest tests/unit/core/```-See [ARCHITECTURE.md](../../docs/ARCHITECTURE.md) for a deep dive into how the ingestion pipeline, generation engine, and three stores fit together.+See [ARCHITECTURE.md](../../docs/architecture/ARCHITECTURE.md) for a deep dive into how the ingestion pipeline, generation engine, and three stores fit together.diff --git a/packages/core/src/repowise/core/analysis/health/grading.py b/packages/core/src/repowise/core/analysis/health/grading.pyindex 8413f8158..13d34bbde 100644--- a/packages/core/src/repowise/core/analysis/health/grading.py+++ b/packages/core/src/repowise/core/analysis/health/grading.py@@ -4,7 +4,7 @@ The 1-10 health score is the single number we surface. On top of it we put ONEcategorical scheme: the 3 defect-backed buckets **Healthy / Warning / Alert**.Their cutoffs are not arbitrary - on our calibration corpus Alert files carryroughly 17x the per-file defect rate of Healthy files, so the boundaries are-empirically defensible (see ``docs/CODE_HEALTH.md``).+empirically defensible (see ``docs/layers/CODE_HEALTH.md``).This module is the SINGLE SOURCE OF TRUTH for the cutoffs. The TypeScriptmirror lives in ``packages/types/src/health.ts`` (``ALERT_MAX`` / ``HEALTHY_MIN``diff --git a/packages/core/src/repowise/core/generation/editor_files/tool_table.py b/packages/core/src/repowise/core/generation/editor_files/tool_table.pyindex b623efb3c..ef9a1e140 100644--- a/packages/core/src/repowise/core/generation/editor_files/tool_table.py+++ b/packages/core/src/repowise/core/generation/editor_files/tool_table.py@@ -8,7 +8,7 @@ prose in the template and silently drifted from the live registry.Row style: one entry per tool, 1-3 sentences, leading with when to call it.The load-bearing response fields (symbol_bodies, verified, continuation,directive, search_method) stay named — they are what the trust protocol keys-on. Reference detail lives in docs/MCP_TOOLS.md, not here.+on. Reference detail lives in docs/agent/MCP_TOOLS.md, not here."""from __future__ import annotationsdiff --git a/packages/core/src/repowise/core/persistence/stores/README.md b/packages/core/src/repowise/core/persistence/stores/README.mdindex 8fd996a5e..8b10f5a05 100644--- a/packages/core/src/repowise/core/persistence/stores/README.md+++ b/packages/core/src/repowise/core/persistence/stores/README.md@@ -13,7 +13,7 @@ possible without forking.Concrete backends for the three storage seams. Nothing here is requiredreading for a user of repowise — the seams are documented at-[`docs/architecture/pluggable-storage.md`](../../../../../../docs/architecture/pluggable-storage.md).+[`docs/architecture/pluggable-storage.md`](../../../../../../../docs/architecture/pluggable-storage.md).## Public APIdiff --git a/packages/core/src/repowise/core/upgrade/_data/CHANGELOG.md b/packages/core/src/repowise/core/upgrade/_data/CHANGELOG.mdindex f6af6de3e..b6e7f748d 100644--- a/packages/core/src/repowise/core/upgrade/_data/CHANGELOG.md+++ b/packages/core/src/repowise/core/upgrade/_data/CHANGELOG.md@@ -95,7 +95,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0### Added- **First-class output-language support.** `repowise init --language <code>` (15 languages: en, ru, es, fr, de, zh, ja, ko, it, pt, nl, pl, tr, ar, hi) sets the natural language for generated wiki pages; advanced interactive mode now asks for it too (English default). The choice persists to `.repowise/config.yaml` so `update` regenerates changed pages in the same language, and the workspace init, workspace generate, and server regenerate paths now honor it instead of silently defaulting to English. Code, file paths, and symbol names stay untranslated. Previously this was config-file-only (#99). (#756)-- **Worktrees just work.** `repowise init` and `repowise update` inside a linked git worktree now auto-detect the base checkout and seed the worktree's index from it, then catch up incrementally; no flags needed. `--seed-from <base>` remains as an explicit override and `--no-seed` forces a cold init. See [WORKTREES.md](WORKTREES.md). (#655 introduced the manual flag; #747 makes it automatic.)+- **Worktrees just work.** `repowise init` and `repowise update` inside a linked git worktree now auto-detect the base checkout and seed the worktree's index from it, then catch up incrementally; no flags needed. `--seed-from <base>` remains as an explicit override and `--no-seed` forces a cold init. See [WORKTREES.md](scale/WORKTREES.md). (#655 introduced the manual flag; #747 makes it automatic.)- **Ruby and Scala promoted to Full health tier.** Both languages now get the full complexity node map and performance-risk dialect, so health scores and perf findings match the depth Python/TypeScript/Go already had. (#745, #749)- **Git stats awards.** The contributor stats view gained biggest-commit, longest-streak, most-imported-file, and dependency awards. (#752)- **Workspace socket-contract detection.** Cross-repo analysis now detects socket-based service contracts alongside HTTP ones. (#710)@@ -719,7 +719,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0- **Pluggable storage seams + capability registries.** New async `IndexStore` / `GraphStore` / `JobStore` interfaces with SQL/in-process default implementations, and process-wide `cli_registry` / `mcp_tool_registry` / `pipeline_hooks` registries so downstream packages can extend the CLI, MCP tool list, and pipeline phases without monkey-patching internals. Behavior is unchanged for OSS users — same CLI commands, same MCP tools, same default storage (#219).### Changed-- **Code-health scoring recalibrated.** The organizational category cap is lifted from −1.0 to −3.5 so the strongest empirical predictors (`developer_congestion`, `untested_hotspot`, `hidden_coupling`) are no longer suppressed, and a per-biomarker weight multiplier was added (`developer_congestion` ×1.5, `untested_hotspot` ×1.3, `function_hotspot` ×1.2). `knowledge_loss` is de-rated to ×0.4 per OSS calibration (legacy code that works gets handed off) — enterprise users can raise it back via per-repo overrides. See the updated category-cap table in `docs/CODE_HEALTH.md` (#221).+- **Code-health scoring recalibrated.** The organizational category cap is lifted from −1.0 to −3.5 so the strongest empirical predictors (`developer_congestion`, `untested_hotspot`, `hidden_coupling`) are no longer suppressed, and a per-biomarker weight multiplier was added (`developer_congestion` ×1.5, `untested_hotspot` ×1.3, `function_hotspot` ×1.2). `knowledge_loss` is de-rated to ×0.4 per OSS calibration (legacy code that works gets handed off) — enterprise users can raise it back via per-repo overrides. See the updated category-cap table in `docs/layers/CODE_HEALTH.md` (#221).- **Health web UI surfaces the new biomarkers.** Glossary entries and biomarker-specific detail views for all four new biomarkers (partner-file chip for `hidden_coupling`, operator count for `complex_conditional`, mod/p80 ratio for `function_hotspot`, median age + recent edits for `code_age_volatility`), recalibrated category caps in the score breakdown (now sorted by applied deduction), and a clickable `function:line` deep-link in the file drawer. The new biomarker details also flow into the AI refactor prompt (#223).- **Doc generation scales to very large repos.** Batch embedding (one model call per generation level instead of N upserts), pipeline checkpoint/resume over the new JobStore seam, and graph metrics computed in SQL. Default behavior is unchanged when the new knobs aren't set (#220).@@ -734,7 +734,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0## [0.10.0] — 2026-05-18### Added-- **Code health layer — a fifth intelligence layer alongside graph / git / docs / decisions.** New `repowise health` command, `health_*` SQLite tables, biomarker engine, and `/repos/[id]/health` web UI surface what hotspots actually *cost* to maintain. Tree-sitter complexity walker feeds 10+ biomarkers across structural (`large_method`, `nested_complexity`, `bumpy_road`, `complex_method`, `brain_method`, `primitive_obsession`), organizational (`developer_congestion`, `knowledge_loss`), test (`untested_hotspot`, `coverage_gap`), and DRY (`dry_violation`, backed by a tokenizer + Rabin-Karp clone detector with co-change correlation) categories. A composite 0–10 score is rolled up per file, per module (NLOC-weighted), and per repo. Findings persist with deterministic refactoring suggestions and an `acknowledged | resolved | false_positive` lifecycle. `HealthSnapshot` writer + trend detector surface declining-health alerts. `.repowise/health-rules.json` supports per-file overrides. `repowise update` runs an incremental upsert so the dashboard stays fresh without re-running the full pipeline. New `repowise health --trend`, `--refactoring-targets`, `--module`, `--file`, and `--coverage` flags; `repowise status` prints a one-line health digest. Parallel biomarker analysis via `asyncio.gather`. Full architecture deep-dive in `docs/CODE_HEALTH.md` (#212).+- **Code health layer — a fifth intelligence layer alongside graph / git / docs / decisions.** New `repowise health` command, `health_*` SQLite tables, biomarker engine, and `/repos/[id]/health` web UI surface what hotspots actually *cost* to maintain. Tree-sitter complexity walker feeds 10+ biomarkers across structural (`large_method`, `nested_complexity`, `bumpy_road`, `complex_method`, `brain_method`, `primitive_obsession`), organizational (`developer_congestion`, `knowledge_loss`), test (`untested_hotspot`, `coverage_gap`), and DRY (`dry_violation`, backed by a tokenizer + Rabin-Karp clone detector with co-change correlation) categories. A composite 0–10 score is rolled up per file, per module (NLOC-weighted), and per repo. Findings persist with deterministic refactoring suggestions and an `acknowledged | resolved | false_positive` lifecycle. `HealthSnapshot` writer + trend detector surface declining-health alerts. `.repowise/health-rules.json` supports per-file overrides. `repowise update` runs an incremental upsert so the dashboard stays fresh without re-running the full pipeline. New `repowise health --trend`, `--refactoring-targets`, `--module`, `--file`, and `--coverage` flags; `repowise status` prints a one-line health digest. Parallel biomarker analysis via `asyncio.gather`. Full architecture deep-dive in `docs/layers/CODE_HEALTH.md` (#212).- **Coverage ingestion (LCOV / Cobertura / Clover).** `repowise health --coverage report.lcov` parses one or more reports (format auto-detected, override with `--coverage-format`), persists per-file line + branch + covered-line sets to a new `coverage_files` table, and feeds two coverage-aware biomarkers — `untested_hotspot` (hotspot files with low coverage *or*, when no coverage is ingested, no paired test file) and `coverage_gap` (significant uncovered surface area on non-test files). New `/api/repos/{id}/health/coverage` endpoint + `/repos/[id]/health/coverage` page with risk × coverage scatter, module rollup, and per-file drilldown (#212).- **Code-health web UX overhaul — tabbed chrome, trend, scatter quadrants, file drawer.** `/health` is now a four-tab surface (Overview / Trend / Coverage / Refactoring) with shared `HealthPageChrome`, sparklines pulled from `/health/trend`, a 5th "Hotspot Health" KPI card, server-side paginated file table with sortable headers + filter chips (Hotspots / Untested / Failing) + path search, biomarker glossary tooltips, severity-distribution bars, slide-over `HealthFileDrawer` with score breakdown by category, impact × effort quadrant on the refactoring page, and one-click status mutation (Acknowledge / Resolved / False positive) wired to a new `PATCH /health/findings/{id}` endpoint. Inline `HealthBadge` chips appear on the hotspots / ownership / graph views so health context follows you across the app (#212).- **AI fix / test prompts on the refactoring and coverage pages.** Per-row `AI fix prompt` / `AI test prompt` buttons open a modal that picks a target agent (Generic / Claude Code / Cursor), previews the generated prompt (with biomarkers, line ranges, severities, score deductions, suggested directions, hard constraints, completion contract — and the explicit "verify each finding against the real code; treat analyzer output as leads, not ground truth" preamble), and copies to clipboard. Prompt builder is generic (`buildAiPrompt` / `buildCoverageAiPrompt`) so future surfaces can reuse it (#212).@@ -831,7 +831,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0## [0.8.0] — 2026-05-11### Added-- **Workspace mode is now first-class across the CLI.** Every relevant command auto-detects whether it's running inside a workspace root and routes accordingly, with a one-line `[workspace] …` notice when it does. New flags `--no-workspace` (force single-repo) and `--repo <alias>` (scope to one repo) on `update`, `status`, `watch`, `doctor`, `costs`, `search`, `dead-code`, `decision`, `generate-claude-md`, `hook install/status/uninstall`. `costs` and `search` also gained `--all` for explicit workspace-wide fan-out. New `Workspace auto-detect` section in [CLI Reference](CLI_REFERENCE.md) (#173).+- **Workspace mode is now first-class across the CLI.** Every relevant command auto-detects whether it's running inside a workspace root and routes accordingly, with a one-line `[workspace] …` notice when it does. New flags `--no-workspace` (force single-repo) and `--repo <alias>` (scope to one repo) on `update`, `status`, `watch`, `doctor`, `costs`, `search`, `dead-code`, `decision`, `generate-claude-md`, `hook install/status/uninstall`. `costs` and `search` also gained `--all` for explicit workspace-wide fan-out. New `Workspace auto-detect` section in [CLI Reference](reference/CLI_REFERENCE.md) (#173).- **`repowise update --workspace` now first-time-indexes previously-skipped repos.** Workspace entries without `.repowise/` no longer short-circuit with `"not_indexed"` — the full index pipeline runs (no LLM cost), `state.json` is written with a `docs_skip_reason` marker, and subsequent `update --repo <alias> --docs` cleanly picks up doc generation (#173).- **`repowise workspace add` defaults to full index + LLM doc generation** when a provider is configured. Inherits provider, model, embedder, and exclude patterns from the primary repo's `.repowise/config.yaml`. `--no-docs` / `--no-index` opt out. Cost-gate prompt still runs before any tokens are spent (#173).- **`repowise doctor --workspace`** validates every workspace entry: directory exists, has `.git/`, state.json ↔ workspace config drift, MCP registration. `--repair` syncs drifted entries from disk and drops dead entries whose directory no longer exists (#173).@@ -991,7 +991,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0- **Workspace dashboard** — contract summary now renders when contracts exist but no cross-repo links have been detected, instead of showing an empty state (#111).### Documentation-- **Computed glossary** — `docs/COMPUTED_GLOSSARY.md` documents every derived metric, score, and signal Repowise computes (PageRank, hotspot score, freshness, confidence tiers, etc.) so the surface vocabulary is discoverable in one place (#127).+- **Computed glossary** — `docs/reference/COMPUTED_GLOSSARY.md` documents every derived metric, score, and signal Repowise computes (PageRank, hotspot score, freshness, confidence tiers, etc.) so the surface vocabulary is discoverable in one place (#127).- **README + UI/UX audit fixes** — confirmation dialogs, mobile responsiveness, accessibility, and empty/error/loading states across the dashboard (#117).### Dependencies@@ -1080,7 +1080,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0- **Swift `extension_declaration` heritage** — extension conformance declarations now contribute heritage relations (`extension_declaration` was missing from Swift's `heritage_node_types`).### Changed-- **Language tier promotion** — C# moves from "Good" to "Full" in `README.md` and `docs/LANGUAGE_SUPPORT.md`. Eight languages now sit at Full tier (was: seven).+- **Language tier promotion** — C# moves from "Good" to "Full" in `README.md` and `docs/layers/LANGUAGE_SUPPORT.md`. Eight languages now sit at Full tier (was: seven).- **Heritage / bindings / dead-code internals refactored into per-language subpackages** — `extractors/heritage.py` and `extractors/bindings.py` (previously 600+ LOC monoliths) and `analysis/dead_code.py` are now subpackages with one file per language plus a re-export shim. Public API (`extract_heritage`, `extract_import_bindings`, `DeadCodeAnalyzer`, etc.) is unchanged.### Testsdiff --git a/packages/ui/src/commits/credibility-strip.tsx b/packages/ui/src/commits/credibility-strip.tsxindex a197bc329..17fd8bd72 100644--- a/packages/ui/src/commits/credibility-strip.tsx+++ b/packages/ui/src/commits/credibility-strip.tsx@@ -9,7 +9,7 @@ import {/*** Honest credibility note for the change-risk model. The numbers are the- * backtested leave-one-repo-out result from `docs/CHANGE_RISK.md` — we show+ * backtested leave-one-repo-out result from `docs/layers/CHANGE_RISK.md` — we show* them rather than imply the score is infallible. The model edges churn-only* on average and is stronger on some repos; it is a ranking aid, not a verdict.*/diff --git a/packages/ui/src/costs/distill-savings-card.tsx b/packages/ui/src/costs/distill-savings-card.tsxindex 4c47f0d01..2de64db72 100644--- a/packages/ui/src/costs/distill-savings-card.tsx+++ b/packages/ui/src/costs/distill-savings-card.tsx@@ -51,7 +51,7 @@ export interface DistillSavingsCardProps {data?: DistillSavingsData;}-const DISTILL_DOCS = "https://github.com/repowise-dev/repowise/blob/main/docs/DISTILL.md";+const DISTILL_DOCS = "https://github.com/repowise-dev/repowise/blob/main/docs/agent/DISTILL.md";/** Humanize the resolved pricing agent for the "priced at" caption. */function agentLabel(agent: string | undefined): string {diff --git a/plugins/claude-code/README.md b/plugins/claude-code/README.mdindex 7941d46c6..06ccb3bb9 100644--- a/plugins/claude-code/README.md+++ b/plugins/claude-code/README.md@@ -37,7 +37,7 @@ MCP tools and skills activate automatically.### Five intelligence layers-Graph (tree-sitter dependency graph, 15 languages) · Git (hotspots, ownership,+Graph (tree-sitter dependency graph, 16 languages) · Git (hotspots, ownership,co-change, bus factor) · Docs (LLM-generated wiki + semantic search) · Decisions(architectural rationale mined from eight sources) · Code Health (1–10defect-validated score from deterministic markers).diff --git a/plugins/claude-code/commands/init.md b/plugins/claude-code/commands/init.mdindex 5bf5f7a3e..7170eeece 100644--- a/plugins/claude-code/commands/init.md+++ b/plugins/claude-code/commands/init.md@@ -14,8 +14,7 @@ Run: `repowise --version`If the command fails or is not found, ask the user:"Repowise isn't installed yet. I can install it for you. Which do you prefer?"-- `pip install repowise` (recommended)-- `pip install "repowise[all]"` (includes all LLM provider dependencies)+- `pip install repowise` (recommended, includes every LLM provider SDK)- "I'll install it myself"If they want you to install it, run `pip install repowise`. If that fails, try `python -m pip install repowise`.@@ -127,11 +126,10 @@ Then ask them to set the required environment variable. Show the exact export coexport ANTHROPIC_API_KEY="sk-ant-..."```-Also check if the provider's Python package is installed. If using anthropic and it's not installed:-```-pip install "repowise[anthropic]"-```-Similarly for openai (`repowise[openai]`) and gemini (`repowise[gemini]`).+Every provider SDK (anthropic, openai, google-genai, litellm) ships with `repowise`+itself, so there is no per-provider package to install. If a provider import fails,+the install is broken rather than incomplete: reinstall with+`pip install --force-reinstall repowise` and run `repowise doctor`.## Step 5: Exclusionsdiff --git a/pyproject.toml b/pyproject.tomlindex 6a6540f09..d2d18155a 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -122,7 +122,7 @@ repowise-rewrite = "repowise.cli.rewrite_hook:main"Homepage = "https://github.com/repowise-dev/repowise"Repository = "https://github.com/repowise-dev/repowise"Issues = "https://github.com/repowise-dev/repowise/issues"-Documentation = "https://github.com/repowise-dev/repowise/blob/main/docs/USER_GUIDE.md"+Documentation = "https://github.com/repowise-dev/repowise/blob/main/docs/start/USER_GUIDE.md"# ---------------------------------------------------------------------------# setuptools — auto-discover packages across three src/ rootsdiff --git a/scripts/gen_readme_hero.py b/scripts/gen_readme_hero.pynew file mode 100644index 000000000..48dfca58b--- /dev/null+++ b/scripts/gen_readme_hero.py@@ -0,0 +1,294 @@+"""Generate the README composite hero SVG, in both themes.++ python scripts/gen_readme_hero.py light -> .github/assets/one-index.svg+ python scripts/gen_readme_hero.py dark -> .github/assets/one-index-dark.svg++Colours come from the resolved tokens in docs/design/theme-tokens.md; keep the two+in sync when those change. The README picks a variant with <picture> ++prefers-color-scheme.++Companion recipe for the dashboard GIFs under .github/assets/dashboard/ (ffmpeg+only, no extra dependency). README media is kept under ~2MB per asset because the+repo has no git-lfs, so every byte is permanent clone weight:++ ffmpeg -i in.gif -vf "fps=11,scale=1100:-1:flags=lanczos,split[a][b]; [a]palettegen=max_colors=112[p];[b][p]paletteuse=dither=bayer:bayer_scale=3" -loop 0 out.gif+"""+import math, random++import os+import sys+THEME = sys.argv[1] if len(sys.argv) > 1 else "light"++if THEME == "light":+ # paper theme, resolved tokens from docs/design/theme-tokens.md+ BG_ROOT, SURFACE, INSET = "#FBF6F1", "#FFFFFF", "#F4EAE1"+ BORDER, BORDER_S = "rgba(88,67,108,.12)", "rgba(88,67,108,.18)"+ T_PRI, T_SEC, T_TER = "#241B2C", "#5E5360", "#8C7F88"+ ACCENT, FILL, PLUM = "#A16215", "#F59520", "#58436C"+ SUCCESS, WARNING, ERROR = "#1D8155", "#9A6614", "#B23A2E"+ HEAT_MID1, HEAT_MID2 = "#6B9A3D", "#C4762A"+ HAIR_XF, HAIR_F, HAIR_M, HAIR_S = ("rgba(88,67,108,.05)", "rgba(88,67,108,.15)",+ "rgba(88,67,108,.20)", "rgba(88,67,108,.30)")+ DOCLINE = "rgba(88,67,108,.26)"+ TRUST_BG, TRUST_BD = "rgba(29,129,85,.09)", "rgba(29,129,85,.22)"+ SAVE_BG, SAVE_BD = "rgba(245,149,32,.10)", "rgba(245,149,32,.28)"+ PILL_BG = "rgba(29,129,85,.12)"+ COMM = ["#C0641A","#58436C","#B23A2E","#6B7A3D","#B06A86","#4A5D7A",+ "#A8821F","#8A7A66","#7A2F4A","#B85A38","#2F6B66","#5E5360"]+ COMM_SOFT = ["#F7A94D","#826AA0","#CF6A55","#90A05E","#CF93AB","#71849F",+ "#C9A544","#A89882","#9E5570","#EBA585","#558F89","#84778A"]+else:+ # plum-tinted charcoal, same token table+ BG_ROOT, SURFACE, INSET = "#17131D", "#211B29", "#110D17"+ BORDER, BORDER_S = "rgba(213,197,232,.10)", "rgba(213,197,232,.18)"+ T_PRI, T_SEC, T_TER = "#EEEAF4", "#A79DB3", "#786F84"+ ACCENT, FILL, PLUM = "#F59520", "#F59520", "#A98FC4"+ SUCCESS, WARNING, ERROR = "#34D399", "#F2A03D", "#E06A5A"+ HEAT_MID1, HEAT_MID2 = "#8FCB6B", "#EE8A50"+ HAIR_XF, HAIR_F, HAIR_M, HAIR_S = ("rgba(213,197,232,.05)", "rgba(213,197,232,.15)",+ "rgba(213,197,232,.20)", "rgba(213,197,232,.30)")+ DOCLINE = "rgba(213,197,232,.24)"+ TRUST_BG, TRUST_BD = "rgba(52,211,153,.10)", "rgba(52,211,153,.26)"+ SAVE_BG, SAVE_BD = "rgba(245,149,32,.12)", "rgba(245,149,32,.32)"+ PILL_BG = "rgba(52,211,153,.14)"+ COMM = ["#F59520","#A98FC4","#E06A5A","#A9BB6F","#D795B1","#8FA3C0",+ "#D9B04A","#B8A68E","#C4708F","#EBA585","#6FB3AB","#A79DB3"]+ COMM_SOFT = ["#C97A1A","#7D659C","#B04C3E","#7E8F4E","#A86A87","#66799A",+ "#A8821F","#8A7A66","#94506A","#C4734F","#4A8780","#786F84"]++W, H = 1600, 812+PAD, GAP = 36, 18+R = 14 # card radius++out = []+def add(s): out.append(s)++def esc(s):+ return s.replace("&","&").replace("<","<").replace(">",">")++def card(x, y, w, h, label, kicker):+ add(f'<rect x="{x}" y="{y}" width="{w}" height="{h}" rx="{R}" fill="{SURFACE}" stroke="{BORDER}" stroke-width="1"/>')+ add(f'<text x="{x+22}" y="{y+31}" class="lbl">{esc(label)}</text>')+ add(f'<text x="{x+w-22}" y="{y+31}" class="kick" text-anchor="end">{esc(kicker)}</text>')++def outcome(x, y, w, text):+ add(f'<text x="{x+22}" y="{y}" class="out">{esc(text)}</text>')++rng = random.Random(7)++# ============ header ======================================================+add(f'<rect width="{W}" height="{H}" fill="{BG_ROOT}"/>')+add(f'<text x="{PAD}" y="{50}" class="h1">One index. Everything your agent and your team keep asking for.</text>')+add(f'<text x="{PAD}" y="{80}" class="sub">Index once, in seconds, no LLM required. Every answer below is already computed.</text>')++TOP = 104+# ============ A: Code Health (large) ======================================+ax, ay, aw, ah = PAD, TOP, 748, 352+card(ax, ay, aw, ah, "CODE HEALTH", "25 markers · zero LLM · <30s")++# KPI chips+kpis = [("Defect risk", "7.5", "/10", WARNING), ("Maintainability", "8.6", "/10", SUCCESS), ("Perf risks", "268", "", PLUM)]+kx = ax + 22+for name, val, unit, col in kpis:+ add(f'<rect x="{kx}" y="{ay+46}" width="146" height="58" rx="9" fill="{INSET}" stroke="{BORDER}"/>')+ add(f'<text x="{kx+12}" y="{ay+66}" class="chiplbl">{esc(name)}</text>')+ add(f'<text x="{kx+12}" y="{ay+93}" class="chipval" fill="{col}">{val}<tspan class="chipunit">{unit}</tspan></text>')+ kx += 156++# trust banner+add(f'<rect x="{ax+22}" y="{ay+116}" width="{aw-44}" height="34" rx="8" fill="{TRUST_BG}" stroke="{TRUST_BD}"/>')+add(f'<circle cx="{ax+40}" cy="{ay+133}" r="4.5" fill="{SUCCESS}"/>')+add(f'<text x="{ax+54}" y="{ay+138}" class="trust">17 of the 20 lowest-health files were bug-fixed in the last 6 months, <tspan font-weight="700">3.63× the 23% baseline</tspan></text>')++# circle-packed health galaxy+gx, gy, gw, gh = ax + 22, ay + 162, 452, 170+add(f'<rect x="{gx}" y="{gy}" width="{gw}" height="{gh}" rx="9" fill="{INSET}"/>')+add(f'<clipPath id="galaxy"><rect x="{gx}" y="{gy}" width="{gw}" height="{gh}" rx="9"/></clipPath>')+add(f'<g clip-path="url(#galaxy)">')+# cluster centers+centers = [(gx+92, gy+80, 62), (gx+218, gy+62, 50), (gx+318, gy+104, 44),+ (gx+392, gy+52, 32), (gx+150, gy+140, 30)]+HEAT = [SUCCESS, HEAT_MID1, WARNING, HEAT_MID2, ERROR]+placed = []+for ci, (cx, cy, cr) in enumerate(centers):+ add(f'<circle cx="{cx}" cy="{cy}" r="{cr}" fill="{HAIR_XF}"/>')+ n = int(cr * 1.5)+ for _ in range(n):+ for _try in range(40):+ a = rng.uniform(0, math.tau); d = cr * math.sqrt(rng.uniform(0, 1)) * 0.92+ px, py = cx + math.cos(a) * d, cy + math.sin(a) * d+ r = rng.choice([2.2, 2.6, 3.1, 3.6, 4.4, 5.4])+ if all((px-qx)**2 + (py-qy)**2 > (r+qr+1.3)**2 for qx, qy, qr in placed):+ placed.append((px, py, r)); break+ else:+ continue+ # heat skews unhealthy toward cluster cores+ t = d / cr+ idx = min(4, max(0, int((1 - t) * 4.2 + rng.uniform(-1.1, 1.1))))+ op = 0.55 + 0.45 * (1 - t)+ add(f'<circle cx="{px:.1f}" cy="{py:.1f}" r="{r}" fill="{HEAT[idx]}" opacity="{op:.2f}"/>')+add('</g>')+add(f'<text x="{gx+12}" y="{gy+gh-12}" class="cap">2,802 files scored</text>')++# findings list+fx = ax + 490+findings = [("CHANGE ENTROPY", "−3.0", ERROR), ("NESTED COMPLEXITY", "−2.4", ERROR),+ ("CHURN RISK", "−1.8", WARNING), ("CO-CHANGE SCATTER", "−1.5", WARNING),+ ("UNTESTED HOTSPOT", "−1.2", WARNING)]+add(f'<text x="{fx}" y="{gy+14}" class="cap">OPEN FINDINGS</text>')+fy = gy + 34+for name, delta, col in findings:+ add(f'<rect x="{fx}" y="{fy}" width="236" height="24" rx="6" fill="{INSET}"/>')+ add(f'<rect x="{fx}" y="{fy}" width="3" height="24" rx="1.5" fill="{col}"/>')+ add(f'<text x="{fx+13}" y="{fy+16}" class="find">{esc(name)}</text>')+ add(f'<text x="{fx+226}" y="{fy+16}" class="find" fill="{col}" text-anchor="end" font-weight="700">{delta}</text>')+ fy += 28++# ============ B: Graph ====================================================+bx, by, bw, bh = ax + aw + GAP, TOP, 380, 352+card(bx, by, bw, bh, "DEPENDENCY GRAPH", "16 languages")+add(f'<rect x="{bx+18}" y="{by+46}" width="{bw-36}" height="240" rx="9" fill="{INSET}"/>')+add(f'<clipPath id="gclip"><rect x="{bx+18}" y="{by+46}" width="{bw-36}" height="240" rx="9"/></clipPath>')+add('<g clip-path="url(#gclip)">')+# force-ish layout: 4 communities+gcent = [(bx+110, by+120), (bx+250, by+108), (bx+180, by+218), (bx+296, by+206)]+nodes = []+for ci, (cx, cy) in enumerate(gcent):+ hub_r = 9+ nodes.append((cx, cy, hub_r, COMM[ci], ci, True))+ for _ in range(9):+ a = rng.uniform(0, math.tau); d = rng.uniform(22, 58)+ nodes.append((cx + math.cos(a)*d, cy + math.sin(a)*d*0.8, rng.uniform(2.6, 4.4), COMM_SOFT[ci], ci, False))+# edges: leaf -> its hub, plus a few cross links+for nx, ny, nr, col, ci, is_hub in nodes:+ if is_hub: continue+ hx, hy = gcent[ci]+ add(f'<line x1="{nx:.1f}" y1="{ny:.1f}" x2="{hx}" y2="{hy}" stroke="{HAIR_F}" stroke-width="1"/>')+for i in range(len(gcent)):+ for j in range(i+1, len(gcent)):+ if rng.random() < 0.75:+ add(f'<line x1="{gcent[i][0]}" y1="{gcent[i][1]}" x2="{gcent[j][0]}" y2="{gcent[j][1]}" stroke="{HAIR_S}" stroke-width="1.6"/>')+for nx, ny, nr, col, ci, is_hub in nodes:+ sw = f' stroke="{SURFACE}" stroke-width="1.5"' if is_hub else ''+ add(f'<circle cx="{nx:.1f}" cy="{ny:.1f}" r="{nr:.1f}" fill="{col}"{sw}/>')+add('</g>')+add(f'<text x="{bx+30}" y="{by+276}" class="cap">28,126 nodes · 11 communities</text>')+outcome(bx, by+bh-42, bw, "Who calls this? What breaks if")+add(f'<text x="{bx+22}" y="{by+bh-22}" class="out">I change it?</text>')++# ============ C: Git ======================================================+cx0, cy0, cw, ch = bx + bw + GAP, TOP, W - PAD - (bx + bw + GAP), 352+card(cx0, cy0, cw, ch, "GIT HISTORY", "1,050 commits")+add(f'<rect x="{cx0+18}" y="{cy0+46}" width="{cw-36}" height="240" rx="9" fill="{INSET}"/>')+# commit-risk histogram+bars = [6, 11, 19, 28, 41, 52, 63, 58, 47, 36, 27, 19, 13, 9, 6, 4]+bw_ = (cw - 36 - 24) / len(bars)+base = cy0 + 46 + 176+for i, v in enumerate(bars):+ hgt = v * 2.3+ col = SUCCESS if i < 6 else (WARNING if i < 11 else ERROR)+ add(f'<rect x="{cx0+30+i*bw_:.1f}" y="{base-hgt:.1f}" width="{bw_-3:.1f}" height="{hgt:.1f}" rx="2.5" fill="{col}" opacity="0.82"/>')+add(f'<line x1="{cx0+30}" y1="{base+1}" x2="{cx0+cw-30}" y2="{base+1}" stroke="{HAIR_M}"/>')+add(f'<text x="{cx0+30}" y="{base+22}" class="cap">low risk</text>')+add(f'<text x="{cx0+cw-30}" y="{base+22}" class="cap" text-anchor="end">high risk</text>')+add(f'<text x="{cx0+30}" y="{cy0+72}" class="cap">CHANGE-RISK DISTRIBUTION</text>')+add(f'<text x="{cx0+30}" y="{cy0+276}" class="cap">hotspots · ownership · co-change · bus factor</text>')+outcome(cx0, cy0+ch-42, cw, "Which of these 40 files is")+add(f'<text x="{cx0+22}" y="{cy0+ch-22}" class="out">actually dangerous?</text>')++# ============ row 2 =======================================================+ROW2 = TOP + 352 + GAP+RH = H - ROW2 - PAD++# D: Docs+dx, dy, dw = PAD, ROW2, 496+card(dx, dy, dw, RH, "GENERATED DOCS", "1,274 pages")+add(f'<rect x="{dx+18}" y="{dy+46}" width="{dw-36}" height="176" rx="9" fill="{INSET}"/>')+lines = [(0.62,1),(0.92,0),(0.86,0),(0.71,0),(0.44,2),(0.88,0),(0.79,0),(0.55,0)]+ly = dy + 66+for frac, kind in lines:+ if kind == 1:+ add(f'<rect x="{dx+34}" y="{ly-4}" width="{(dw-68)*frac:.0f}" height="11" rx="3" fill="{PLUM}" opacity=".85"/>')+ ly += 22+ elif kind == 2:+ add(f'<rect x="{dx+34}" y="{ly-3}" width="{(dw-68)*frac:.0f}" height="9" rx="3" fill="{ACCENT}" opacity=".55"/>')+ ly += 20+ else:+ add(f'<rect x="{dx+34}" y="{ly}" width="{(dw-68)*frac:.0f}" height="6" rx="3" fill="{DOCLINE}"/>')+ ly += 16+add(f'<rect x="{dx+dw-116}" y="{dy+56}" width="86" height="20" rx="10" fill="{PILL_BG}"/>')+add(f'<text x="{dx+dw-73}" y="{dy+70}" class="pill" fill="{SUCCESS}" text-anchor="middle">fresh · v6</text>')+outcome(dx, dy+RH-46, dw, "Why does auth work this way?")+add(f'<text x="{dx+22}" y="{dy+RH-25}" class="outsub">Answered from the wiki, not from 12 file reads.</text>')++# E: Decisions+ex, ey, ew = dx + dw + GAP, ROW2, 496+card(ex, ey, ew, RH, "ARCHITECTURAL DECISIONS", "mined from 8 sources")+add(f'<rect x="{ex+18}" y="{ey+46}" width="{ew-36}" height="176" rx="9" fill="{INSET}"/>')+add(f'<text x="{ex+34}" y="{ey+74}" class="dec">Rebuild the KG skeleton only when the</text>')+add(f'<text x="{ex+34}" y="{ey+94}" class="dec">graph fingerprint changes</text>')+add(f'<rect x="{ex+34}" y="{ey+108}" width="{ew-104}" height="1" fill="{HAIR_F}"/>')+badges = [("Verified quote", SUCCESS), ("supersedes #418", PLUM), ("governs 24 files", ACCENT)]+bxp = ex + 34+for txt, col in badges:+ wpx = 9 + len(txt) * 6.6+ add(f'<rect x="{bxp}" y="{ey+122}" width="{wpx:.0f}" height="21" rx="10.5" fill="{SURFACE}" stroke="{BORDER_S}"/>')+ add(f'<text x="{bxp+wpx/2:.0f}" y="{ey+136}" class="pill" fill="{col}" text-anchor="middle">{esc(txt)}</text>')+ bxp += wpx + 8+add(f'<text x="{ex+34}" y="{ey+186}" class="cap">Delivered back at session start, and the moment</text>')+add(f'<text x="{ex+34}" y="{ey+202}" class="cap">your agent edits a file the decision governs.</text>')+outcome(ex, ey+RH-46, ew, "Don’t re-litigate what we settled.")+add(f'<text x="{ex+22}" y="{ey+RH-25}" class="outsub">Captured nowhere else.</text>')++# F: Agent surface+fx0, fy0 = ex + ew + GAP, ROW2+fw = W - PAD - fx0+card(fx0, fy0, fw, RH, "SERVED TO YOUR AGENT", "10 MCP tools")+tools = ["get_overview", "get_answer", "get_context", "get_symbol", "search_codebase",+ "get_risk", "get_change_risk", "get_why", "get_dead_code", "get_health"]+tx, ty = fx0 + 20, fy0 + 54+for i, t in enumerate(tools):+ wpx = 12 + len(t) * 6.9+ if tx + wpx > fx0 + fw - 20:+ tx = fx0 + 20; ty += 30+ add(f'<rect x="{tx:.0f}" y="{ty}" width="{wpx:.0f}" height="24" rx="6" fill="{INSET}" stroke="{BORDER}"/>')+ add(f'<text x="{tx+wpx/2:.0f}" y="{ty+16}" class="mono" text-anchor="middle">{esc(t)}</text>')+ tx += wpx + 8+# savings strip+sy = fy0 + 176+add(f'<text x="{fx0+20}" y="{fy0+162}" class="cap">Every response carries index age, indexed commit, and a staleness warning.</text>')+add(f'<rect x="{fx0+20}" y="{sy}" width="{fw-40}" height="46" rx="9" fill="{SAVE_BG}" stroke="{SAVE_BD}"/>')+add(f'<text x="{fx0+34}" y="{sy+20}" class="chipval" fill="{ACCENT}" font-size="19">−96%<tspan class="chipunit" fill="{T_SEC}"> context tokens</tspan></text>')+add(f'<text x="{fx0+34}" y="{sy+38}" class="cap">−70% tool calls · −89% file reads · fewer round-trips per answer</text>')+outcome(fx0, fy0+RH-46, fw, "Claude Code, Codex, Cursor, VS Code.")+add(f'<text x="{fx0+22}" y="{fy0+RH-25}" class="outsub">Plus hooks, so it arrives unasked.</text>')++# ============ assemble ====================================================+style = f"""+ text {{ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif; }}+ .h1 {{ font-size: 30px; font-weight: 700; fill: {T_PRI}; letter-spacing: -.4px; }}+ .sub {{ font-size: 15px; fill: {T_SEC}; }}+ .lbl {{ font-size: 11.5px; font-weight: 700; fill: {T_PRI}; letter-spacing: 1.1px; }}+ .kick {{ font-size: 11.5px; fill: {T_TER}; letter-spacing: .3px; }}+ .cap {{ font-size: 11px; fill: {T_TER}; letter-spacing: .3px; }}+ .out {{ font-size: 15.5px; font-weight: 650; fill: {T_PRI}; }}+ .outsub {{ font-size: 12.5px; fill: {T_SEC}; }}+ .chiplbl {{ font-size: 10.5px; fill: {T_SEC}; letter-spacing: .5px; text-transform: uppercase; }}+ .chipval {{ font-size: 24px; font-weight: 700; }}+ .chipunit {{ font-size: 13px; font-weight: 500; fill: {T_TER}; }}+ .trust {{ font-size: 12.5px; fill: {T_PRI}; }}+ .find {{ font-size: 10.5px; fill: {T_SEC}; letter-spacing: .4px; }}+ .dec {{ font-size: 14px; font-weight: 600; fill: {T_PRI}; }}+ .pill {{ font-size: 10.5px; font-weight: 600; }}+ .mono {{ font-size: 11.5px; fill: {T_SEC}; font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; }}+"""+svg = (f'<svg xmlns="http://www.w3.org/2000/svg" width="{W}" height="{H}" viewBox="0 0 {W} {H}" '+ f'role="img" aria-label="repowise: one index producing code health, a dependency graph, git history, generated docs, architectural decisions, and ten MCP tools">'+ f'<style>{style}</style>' + "".join(out) + '</svg>')++suffix = "" if THEME == "light" else "-dark"+path = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))),+ ".github", "assets", f"one-index{suffix}.svg")+with open(path, "w", encoding="utf-8") as f:+ f.write(svg)+print("wrote", path, len(svg), "bytes")diff --git a/tests/unit/generation/test_editor_file_base.py b/tests/unit/generation/test_editor_file_base.pyindex 1563df12c..fde519ce6 100644--- a/tests/unit/generation/test_editor_file_base.py+++ b/tests/unit/generation/test_editor_file_base.py@@ -50,13 +50,13 @@ def test_render_returns_non_empty_string(gen):def test_render_never_references_repowise_repo_paths(gen):- # The generated file lands in USERS' repos — a `docs/CODE_HEALTH.md`-style+ # The generated file lands in USERS' repos — a `docs/layers/CODE_HEALTH.md`-style# reference points at a file that only exists in the repowise repo itself.import dataclassesdata = dataclasses.replace(_minimal_data(), code_health=_health_block(6.4))result = gen.render(data)- for repo_relative in ("docs/CODE_HEALTH.md", "docs/MCP_TOOLS.md", "docs/DISTILL.md"):+ for repo_relative in ("docs/layers/CODE_HEALTH.md", "docs/agent/MCP_TOOLS.md", "docs/agent/DISTILL.md"):assert repo_relative not in resultdiff --git a/tests/unit/server/mcp/test_mcp_docs_drift.py b/tests/unit/server/mcp/test_mcp_docs_drift.pyindex 04f931fcc..4dbdd2ef0 100644--- a/tests/unit/server/mcp/test_mcp_docs_drift.py+++ b/tests/unit/server/mcp/test_mcp_docs_drift.py@@ -1,4 +1,4 @@-"""docs/MCP_TOOLS.md must track the live MCP tool registry.+"""docs/agent/MCP_TOOLS.md must track the live MCP tool registry.The doc's tool inventory (headings) and surface counts used to be hand-editedand could silently drift from the registered surface; this pins both, the same@@ -15,7 +15,7 @@ import pytestfrom repowise.core.registry import mcp_tool_registryfrom repowise.server.mcp_server._tool_selection import LEAN_TOOLS-DOC = Path(__file__).parents[4] / "docs" / "MCP_TOOLS.md"+DOC = Path(__file__).parents[4] / "docs" / "agent" / "MCP_TOOLS.md"@pytest.fixture(scope="module")diff --git a/tests/unit/server/mcp/test_tool_docstrings.py b/tests/unit/server/mcp/test_tool_docstrings.pyindex 2f22da799..75032aecb 100644--- a/tests/unit/server/mcp/test_tool_docstrings.py+++ b/tests/unit/server/mcp/test_tool_docstrings.py@@ -3,7 +3,7 @@Every registered MCP tool's docstring ships verbatim inside the tool schemathat agent harnesses load (and may truncate). A docstring past ~400 tokensrisks arriving cut off mid-sentence, and pushes schema-loading cost onto-every session. The reference-manual detail belongs in docs/MCP_TOOLS.md.+every session. The reference-manual detail belongs in docs/agent/MCP_TOOLS.md."""from __future__ import annotations@@ -50,7 +50,7 @@ def test_every_tool_docstring_fits_the_schema_budget():assert not oversized, (f"Tool docstrings over {_MAX_DOCSTRING_CHARS} chars (~400 tokens): "f"{oversized}. Trim the docstring; move reference detail to "- "docs/MCP_TOOLS.md."+ "docs/agent/MCP_TOOLS.md.")diff --git a/website/configuration.md b/website/configuration.mdindex 4090b8035..473cdb07b 100644--- a/website/configuration.md+++ b/website/configuration.md@@ -194,7 +194,6 @@ Any model available in your local Ollama installation can be used.LiteLLM acts as a proxy supporting OpenAI, Azure, Cohere, Mistral, and dozens more.```bash-pip install "repowise[litellm]"export LITELLM_API_KEY="..."repowise init --provider litellm --model azure/gpt-4```