Skip to content

Commit c8a6e27

Browse files
committed
Update webpage
Signed-off-by: Rahul Krishna <rkrsn@ibm.com>
1 parent 6e85841 commit c8a6e27

6 files changed

Lines changed: 81 additions & 101 deletions

File tree

astro.config.mjs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default defineConfig({
2424
"codeanalyzer-python turns a Python project into one typed artifact — symbol table, call graph, and framework entrypoints — using Jedi, CodeQL, and Tree-sitter. The Python backend behind CLDK.",
2525
logo: {
2626
src: "./src/assets/logo.png",
27-
replacesTitle: false,
27+
replacesTitle: true,
2828
},
2929
favicon: "/favicon.png",
3030
customCss: ["./src/styles/docs.css"],
@@ -97,11 +97,6 @@ export default defineConfig({
9797
{ label: "CLI usage", slug: "guides/cli-usage" },
9898
{ label: "Core concepts", slug: "guides/concepts" },
9999
{ label: "CodeQL analysis", slug: "guides/codeql" },
100-
{
101-
label: "Entrypoint detection",
102-
slug: "guides/entrypoints",
103-
badge: { text: "new", variant: "tip" },
104-
},
105100
],
106101
},
107102
{
@@ -114,11 +109,9 @@ export default defineConfig({
114109
{
115110
label: "Extending",
116111
items: [
117-
{
118-
label: "Analysis passes",
119-
slug: "extending/analysis-passes",
120-
badge: { text: "★", variant: "tip" },
121-
},
112+
{ label: "Overview", slug: "extending/overview" },
113+
{ label: "Entrypoint detection", slug: "guides/entrypoints" },
114+
{ label: "Analysis passes", slug: "extending/analysis-passes" },
122115
],
123116
},
124117
],
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: Extending codeanalyzer-python
3+
description: codeanalyzer-python is built to be taught new frameworks and dispatch mechanisms without forking it. Entrypoint finders and analysis passes are the two extension points — both areas where contributions are welcome.
4+
---
5+
6+
import { Badge, CardGrid, LinkCard, Aside } from "@astrojs/starlight/components";
7+
8+
<p>
9+
<Badge text="Work in progress" variant="caution" />{" "}
10+
<Badge text="Help wanted" variant="note" />
11+
</p>
12+
13+
After the symbol table and base call graph are built, codeanalyzer runs a pipeline of **analysis passes** — whole-application steps that contribute framework-dispatched **entrypoints** and **synthetic call edges** the static graph can't observe. Out-of-tree packages register their own through the `codeanalyzer.analysis_passes` entry-point group, so you can teach codeanalyzer a new framework or a new dispatch mechanism **without forking it**.
14+
15+
This is the youngest part of codeanalyzer-python: the **mechanism** exists, but **no concrete framework finder ships yet**. `BUILTIN_PASS_FACTORIES` is empty, so until a finder is written, `PyApplication.entrypoints` comes back empty. The frameworks named on this page (Flask, FastAPI, Celery, Click, gRPC, …) are the **roadmap** — the shapes finders will target — not detection that runs today. Writing the first finder for a framework is itself the contribution.
16+
17+
## The two extension points
18+
19+
<CardGrid>
20+
<LinkCard
21+
title="Entrypoint detection"
22+
description="Surface framework-dispatched roots — Flask, FastAPI, Celery, Click, gRPC — as PyEntrypoint records, JackEE-style. Write an AbstractEntrypointFinder to cover a new framework."
23+
href="/codeanalyzer-python/guides/entrypoints/"
24+
/>
25+
<LinkCard
26+
title="Analysis passes"
27+
description="The AnalysisPass contract: emit entrypoints and synthetic call edges, registered via entry points. The general extension mechanism behind entrypoint finding."
28+
href="/codeanalyzer-python/extending/analysis-passes/"
29+
/>
30+
</CardGrid>
31+
32+
## What's WIP, and where help is needed
33+
34+
<Aside type="caution" title="What exists vs. what's planned">
35+
**Built today:** the analysis-pass pipeline, the `AbstractEntrypointFinder` base class (a JackEE-style port of the Java analyzer's entrypoint architecture), pass discovery and topological ordering, and out-of-tree registration via the `codeanalyzer.analysis_passes` entry-point group. The extension API is the part you can rely on.
36+
37+
**Not built yet:** any concrete finder. No framework — Flask, FastAPI, Celery, Click, gRPC, Django, or otherwise — is detected out of the box. Synthetic-edge passes are likewise scaffolding-only. Everything framework-specific is roadmap.
38+
</Aside>
39+
40+
<Aside type="tip" title="Help wanted">
41+
The first concrete finder is the contribution. Good starting points: an `AbstractEntrypointFinder` for a framework you use, a synthetic-edge pass for an ORM or dispatch pattern the static graph misses, or test fixtures to pin a finder's behavior. Open an issue or PR on [GitHub](https://github.com/codellm-devkit/codeanalyzer-python), or come talk it through on [Discord](https://discord.gg/zEjz9YrmqN).
42+
</Aside>

src/content/docs/guides/entrypoints.mdx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,20 @@ title: Entrypoint detection
33
description: How codeanalyzer-python surfaces framework-dispatched roots — Flask routes, FastAPI routers, Celery tasks, Click commands, gRPC servicers — as PyEntrypoint records, JackEE-style.
44
---
55

6-
import { Aside, LinkCard, CardGrid } from "@astrojs/starlight/components";
6+
import { Aside, Badge, LinkCard, CardGrid } from "@astrojs/starlight/components";
7+
8+
<p>
9+
<Badge text="Work in progress" variant="caution" />{" "}
10+
<Badge text="Help wanted" variant="note" />
11+
</p>
12+
13+
<Aside type="caution" title="Design, not shipped behavior">
14+
The `PyEntrypoint` schema and the `AbstractEntrypointFinder` contract described here are implemented, but **no concrete finder ships yet**`BUILTIN_PASS_FACTORIES` is empty. Until a finder is written, `PyApplication.entrypoints` comes back empty for every framework. Read this page as the shape finders target and the API you'd write one against, not as detection that runs out of the box. See [Extending → Overview](/codeanalyzer-python/extending/overview/).
15+
</Aside>
716

817
An **entrypoint** is a function the framework calls that your own code never calls directly: a Flask route handler, a FastAPI endpoint, a Celery task, a Click command, a gRPC servicer method. Static call-graph analysis can't see these edges — the framework wires them up at runtime — so without help, those handlers look like dead code, and reachability from "where execution actually enters" is unanswerable.
918

10-
codeanalyzer-python detects entrypoints with a layer modeled on **JackEE** (Antoniadis et al., PLDI 2020) — the same framework-independent entrypoint architecture the Java analyzer uses. Each detected root becomes a `PyEntrypoint` in `PyApplication.entrypoints`, keyed by framework name.
19+
codeanalyzer-python is designed to surface entrypoints with a layer modeled on **JackEE** (Antoniadis et al., PLDI 2020) — the same framework-independent entrypoint architecture the Java analyzer uses. Each detected root becomes a `PyEntrypoint` in `PyApplication.entrypoints`, keyed by framework name. The detection sources and framework-specific fields below define what a finder *can* record; which of them are populated depends entirely on which finders are installed.
1120

1221
```mermaid
1322
flowchart LR

src/content/docs/index.mdx

Lines changed: 4 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: codeanalyzer-python
33
description: Turn a Python project into one typed artifact — symbol table, call graph, and framework entrypoints — with Jedi, CodeQL, and Tree-sitter. The Python backend behind CLDK.
4-
template: splash
4+
template: doc
55
hero:
66
tagline: Point it at a Python project and get back one typed artifact — symbol table, call graph, and framework entrypoints. Program analysis your agents can call.
77
actions:
@@ -19,94 +19,17 @@ hero:
1919
variant: minimal
2020
---
2121

22-
import { Card, CardGrid, LinkCard, Tabs, TabItem } from "@astrojs/starlight/components";
22+
import { CardGrid, LinkCard } from "@astrojs/starlight/components";
2323

24-
```bash frame="none"
25-
pip install codeanalyzer-python
26-
```
27-
28-
Point `codeanalyzer` at a project and it emits a single **`analysis.json`** — a typed model of every module, class, method, and call edge, plus the framework entrypoints that reach them. One artifact, schema-stable, ready to load into a graph or hand to a code LLM. It's the Python backend behind [CLDK](https://github.com/codellm-devkit/python-sdk), usable standalone as a CLI or a library.
29-
30-
```bash frame="none"
31-
codeanalyzer --input ./my-python-project --output ./out
32-
# -> ./out/analysis.json (symbol table + call graph + entrypoints)
33-
```
34-
35-
## What codeanalyzer-python gives you
36-
37-
<ul class="cldk-capabilities">
38-
<a class="cldk-capability" href="/codeanalyzer-python/guides/concepts/#symbol-table">
39-
<p class="cldk-capability__title">Symbol table</p>
40-
<p class="cldk-capability__def">Every module, class, method, and field — typed, located, and queryable.</p>
41-
<pre class="cldk-capability__thumb">analysis.symbol_table
42-
PyModule -> PyClass -> PyCallable</pre>
43-
<ul class="cldk-capability__examples"><li>Enumerate classes and methods</li><li>Pull a callable's source body</li></ul>
44-
</a>
45-
<a class="cldk-capability" href="/codeanalyzer-python/guides/concepts/#call-graph">
46-
<p class="cldk-capability__title">Call graph</p>
47-
<p class="cldk-capability__def">Who-calls-whom as identity-keyed edges with provenance.</p>
48-
<pre class="cldk-capability__thumb">analysis.call_graph
49-
PyCallEdge(source -> target)</pre>
50-
<ul class="cldk-capability__examples"><li>Find every caller of a method</li><li>Load into <code>networkx</code> and walk it</li></ul>
51-
</a>
52-
<a class="cldk-capability" href="/codeanalyzer-python/guides/entrypoints/">
53-
<p class="cldk-capability__title">Entrypoints</p>
54-
<p class="cldk-capability__def">Framework-dispatched roots — Flask routes, Celery tasks, CLI commands.</p>
55-
<pre class="cldk-capability__thumb">analysis.entrypoints
56-
PyEntrypoint(framework, route)</pre>
57-
<ul class="cldk-capability__examples"><li>List every HTTP route</li><li>Seed reachability from real roots</li></ul>
58-
</a>
59-
<a class="cldk-capability" href="/codeanalyzer-python/guides/codeql/">
60-
<p class="cldk-capability__title">CodeQL resolution</p>
61-
<p class="cldk-capability__def">Optional second engine that recovers edges Jedi can't see.</p>
62-
<pre class="cldk-capability__thumb">codeanalyzer -i ./proj --codeql</pre>
63-
<ul class="cldk-capability__examples"><li>Resolve dynamic-dispatch targets</li><li>Backfill unresolved call sites</li></ul>
64-
</a>
65-
<a class="cldk-capability" href="/codeanalyzer-python/extending/analysis-passes/">
66-
<p class="cldk-capability__title">Extensible passes</p>
67-
<p class="cldk-capability__def">Add your own entrypoint finders and synthetic edges via entry points.</p>
68-
<pre class="cldk-capability__thumb">[project.entry-points.
69-
"codeanalyzer.analysis_passes"]</pre>
70-
<ul class="cldk-capability__examples"><li>Detect a new framework</li><li>Synthesize ORM-dispatch edges</li></ul>
71-
</a>
72-
</ul>
73-
74-
<div class="cldk-agent-band">
75-
76-
## One artifact, three engines
77-
78-
Jedi resolves the symbol table and a lexical call graph on every run — no setup beyond a Python interpreter. Tree-sitter backs the syntactic extraction. CodeQL is opt-in: when you pass `--codeql`, codeanalyzer downloads the CLI on first use, builds a database, and merges its resolved edges with Jedi's — recovering RPC, third-party, and dynamically-dispatched targets that lexical analysis misses. Every edge records its `provenance`, so you always know which engine saw it.
79-
80-
```bash
81-
# Jedi only (default) — fast, zero external tooling
82-
codeanalyzer --input ./proj
83-
84-
# Add CodeQL — deeper resolution, downloaded and cached per project
85-
codeanalyzer --input ./proj --codeql
86-
```
87-
88-
```mermaid
89-
flowchart LR
90-
A[Python project] --> B["codeanalyzer --input"]
91-
B --> C[Jedi + Tree-sitter]
92-
B -.->|--codeql| D[CodeQL]
93-
C --> E[merge edges]
94-
D -.-> E
95-
E --> F["analysis.json
96-
symbol table + call graph + entrypoints"]
97-
```
98-
99-
[See how the call graph is built →](/codeanalyzer-python/guides/concepts/#call-graph)
100-
101-
</div>
24+
Point `codeanalyzer` at a project and it emits a single **`analysis.json`** — a typed model of every module, class, method, and call edge, plus the framework entrypoints that reach them. It's the Python backend behind [CLDK](https://github.com/codellm-devkit/python-sdk), usable standalone as a CLI or a library.
10225

10326
## Start building
10427

10528
<CardGrid>
10629
<LinkCard title="Quickstart" description="Install the CLI and produce your first analysis.json in a couple of minutes." href="/codeanalyzer-python/quickstart/" />
10730
<LinkCard title="What is codeanalyzer-python?" description="The mental model: project in → one typed PyApplication artifact out." href="/codeanalyzer-python/what-is-codeanalyzer/" />
10831
<LinkCard title="CLI usage" description="Every flag, with worked examples: output formats, caching, single-file mode." href="/codeanalyzer-python/guides/cli-usage/" />
109-
<LinkCard title="Entrypoint detection" description="JackEE-style finders that surface Flask, FastAPI, Celery, Click, and gRPC roots." href="/codeanalyzer-python/guides/entrypoints/" />
32+
<LinkCard title="Entrypoint detection" description="The planned JackEE-style finder layer for Flask, FastAPI, Celery, Click, and gRPC roots (work in progress)." href="/codeanalyzer-python/guides/entrypoints/" />
11033
</CardGrid>
11134

11235
## Learn more
@@ -117,9 +40,3 @@ symbol table + call graph + entrypoints"]
11740
<LinkCard title="CodeQL analysis" description="What --codeql adds, how the database is cached, and the resolution ladder." href="/codeanalyzer-python/guides/codeql/" />
11841
<LinkCard title="Analysis passes" description="Write your own pass: detect a framework or synthesize edges the static graph can't see." href="/codeanalyzer-python/extending/analysis-passes/" />
11942
</CardGrid>
120-
121-
<p class="cldk-badges">
122-
<a href="https://pypi.org/project/codeanalyzer-python/"><img src="https://img.shields.io/pypi/v/codeanalyzer-python?style=for-the-badge&label=codeanalyzer-python&color=blue" alt="PyPI" /></a>
123-
<a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache%202.0-green?style=for-the-badge" alt="License Apache 2.0" /></a>
124-
<a href="https://discord.gg/zEjz9YrmqN"><img src="https://img.shields.io/badge/Discord-Join-5865F2?style=for-the-badge&logo=discord&logoColor=white" alt="Discord" /></a>
125-
</p>

src/content/docs/quickstart.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,6 @@ The first `--codeql` run downloads the CodeQL CLI and builds a database, so it t
9191
<CardGrid>
9292
<LinkCard title="CLI usage" description="Output formats, caching, single-file mode, verbosity — every flag with examples." href="/codeanalyzer-python/guides/cli-usage/" />
9393
<LinkCard title="Core concepts" description="What the symbol table, call graph, and entrypoints actually contain." href="/codeanalyzer-python/guides/concepts/" />
94-
<LinkCard title="Entrypoint detection" description="Surface Flask, FastAPI, Celery, Click, and gRPC roots automatically." href="/codeanalyzer-python/guides/entrypoints/" />
94+
<LinkCard title="Entrypoint detection" description="The planned JackEE-style finder layer for Flask, FastAPI, Celery, Click, and gRPC roots (work in progress)." href="/codeanalyzer-python/guides/entrypoints/" />
9595
<LinkCard title="Output schema" description="The PyApplication data model, field by field." href="/codeanalyzer-python/reference/schema/" />
9696
</CardGrid>

src/styles/docs.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,22 @@ html {
208208
.sl-markdown-content pre.cldk-signature {
209209
white-space: pre-wrap;
210210
}
211+
/* ---- In-content status/tier badges: subtle pastel pills, not loud blocks -- */
212+
.sl-markdown-content .sl-badge {
213+
font-family: var(--sl-font);
214+
font-size: 0.75rem;
215+
font-weight: 600;
216+
letter-spacing: 0.01em;
217+
border-radius: 999px;
218+
padding: 0.05rem 0.55rem;
219+
border-width: 1px;
220+
white-space: nowrap;
221+
background: transparent;
222+
}
223+
224+
.sl-markdown-content .sl-badge.success { color: #57b87e; border-color: rgba(36, 161, 72, 0.28); background: rgba(36, 161, 72, 0.08); }
225+
.sl-markdown-content .sl-badge.tip { color: #44b3b0; border-color: rgba(0, 157, 154, 0.28); background: rgba(0, 157, 154, 0.08); }
226+
.sl-markdown-content .sl-badge.caution { color: #cba43a; border-color: rgba(178, 134, 0, 0.28); background: rgba(178, 134, 0, 0.09); }
227+
.sl-markdown-content .sl-badge.note { color: #5b8def; border-color: rgba(15, 98, 254, 0.28); background: rgba(15, 98, 254, 0.08); }
228+
.sl-markdown-content .sl-badge.default { color: #9a9a9a; border-color: rgba(111, 111, 111, 0.28); background: rgba(111, 111, 111, 0.08); }
229+
.sl-markdown-content .sl-badge.danger { color: #e8737a; border-color: rgba(218, 30, 40, 0.28); background: rgba(218, 30, 40, 0.08); }

0 commit comments

Comments
 (0)