Skip to content

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

feat(docs): Salesforce at the Full tier, in one coherent description (#4447)

Raghav Chamadiya0f7de098cc13
diff --git a/README.md b/README.md
index 07edf65f1..eda869350 100644
--- a/README.md
+++ b/README.md
@@ -135,7 +135,7 @@ the page that answers it.
| You ask | Repowise gives you |
|---|---|
| *How does checkout work in this repo?* | A cited answer built from the call graph and the generated docs, in one call. [Search and answers](docs/layers/WIKI.md) |
-| *What calls this function, and what does it call?* | A call graph across 27 parsed languages, every edge stamped with how it was resolved and how far to trust it, plus traced execution flows from each entry point. [The graph](docs/layers/GRAPH.md) |
+| *What calls this function, and what does it call?* | A call graph across 28 parsed languages, every edge stamped with how it was resolved and how far to trust it, plus traced execution flows from each entry point. [The graph](docs/layers/GRAPH.md) |
| *Can I get docs for this codebase?* | A wiki for every module and file, rendered from the code's structure with no key, or written by a model when you choose. It updates incrementally after each commit. [Docs](docs/layers/WIKI.md) |
| *Which of our docs are wrong?* | Markdown checked against the tree: every reference to a file or symbol the code no longer has, with the line to edit. [Doc drift](docs/layers/DOC_DRIFT.md) |
| *Why is it built this way?* | Decisions mined from ADRs, `# WHY:` comments, commit and PR history and your agent sessions, each tied to the code it governs and flagged when it goes stale. [Decisions](docs/layers/DECISIONS.md) |
@@ -255,7 +255,7 @@ Five layers, one index:
| Layer | What it contributes |
|---|---|
-| **1. Graph** | File and symbol dependencies across 27 AST-parsed languages, confidence-stamped call resolution, communities, centrality, cycles and execution flows |
+| **1. Graph** | File and symbol dependencies across 28 AST-parsed languages, confidence-stamped call resolution, communities, centrality, cycles and execution flows |
| **2. Git history** | Hotspots, ownership, co-change, bus factor and bug-fix history: behavioural signals static analysis cannot see |
| **3. Docs** | A wiki for every module and file, hybrid search, and your own markdown checked against the tree for claims the code no longer supports |
| **4. Decisions** | Architectural rationale from ADRs, inline markers, commits, PRs and agent sessions, each claim traced to evidence |
@@ -514,7 +514,7 @@ repository and the cross-repo graph current.
## Supported languages
-**27 languages parsed to an AST, 41 on a five-rung ladder, framework-aware where an
+**28 languages parsed to an AST, 42 on a five-rung ladder, framework-aware where an
ecosystem handler exists.** Every language ships in the open-source distribution.
<p>
@@ -533,6 +533,7 @@ ecosystem handler exists.** Every language ships in the open-source distribution
<img src="https://img.shields.io/badge/C%23-512BD4?style=flat-square&logo=csharp&logoColor=white" alt="C#" />
<img src="https://img.shields.io/badge/Scala-DC322F?style=flat-square&logo=scala&logoColor=white" alt="Scala" />
<img src="https://img.shields.io/badge/Ruby-CC342D?style=flat-square&logo=ruby&logoColor=white" alt="Ruby" />
+ <img src="https://img.shields.io/badge/Apex-00A1E0?style=flat-square&logo=salesforce&logoColor=white" alt="Apex (Salesforce)" />
</p>
<p>
<strong>Good &nbsp;</strong>
@@ -557,7 +558,7 @@ ecosystem handler exists.** Every language ships in the open-source distribution
| Rung | Languages | What you get |
|---|---|---|
-| **Full** (14) | Python · TypeScript · JavaScript · Svelte · Vue · Astro · Java · Kotlin · Go · Rust · C++ · C# · Scala · Ruby | The whole pipeline: AST symbols, import resolution, a resolved call graph, heritage, docstrings, framework edges and code-health markers |
+| **Full** (15) | Python · TypeScript · JavaScript · Svelte · Vue · Astro · Java · Kotlin · Go · Rust · C++ · C# · Scala · Ruby · Apex (Salesforce) | The whole pipeline: AST symbols, import resolution, a resolved call graph, heritage, docstrings, framework edges and code-health markers |
| **Good** (11) | C · Swift · PHP · Dart · Object Pascal · COBOL · GDScript · VB.NET · Elixir · F# · Objective-C | All of the above except the full health suite, within the language-specific ceilings in the full matrix |
| **Partial** (2) | Luau / Roblox · Razor / Blazor | Luau: AST symbols and `require()` resolution, Rojo and `.luaurc` aware. Razor: component symbols, `@code` and component-tag call edges, C# health markers; no import resolution yet |
| **Lightweight** (6) | Clojure · Haskell · Lean 4 · Erlang · HTML · QML | A real file-to-file import graph, and no symbol-level claims |
diff --git a/ROADMAP.md b/ROADMAP.md
index f3e23d991..c28d22c06 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -34,7 +34,7 @@ Languages land on a five-rung ladder rather than a yes/no list, because "do you
support X" has five different useful answers. Each rung is defined, with what it
buys you, in
[docs/layers/LANGUAGE_SUPPORT.md](docs/layers/LANGUAGE_SUPPORT.md). Today that
-ladder covers **41 languages, 27 of them parsed to a full AST**.
+ladder covers **42 languages, 28 of them parsed to a full AST**.
### New languages
@@ -44,7 +44,6 @@ ladder covers **41 languages, 27 of them parsed to a full AST**.
| **ABAP** | Exploring | The same argument as COBOL, in SAP estates. |
| **RPG / AS400** | Exploring | Named alongside COBOL often enough to track. |
| **Fortran** | Exploring | Scientific and engineering codebases with long lifespans and thin documentation. |
-| **Apex** | Planned | Salesforce estates, where the org is often the least documented system a company runs. Apex is Java-shaped, and Lightning Web Components are already covered as JavaScript and HTML. |
| **Ada** | Exploring | Defense and aerospace, long-lived and thinly documented, and usually in the same estates asking about COBOL. |
| **Template dialects** (Django/Jinja, ERB, Blade, Thymeleaf, Go templates) | Planned | Today they parse cleanly as HTML and yield nothing, because `{% extends "base.html" %}` is plain text to an HTML parser. A stated ceiling, not an oversight. |
diff --git a/docs/BENCHMARKS.md b/docs/BENCHMARKS.md
index cfc677f3d..f7f2966c5 100644
--- a/docs/BENCHMARKS.md
+++ b/docs/BENCHMARKS.md
@@ -82,6 +82,7 @@ indexed from source.
| Rust | fd | dev | rust-analyzer | 231 | 0.899 | 0.619 |
| Rust | ripgrep | dev | rust-analyzer | 4,555 | 0.852 | 0.532 |
| C++ | fmt | dev | scip-clang (clang) | 1,636 | 0.777 | 0.385 |
+| Apex | 7 public Salesforce repositories | dev | census of literal references, 90 hand-graded edges | 40,907 | **90/90** | 0.999 |
**Held out means never tuned on.** Dev repositories are the ones accuracy work
is developed against. Held-out repositories are chosen in advance and never used
@@ -90,7 +91,10 @@ code. Java's held-out repositories read 0.87 to 0.92, within a few points of its
dev repositories.
**How it is scored.** An edge matches when the caller and the callee land on
-the same declaration line the compiler names. Python has no compiler that
+the same declaration line the compiler names. Apex has no public compiler index,
+so its recall is read against a census of literal `new X(` and `X.m(` references
+to classes in other files, and its precision from 30 hand-graded edges on each of
+three repositories. Python has no compiler that
resolves calls, so its reference is jedi, the standard static analyser for
Python. Every cell carries a 95% confidence interval in the published
artifacts.
diff --git a/docs/README.md b/docs/README.md
index 2ec38cf8c..c9da08d11 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -34,7 +34,7 @@ For a map of every layer and how they feed each other, read
| [agent/DISTILL.md](agent/DISTILL.md) | Compress noisy command output before your agent reads it |
| [agent/LENS.md](agent/LENS.md) | Lens in the Claude Code plugin: the spinner, change review, Flow and the `/lens` map shown while Claude works |
| [layers/GRAPH.md](layers/GRAPH.md) | The dependency graph, and how much to trust each edge |
-| [layers/LANGUAGE_SUPPORT.md](layers/LANGUAGE_SUPPORT.md) | What works per language: 27 parsed to a full AST, 41 on the support ladder |
+| [layers/LANGUAGE_SUPPORT.md](layers/LANGUAGE_SUPPORT.md) | What works per language: 28 parsed to a full AST, 42 on the support ladder |
### Find what to fix first
diff --git a/docs/architecture/language-support.md b/docs/architecture/language-support.md
index 77812200c..529c8b050 100644
--- a/docs/architecture/language-support.md
+++ b/docs/architecture/language-support.md
@@ -33,7 +33,7 @@ new language needs one only when it hits the same kind of wall.
- [The edge vocabulary](#the-edge-vocabulary)
- [Multi-language files (the SFC pattern)](#multi-language-files-the-sfc-pattern)
- [Extensions and import resolution](#extensions-and-import-resolution)
-- [Per-language mechanics](#per-language-mechanics) · [Elixir](#elixir) · [F#](#f) · [Objective-C](#objective-c) · [GDScript / Godot](#gdscript--godot) · [VB.NET](#vbnet) · [QML](#qml) · [Flutter widget trees](#flutter-widget-trees)
+- [Per-language mechanics](#per-language-mechanics) · [Elixir](#elixir) · [F#](#f) · [Objective-C](#objective-c) · [GDScript / Godot](#gdscript--godot) · [VB.NET](#vbnet) · [QML](#qml) · [Flutter widget trees](#flutter-widget-trees) · [Salesforce](#salesforce)
- [Known gaps per language](#known-gaps-per-language)
- [Optional language-specific passes](#optional-language-specific-passes)
- [The three code-health dialect registries](#the-three-code-health-dialect-registries) · [test-quality markers per language](#test-quality-markers-per-language)
@@ -723,6 +723,7 @@ dependency surface their syntax supports.
| Full | **C#** | `.cs` | `using`, `global using` and aliases via `.csproj` / `.sln`, MSBuild project graph, `partial` class linking |
| Full | **Scala** | `.scala` | The shared JVM index, with SBT and Mill build parsing as fallback |
| Full | **Ruby** | `.rb` | `require` / `require_relative` with `$LOAD_PATH` probing, Gemfile externals, Rails / Zeitwerk autoloading |
+| Full | **Apex** | `.cls` `.trigger` `.apex` | No imports: names resolve within the file's sfdx project, a declared package dependency or a namespace prefix |
| Good | **C** | `.c` | `#include` via `compile_commands.json` (shares the C++ grammar) |
| Good | **Swift** | `.swift` | SPM `Package.swift` targets, intra-module type references, `@main` entry points |
| Good | **PHP** | `.php` | `use` declarations through PSR-4 from every `composer.json`, same-namespace and fully qualified class references |
@@ -928,15 +929,6 @@ separate node-path forms, so the pair fails), and a bare call to a function name
position for the GDScript 3 declaration forms. Error recovery keeps both to the
enclosing statement.
-### Salesforce Aura
-
-Markup directly inside `aura/<bundle>/` is Aura, and each `key: function` of the
-bundle's Controller, Helper and Renderer JavaScript is a function symbol. Markup
-and JavaScript link to the Apex controller and its methods, to controller and helper
-functions (inherited through `extends`), and to the Aura or LWC bundles that tags,
-events and `$A.createComponent` literals name. Aura names match by exact case, and a
-name with two candidate bundles binds to neither.
-
### VB.NET
VB.NET shares the .NET project graph with C# rather than resolving on file stems.
@@ -953,7 +945,31 @@ XML literals, tuple literals used as expressions, a nested double quote inside a
interpolation hole, an omitted argument in a call that also carries type
arguments, and some multi-line LINQ layouts, each recovered from locally.
-### Apex
+### QML
+
+Module specs resolve against an index built from the `qmldir` manifests in the
+repo, and quoted references resolve relative to the importing file, with a
+directory import linking that directory's `qmldir`. Two refusals: a directory
+carrying no `qmldir` gets no edge rather than fanning out to its `.qml` files,
+and a module name declared by two `qmldir` files gets no edge rather than a
+guessed one.
+
+### Flutter widget trees
+
+A `build()` method returns a widget tree, so a constructor call in its body names
+a child widget. The body is read by **brace balancing** from the signature rather
+than through a fixed window, so a long `build()` keeps its tail. Two rules keep
+the edge honest: the constructed class becomes a target only when its heritage
+makes it a widget, without which any class spelled like a constructor call would
+qualify, and the name must be declared by exactly one file this one imports.
+Dart makes nothing visible across files without an import, so that requirement
+both settles a name two files declare and refuses a class that merely shadows a
+framework widget. A class reached through an `export` barrel is missed, which
+costs an edge rather than inventing one.
+
+### Salesforce
+
+#### Apex
The language pack's `apex` grammar keeps Java's node names, so queries, heritage
and type heads follow Java; inline SOQL/SOSL and DML never produce call sites.
@@ -963,10 +979,19 @@ written case, and CumulusCI `%%%NAMESPACE%%%` tokens are blanked before parsing.
Apex has no imports, so a type name resolves to the top-level class its own
sfdx project declares, compared without case, then to an un-namespaced package
it declares a dependency on; another project is reached only through its
-namespace prefix (`usf3.Foo`), and nothing binds across projects otherwise. Static,
-inner-class, typed, chained, inherited and `super` calls follow Java's tiers,
-and a bare name never reaches another class's method. Ceiling: a call site does
-not record `new`, so a constructor written in lower case is missed.
+namespace prefix (`usf3.Foo`). Static, inner-class, typed, chained, inherited
+and `super` calls follow Java's tiers, and a bare name never reaches another
+class's method. Ceiling: a call site does not record `new`, so a constructor
+written in lower case is missed.
+
+Dead code starts from triggers, tests, entry annotations such as `@AuraEnabled`
+and `@InvocableMethod`, `global` members and platform interfaces such as
+`Schedulable`. A class is live when a live class or any Salesforce metadata,
+Lightning or project file writes its name in any case, strings included, since
+`Type.forName` reaches classes by name. Ceiling: a mention in a comment counts as
+a use, and a class shaped like a Visualforce controller stays live.
+
+#### Lightning Web Components, Aura and Visualforce
LWC, Aura, Visualforce and flows reach Apex classes by the same rules from the
project they sit in, and also reach a class that exactly one other, un-namespaced
@@ -975,31 +1000,28 @@ same org. A name two projects declare binds nothing. Ceiling: two copies outside
every package directory of one project (an mdapi export) tie and bind nothing, as
they do for Apex.
-A `@RestResource` class's `@Http*` methods are HTTP providers at
-`/services/apexrest` plus its `urlMapping`, and are entry points in the graph.
-An `HttpRequest` callout is a consumer when its endpoint and verb are literal
-within one method; `callout:Name` keeps the Named Credential as the base. The
-credential's own endpoint is not read.
+Inside an `lwc/<name>/` bundle, `c/<name>` imports resolve to that bundle's
+main module and `@salesforce/apex/Cls.method` imports to the Apex method.
+Templates link to child components by tag and to their own class's members by
+`{binding}`, `@wire` binds its Apex method, and an exposed bundle is an entry
+point. A bundle two sfdx projects declare goes to the nearer one; a tie gets no edge.
-Salesforce CLI coverage names a class or trigger, never a file, so it maps to
-the one `.cls` or `.trigger` file of that name, ignoring case. A name two files
-share, or no file has, stays unmapped.
+Markup directly inside `aura/<bundle>/` is Aura, and each `key: function` of the
+bundle's Controller, Helper and Renderer JavaScript is a function symbol. Markup
+and JavaScript link to the Apex controller and its methods, to controller and helper
+functions (inherited through `extends`), and to the Aura or LWC bundles that tags,
+events and `$A.createComponent` literals name. Aura names match by exact case, and a
+name with two candidate bundles binds to neither.
-Apex dead code starts from triggers, tests, entry annotations such as
-`@AuraEnabled` and `@InvocableMethod`, `global` members and platform interfaces
-such as `Schedulable`. A class is live when a live class or any Salesforce
-metadata, Lightning or project file writes its name in any case, strings
-included, since `Type.forName` reaches classes by name. Ceiling: a mention in a
-comment counts as a use, and a class shaped like a Visualforce controller stays
-live.
+Visualforce pages and components link the Apex classes their `controller=` and
+`extensions=` name, and each `{!expr}` binds the identifier before its first `.`
+to a public member (property, `getX`, or `setX` for inputs) of the controller,
+then each extension, up the `extends` chain. Custom component tags, included
+pages and Apex `Page.X` references link pages and components; a
+`PageReference('/apex/X')` literal is a `dynamic_uses` edge. Names fold case,
+and a page or component two equally near files declare binds nothing.
-Health scores Apex methods, constructors, triggers and property accessors that
-hold code, and reports SOQL, DML, callouts, `Messaging.sendEmail`,
-`System.enqueueJob` and same-class `@future` calls inside loops. It stays quiet on
-the bulk idioms (a query in the loop header, SOQL for-loops over lists, chunked or
-literal-bound loops) and on calls that run once, such as a lazily filled cache.
-Ceiling: `while` loops, `Database.executeBatch` and `System.schedule` are not
-reported, and untested complexity needs measured coverage or a test the graph sees.
+#### Flows and Lightning metadata
Each flow (`.flow-meta.xml`, or a legacy `.flow` in a `flows/` directory) is
one symbol named by its API name, linked to the Apex invocable actions,
@@ -1010,6 +1032,8 @@ link back to it. Flexipages, quick actions, tabs, email services and Experience
sites mark what they name as live; names in another package's namespace are not
followed.
+#### Objects and fields
+
Object and field metadata files (`.object-meta.xml`, `.field-meta.xml`,
`.object`) become object and field symbols. SOQL and SOSL queries, DML
statements, triggers, literal `Database.query` strings, `.soql` files and lookup
@@ -1018,45 +1042,29 @@ an object is defined in several places (the default package directory first). A
name with no definition in the repository gets no edge; `getDescribe()` schema
tokens and `TYPEOF` branches are not read.
-### Salesforce Visualforce
-
-Pages and components link the Apex classes their `controller=` and
-`extensions=` name, and each `{!expr}` binds the identifier before its first `.`
-to a public member (property, `getX`, or `setX` for inputs) of the controller,
-then each extension, up the `extends` chain. Custom component tags, included
-pages and Apex `Page.X` references link pages and components; a
-`PageReference('/apex/X')` literal is a `dynamic_uses` edge. Names fold case,
-and a page or component two equally near files declare binds nothing.
-
-### QML
-
-Module specs resolve against an index built from the `qmldir` manifests in the
-repo, and quoted references resolve relative to the importing file, with a
-directory import linking that directory's `qmldir`. Two refusals: a directory
-carrying no `qmldir` gets no edge rather than fanning out to its `.qml` files,
-and a module name declared by two `qmldir` files gets no edge rather than a
-guessed one.
-
-### Flutter widget trees
+#### Coverage, health and REST
-A `build()` method returns a widget tree, so a constructor call in its body names
-a child widget. The body is read by **brace balancing** from the signature rather
-than through a fixed window, so a long `build()` keeps its tail. Two rules keep
-the edge honest: the constructed class becomes a target only when its heritage
-makes it a widget, without which any class spelled like a constructor call would
-qualify, and the name must be declared by exactly one file this one imports.
-Dart makes nothing visible across files without an import, so that requirement
-both settles a name two files declare and refuses a class that merely shadows a
-framework widget. A class reached through an `export` barrel is missed, which
-costs an edge rather than inventing one.
+Salesforce CLI coverage names a class or trigger, never a file, so it maps to
+the one `.cls` or `.trigger` file of that name, ignoring case. A name two files
+share, or no file has, stays unmapped.
-### Lightning Web Components
+Health scores Apex methods, constructors, triggers and property accessors that
+hold code, and reports SOQL, DML, callouts, `Messaging.sendEmail`,
+`System.enqueueJob` and same-class `@future` calls inside loops. It stays quiet on
+the bulk idioms (a query in the loop header, SOQL for-loops over lists, chunked or
+literal-bound loops) and on calls that run once, such as a lazily filled cache.
+Four advisory markers (SOQL injection, missing sharing, hardcoded record Ids,
+`SeeAllData=true`) never move a score. Ceiling: `while` loops,
+`Database.executeBatch` and `System.schedule` are not reported, and untested
+complexity needs measured coverage or a test the graph sees. Extract Method
+writes helpers as Apex methods, static when the host method is, and reads inline
+SOQL only for its `:bind` expressions.
-Inside an `lwc/<name>/` bundle, `c/<name>` imports resolve to that bundle's
-main module and `@salesforce/apex/Cls.method` imports to the Apex method.
-Templates link to child components by tag and to their own class's members by
-`{binding}`, `@wire` binds its Apex method, and an exposed bundle is an entry
-point. A bundle two sfdx projects declare goes to the nearer one; a tie gets no edge.
+A `@RestResource` class's `@Http*` methods are HTTP providers at
+`/services/apexrest` plus its `urlMapping`, and are entry points in the graph.
+An `HttpRequest` callout is a consumer when its endpoint and verb are literal
+within one method; `callout:Name` keeps the Named Credential as the base. The
+credential's own endpoint is not read.
### Known gaps per language
@@ -1077,6 +1085,8 @@ point. A bundle two sfdx projects declare goes to the nearer one; a tie gets no
- **C has no performance risk support.** Extract Method reuses the C++
def/use dialect; C carries none of the C++-only nodes, so the same plan
fires for both.
+- **Salesforce references are followed when literal.** Runtime-built names and
+ objects with no metadata file in the repository get no edge.
- **Scala import resolution is partial**, and ScalaTest's infix DSL
(`x shouldBe y`) is not counted as an assertion.
diff --git a/docs/business/COMMERCIAL.md b/docs/business/COMMERCIAL.md
index bad534e08..b0b67d1c8 100644
--- a/docs/business/COMMERCIAL.md
+++ b/docs/business/COMMERCIAL.md
@@ -43,7 +43,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](../layers/INTELLIGENCE_LAYERS.md)**: Graph
- (tree-sitter AST across 27 languages, two-tier dependency graph, call
+ (tree-sitter AST across 28 languages, two-tier dependency graph, call
resolution, heritage extraction, Leiden communities, PageRank / betweenness /
SCC), Git (hotspots, ownership, co-change pairs, bus factor, significant
commits, contributor profiles, module health), Documentation (a wiki page per
@@ -112,12 +112,13 @@ All of the following ship in `pip install repowise` today, free for internal use
## 3. First-class language coverage
-Repowise parses **27 languages to a full AST** and places **41 on a five-rung
+Repowise parses **28 languages to a full AST** and places **42 on a five-rung
ladder**, so "do you support X" gets the rung as its answer rather than a yes or a
no. Both numbers matter and neither is worth quoting alone.
-The 27 are the top three rungs. At **Full tier sit 14** (Python, TypeScript,
-JavaScript, Svelte, Vue, Astro, Java, Kotlin, Go, Rust, C++, **C#**, Scala, and Ruby) with
+The 28 are the top three rungs. At **Full tier sit 15** (Python, TypeScript,
+JavaScript, Svelte, Vue, Astro, Java, Kotlin, Go, Rust, C++, **C#**, Scala, Ruby and
+Salesforce Apex) 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 **11 at Good tier** (C,
diff --git a/docs/layers/CODE_HEALTH.md b/docs/layers/CODE_HEALTH.md
index ffa68ce99..c4d9d959d 100644
--- a/docs/layers/CODE_HEALTH.md
+++ b/docs/layers/CODE_HEALTH.md
@@ -36,11 +36,8 @@ Fix first (3 of 41 eligible items, 12 due; 230 in the inventory, tests, tooling
Code health: 7.42/10 [Good] · Production code: 6.93/10 [Fair] · Hotspot: 6.10/10 [Fair] · Worst: 2.3/10 [At risk] (src/config/loader.py)
```
-Every score on the headline carries its band; Production code leaves test files out and
-shows while tests are in the reading. In `repowise next`, a row's severity is the worst of
-the findings it rests on, held at high. A coverage figure measured at an earlier commit
-than the index says so on its row, and the refresh row appears once that report is 14 days
-older than the latest commit.
+Every headline score carries its band, and Production code leaves test files out. A
+coverage figure measured at an earlier commit than the index says so on its row.
## The three signals
@@ -123,16 +120,16 @@ repowise next --json # the whole stored view
decisions waiting for review, grouped as Now, Worth planning and Improve what Repowise
can see.
- Rows rank by value times confidence over effort; the top due Fix first item leads its
- group. Dismissing or snoozing takes effect at once.
+ group. A row's severity is the worst of its findings, capped at high. Dismissing or
+ snoozing takes effect at once.
- A fresh regression is in Now only when this week's commits added a proven performance
cause (one in the performance queue) or lost measured coverage; the long, complex or nested code a week leaves is one
row to plan.
-- A fragile file asks for tests only when no measured coverage and no test in the graph
- reaches it, else to simplify its lead function. That lead is named only when its
- function is worth breaking up by the same rule Fix first uses; otherwise the row asks to
- review why fixes keep landing and shows no finding. A folder where fixes concentrate names
- its most fixed file's first step, or is left out. Under five commits, history-ranked
- rows are left out.
+- A fragile file asks for tests when no coverage or test reaches it, else to simplify its
+ lead function if Fix first would break it up, else to review why fixes keep landing.
+ A folder where fixes concentrate names its most fixed file's first step, or is left
+ out. A coverage report 14 days older than the latest commit gets a refresh row. Under
+ five commits, history-ranked rows are left out.
## Findings
@@ -181,10 +178,9 @@ Every id with its threshold and weight:
- Every `init`, `update` and `health --recompute` stores a snapshot (the last 50 per
repository); `repowise health --trend` prints the last 10 with declining, predicted
decline and history-drag alerts ([rules](../architecture/code-health.md#8-trends-trendspy)).
-- `analyzer_version` names the scoring a number came from, in `health --format json`,
- `health check --format json`, each `--trend` row and `get_health`'s
- `_meta.health_analysis`. A score that moves while it changes may reflect new scoring,
- not new code; it is `null` (or absent on MCP) for analysis stored before it was recorded.
+- `analyzer_version` (JSON output, `--trend` rows, `get_health`) names the scoring a
+ number came from, so a score that moves with it may reflect new scoring, not new code;
+ it is `null` for analysis stored before it was recorded.
- Coverage reports feed the coverage detectors (`repowise coverage add coverage.lcov`);
with none, only `untested_hotspot` and the reach-tier `untested_complexity` (hidden by
default) run, and no file is treated as uncovered
diff --git a/docs/layers/DECISIONS.md b/docs/layers/DECISIONS.md
index 275134867..c23514b8a 100644
--- a/docs/layers/DECISIONS.md
+++ b/docs/layers/DECISIONS.md
@@ -110,8 +110,7 @@ on every read. `superseded` and `dismissed` are set by a person.
- Staleness score: each record carries `staleness_score` between 0 and 1, the
fraction of its governed files committed to since the decision was recorded.
A record written before its evidence commits landed counts from the commit
- that landed them: the commit itself on the main line, or the one squash that
- names it and changes its files. A file the repository does not track counts
+ (or squash) that landed them. A file the repository does not track counts
as changed. At 0.5 or above a record is stale for `decision list --stale-only`,
the health summary and the `needs_review` currency. A record that names no
file scores 0.0 and is counted separately as unscoped. `repowise decision show` and `get_why` on a
diff --git a/docs/layers/GRAPH.md b/docs/layers/GRAPH.md
index 9ebc6c7f2..89ce7002c 100644
--- a/docs/layers/GRAPH.md
+++ b/docs/layers/GRAPH.md
@@ -10,7 +10,7 @@ an optional upgrade for wiki prose, so the graph is reproducible.
<p>
<img src="https://img.shields.io/badge/17-edge_types-3178C6?style=flat-square&labelColor=0A0A0A" alt="17 edge types" />
<img src="https://img.shields.io/badge/39-resolution_origins-059669?style=flat-square&labelColor=0A0A0A" alt="39 resolution origins" />
- <img src="https://img.shields.io/badge/27-full--AST_languages-F59520?style=flat-square&labelColor=0A0A0A" alt="27 full-AST languages" />
+ <img src="https://img.shields.io/badge/28-full--AST_languages-F59520?style=flat-square&labelColor=0A0A0A" alt="28 full-AST languages" />
<img src="https://img.shields.io/badge/0-LLM_calls-1E293B?style=flat-square&labelColor=0A0A0A" alt="zero LLM calls" />
</p>
@@ -269,9 +269,10 @@ and a 1-10 architecture score; see
- The graph keeps one node per overload set, so on Java and C# a call can land
on the wrong overload. On C#, plan against the compiler figure (0.73 to 0.92),
not the hand-graded 30 of 30.
-- Precision is published for ten of the 27 full-AST languages. Go, TypeScript,
+- Precision is published for eleven of the 28 full-AST languages. Go, TypeScript,
Java, C#, C, C++, Rust and Python have a compiler or analyser answer key;
- Kotlin and Swift have the hand-graded sample only, at 30 rows each.
+ Kotlin and Swift have the hand-graded sample only, at 30 rows each, and Apex
+ 90 hand-graded rows with recall against a census of literal references.
- Read a precision figure together with its recall. Two tools post higher
precision in some compiler cells, each by drawing a much smaller graph.
diff --git a/docs/layers/INTELLIGENCE_LAYERS.md b/docs/layers/INTELLIGENCE_LAYERS.md
index 07f9789dd..ea5165167 100644
--- a/docs/layers/INTELLIGENCE_LAYERS.md
+++ b/docs/layers/INTELLIGENCE_LAYERS.md
@@ -36,7 +36,7 @@ code through graph edges.
| Dead code | Unreachable files, unused exports, unused packages, by confidence tier | [DEAD_CODE.md](DEAD_CODE.md) |
| Inferred test links | Which tests reach a file, without a coverage report | [TEST_INTELLIGENCE.md](TEST_INTELLIGENCE.md) |
| Cross-repo contracts | HTTP, gRPC, topic and OpenAPI contracts matched between repositories, with breaking-change detection | [WORKSPACES.md](../scale/WORKSPACES.md) |
-| Language coverage | What each of the 41 supported languages gets | [LANGUAGE_SUPPORT.md](LANGUAGE_SUPPORT.md) |
+| Language coverage | What each of the 42 supported languages gets | [LANGUAGE_SUPPORT.md](LANGUAGE_SUPPORT.md) |
## 2. Git history: where change and breakage concentrate
diff --git a/docs/layers/LANGUAGE_SUPPORT.md b/docs/layers/LANGUAGE_SUPPORT.md
index 5275dfd9b..faa195dbd 100644
--- a/docs/layers/LANGUAGE_SUPPORT.md
+++ b/docs/layers/LANGUAGE_SUPPORT.md
@@ -1,6 +1,6 @@
# Language Support
-**27 languages parsed to a full AST, 41 on the five-rung support ladder, and
+**28 languages parsed to a full AST, 42 on the five-rung support ladder, and
framework-aware edges where an ecosystem handler exists.** Every language lands
on one rung, and the rung tells you which parts of the pipeline produce real
output for it. Files in any other language still appear in the wiki and are
@@ -12,7 +12,7 @@ resolution and health markers are all static.
<img src="https://img.shields.io/badge/Python-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python" /> <img src="https://img.shields.io/badge/TypeScript-3178C6?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript" /> <img src="https://img.shields.io/badge/JavaScript-F7DF1E?style=flat-square&logo=javascript&logoColor=black" alt="JavaScript" /> <img src="https://img.shields.io/badge/Svelte-FF3E00?style=flat-square&logo=svelte&logoColor=white" alt="Svelte" />
<img src="https://img.shields.io/badge/Vue-42B883?style=flat-square&logo=vuedotjs&logoColor=white" alt="Vue" /> <img src="https://img.shields.io/badge/Astro-BC52EE?style=flat-square&logo=astro&logoColor=white" alt="Astro" /> <img src="https://img.shields.io/badge/Java-ED8B00?style=flat-square&logo=openjdk&logoColor=white" alt="Java" /> <img src="https://img.shields.io/badge/Kotlin-7F52FF?style=flat-square&logo=kotlin&logoColor=white" alt="Kotlin" /> <img src="https://img.shields.io/badge/Go-00ADD8?style=flat-square&logo=go&logoColor=white" alt="Go" />
<img src="https://img.shields.io/badge/Rust-000000?style=flat-square&logo=rust&logoColor=white" alt="Rust" /> <img src="https://img.shields.io/badge/C++-00599C?style=flat-square&logo=cplusplus&logoColor=white" alt="C++" /> <img src="https://img.shields.io/badge/C%23-512BD4?style=flat-square&logo=csharp&logoColor=white" alt="C#" /> <img src="https://img.shields.io/badge/Scala-DC322F?style=flat-square&logo=scala&logoColor=white" alt="Scala" />
- <img src="https://img.shields.io/badge/Ruby-CC342D?style=flat-square&logo=ruby&logoColor=white" alt="Ruby" />
+ <img src="https://img.shields.io/badge/Ruby-CC342D?style=flat-square&logo=ruby&logoColor=white" alt="Ruby" /> <img src="https://img.shields.io/badge/Apex-00A1E0?style=flat-square&logo=salesforce&logoColor=white" alt="Apex (Salesforce)" />
</p>
<p>
<strong>Good tier &nbsp;</strong>
@@ -35,15 +35,15 @@ resolution and health markers are all static.
| Tier | Languages | What you get |
|------|-----------|--------------|
-| **Full** (14) | Python, TypeScript, JavaScript, Svelte, Vue, Astro, Java, Kotlin, Go, Rust, C++, C#, Scala, Ruby | The whole pipeline: AST symbols, import resolution, a resolved call graph, heritage, docstrings, framework edges and code-health markers |
+| **Full** (15) | Python, TypeScript, JavaScript, Svelte, Vue, Astro, Java, Kotlin, Go, Rust, C++, C#, Scala, Ruby, Apex (Salesforce) | The whole pipeline: AST symbols, import resolution, a resolved call graph, heritage, docstrings, framework edges and code-health markers |
| **Good** (11) | C, Swift, PHP, Dart, Object Pascal, COBOL, GDScript, VB.NET, Elixir, F#, Objective-C | Everything above except the full health suite. Dart, Object Pascal and PHP get health markers; C, Swift, COBOL, F# and Objective-C get the complexity-derived ones; the rest get none yet |
| **Partial** (2) | Luau / Roblox, Razor / Blazor | Luau: AST symbols and `require()` resolution (Rojo and `.luaurc` aware), no health markers. Razor: a component symbol per file, call edges from `@code` blocks and component tags, C# health markers, no import edges yet |
| **Lightweight** (6) | Clojure, Haskell, Lean 4, Erlang, HTML, QML | A real file-to-file import graph, no symbol-level claims |
| **Structural** (8) | R, Zig, Julia, Elm, OCaml, Crystal, Nim, D | Git history only: blame, hotspots, co-change. No AST parsing |
-Tree-sitter parsing covers the first three rungs: those are the **27 languages
+Tree-sitter parsing covers the first three rungs: those are the **28 languages
parsed to a full AST**. The bottom two rungs come from git history and import
-extraction, and all five together make the **41** on the ladder.
+extraction, and all five together make the **42** on the ladder.
[SQL / dbt](#sql--dbt) and [shell](#shell) sit outside the ladder, because
neither fits a rung: SQL gets symbols and health markers but no call graph, and
@@ -68,7 +68,8 @@ listed per language and framework in
Every Full and Good language has a dedicated import resolver except Object
Pascal and Objective-C, which resolve through a generic unit-name or header-stem
-match.
+match, and Apex, which has no imports and resolves names case-insensitively
+within each sfdx project's namespace.
Scala, Elixir and F# have dedicated import resolvers with known gaps; see
[Limits](#limits).
@@ -91,16 +92,8 @@ mapsets (`.bms`) are linked from the programs that send or receive their maps.
Health measures each paragraph and section as a function: `IF`, `WHEN` arms,
`PERFORM UNTIL/VARYING` loops and `AND`/`OR` add to its complexity, and data-only
copybooks have no functions to flag.
-Apex (`.cls`, `.trigger`, `.apex`) is parsed for symbols, heritage and calls,
-resolved case-insensitively within each sfdx project's namespace; its dead-code
-findings are review-only. Apex test coverage from the Salesforce CLI is read as a
-coverage report ([formats](TEST_INTELLIGENCE.md#supported-formats)). Health covers Apex
-complexity, class cohesion, and SOQL, DML and callouts inside loops; SOQL injection, missing
-sharing keywords, hardcoded record Ids and `SeeAllData=true` tests are findings that never move the score.
-Salesforce flows (`.flow-meta.xml`) are one symbol each, linked to the Apex
-invocable actions, subflows, screen components and triggering objects they name.
-Salesforce object and field metadata become symbols that Apex SOQL, DML and
-triggers reference.
+Apex dead-code findings are review-only, since the platform also reaches classes
+by name.
## How accurate is the graph per language
@@ -190,11 +183,12 @@ reported as unreachable.
| C# | ASP.NET (attribute and minimal API), EF Core, gRPC-dotnet, host-builder extensions, CommunityToolkit MVVM |
| Go | net/http, gin, echo, chi, gRPC server registration |
| Rust | Axum, Actix |
-| JS / TS / Svelte | Next.js App Router, Hono / Fastify / Koa / Elysia, Remix / SvelteKit / Astro, tRPC, Express / NestJS, Angular, Lightning Web Components |
+| JS / TS / Svelte | Next.js App Router, Hono / Fastify / Koa / Elysia, Remix / SvelteKit / Astro, tRPC, Express / NestJS, Angular |
| C++ | GoogleTest, Catch2, Boost.Test, doctest, Google Benchmark, libFuzzer |
| PHP | Laravel, TYPO3 |
| Dart | Flutter route tables, `runApp()` and widget trees |
| GDScript | Godot scenes, autoloads, signal connections, `class_name` |
+| Apex (Salesforce) | Lightning Web Components, Aura, Visualforce, flows, Lightning pages and quick actions as entry points, object and field metadata, Apex REST resources |
## Beyond code files
@@ -235,11 +229,9 @@ invoked by name.
Lambda handler edges.
- Godot resource files (`.tscn`, `.tres`, `.escn`, `project.godot`,
`plugin.cfg`) carry no symbols but are read for the script paths they name.
-- Salesforce Aura markup (`.cmp`, `.app`, `.evt`, `.intf`, `.design`, `.tokens` in
- an `aura/<bundle>/` folder) carries no symbols but is read for the Apex
- controller, controller functions, child components and events it names.
-- Salesforce Visualforce pages and components (`.page`, `.component`) carry no
- symbols but link their Apex controllers and the members their expressions bind.
+- Salesforce flows and object and field metadata become symbols; Aura and
+ Visualforce markup carries none. All of them link the Apex, components and
+ objects they name.
## Code-health coverage
@@ -263,6 +255,7 @@ This table is why a language is Full and not Good.
| PHP | ✅ | ✅ | ✅ | no | no | ✅ | no |
| C | ✅ | no | no | no | no | ✅ | no |
| F#, Objective-C | ✅ | ✅ | no | no | no | no | no |
+| Apex | ✅ | ✅ | ✅ | no | no | ✅ | ✅ |
| Shell | ✅ | n/a | n/a | n/a | n/a | n/a | n/a |
✅ supported, "no" not available yet, n/a the language cannot carry that metric.
@@ -270,6 +263,8 @@ This table is why a language is Full and not Good.
- Dart, F# and Objective-C report class size, method count and CCN (supporting
detectors like God Class), but do not compute cohesion metrics (LCOM4).
- An unmapped language produces no findings, never guessed ones.
+- Apex also gets four advisory markers: SOQL injection, a class with queries and
+ no sharing keyword, hardcoded record Ids and `SeeAllData=true` tests.
- The two test-quality markers (mock saturation, assertion-free test) are
advisory and never deduct from a score.
@@ -289,6 +284,8 @@ Per-marker detail: [CODE_HEALTH.md](CODE_HEALTH.md).
have known gaps.
- COBOL dynamic `CALL` targets and free-format source produce no edges.
- C has no performance risk support.
+- Salesforce references are followed when the name is literal: runtime-built
+ names and objects with no metadata file in the repository get no edge.
The full list per language, with the mechanics behind each gap, is in
[architecture/language-support.md](../architecture/language-support.md#known-gaps-per-language).
diff --git a/docs/layers/PERFORMANCE.md b/docs/layers/PERFORMANCE.md
index 106da81c0..9e1c7cdb7 100644
--- a/docs/layers/PERFORMANCE.md
+++ b/docs/layers/PERFORMANCE.md
@@ -30,10 +30,9 @@ A few shapes are deliberately quiet:
- A TypeScript or JavaScript `includes` check against a short `const` table of
literals that the file never changes is not flagged, because a table of fixed
size costs the same at any scale.
-- A Python schema statement (`CREATE`, `DROP`, `ALTER`, `TRUNCATE`, `PRAGMA` and
- peers) run in a loop is not an N+1: it runs once per table or setting the code
- names, not once per row. A loop over a split of a string the module spells out
- (`for stmt in SCHEMA.split(";")`) is a fixed loop, like one over a literal tuple.
+- A Python schema statement (`CREATE`, `ALTER`, `PRAGMA` and peers) in a loop, or a
+ loop over a split of a module string (`SCHEMA.split(";")`), runs a fixed number of
+ times and is not an N+1.
- An awaited call on a line that an ESLint `no-await-in-loop` suppression covers
is not reported: the comment states that the sequential await is intended.
@@ -57,7 +56,7 @@ declared type decides: an interface that extends a Spring Data repository, carri
Performance analysis covers Python, TypeScript/JavaScript (including Vue and
Svelte scripts), Java, Go, C# (including Razor), Rust, Kotlin, Scala, Ruby, C++,
-Dart and Pascal. A language without support emits no performance findings.
+Dart, Pascal and Apex. A language without support emits no performance findings.
## From findings to a plan
diff --git a/docs/layers/REFACTORING.md b/docs/layers/REFACTORING.md
index 0312e0b17..397c14372 100644
--- a/docs/layers/REFACTORING.md
+++ b/docs/layers/REFACTORING.md
@@ -258,16 +258,11 @@ Most plans answer a health finding, so per-path marker rules in
code declares them; `<type>` marks a type for you to fill in. It flags an
awaiting span with `needs_async: true` and a receiver-bound helper under
`new_symbol`.
-- A TypeScript span is not offered when a test above or around it narrows a
- value no helper parameter can carry: a property the span reads
- (`if (!tc.result) continue;` before `tc.result.id`), a property compared with
- a literal, or a module-level name (`assert(cursor !== undefined)`). Nor is a
- span holding an `assert` the code after it relies on, or one that assigns a
- name declared outside it without taking or returning it.
- One such stage refuses the whole staged split; the finding records
- `narrowing_lost` or `outer_declaration` in `details.extract_method_stage_refused`.
- A guard or `if` narrowing a parameter gets a note to type it as narrowed, and
- an output declared before the span a note to declare it in the helper.
+- A TypeScript span is not offered when the helper would lose a narrowing the span
+ relies on (`if (!tc.result) continue;` before `tc.result.id`), or would assign an
+ outer name without taking or returning it; the finding records `narrowing_lost` or
+ `outer_declaration` in `details.extract_method_stage_refused`. A narrowed parameter gets a note to type it
+ as narrowed.
- A step Repowise cannot express mechanically is a judgment call with a reason
code: `async_helper_unexpressible`, `receiver_unbound` or
`receiver_copy_written`.
diff --git a/docs/layers/TEST_INTELLIGENCE.md b/docs/layers/TEST_INTELLIGENCE.md
index 7b7ec6a77..6468a04d4 100644
--- a/docs/layers/TEST_INTELLIGENCE.md
+++ b/docs/layers/TEST_INTELLIGENCE.md
@@ -67,11 +67,10 @@ Each inferred answer about a file is one of six states
**LCOV**, **Cobertura**, **Clover** and **JaCoCo** XML, **Go coverprofile**
(`go test -coverprofile`), **Salesforce Apex JSON** (`sf apex run test
---code-coverage --result-format json`, or `test-result-codecoverage.json`),
-**coverage.py `.coverage`** and **normalized JSON** (`repowise-coverage-v1`).
-Three carry a per-test map: LCOV when each record has a non-blank `TN:` test
-name, `.coverage` when recorded with per-test contexts, and the Apex run result
-(`test-result-<run id>.json`), keyed `TestClass.method`.
+--code-coverage --result-format json`), **coverage.py `.coverage`** and **normalized JSON**
+(`repowise-coverage-v1`). Three carry a per-test map: LCOV when each record has
+a non-blank `TN:` test name, `.coverage` when recorded with per-test contexts,
+and the Apex run result (`test-result-<run id>.json`).
- The format is sniffed and found in the usual locations
([rules](../architecture/test-intelligence.md#report-formats-and-discovery)); force