purecontext-mcp 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/docs/dev/API_STABILITY.md +0 -319
- package/docs/dev/DECISIONS.md +0 -22
- package/docs/dev/DOCUMENTATION_PLAN.md +0 -113
- package/docs/dev/PHASE10_TASKS.md +0 -476
- package/docs/dev/PHASE11_TASKS.md +0 -385
- package/docs/dev/PHASE12_TASKS.md +0 -335
- package/docs/dev/PHASE13_TASKS.md +0 -381
- package/docs/dev/PHASE14_TASKS.md +0 -371
- package/docs/dev/PHASE15_TASKS.md +0 -256
- package/docs/dev/PHASE16_TASKS.md +0 -314
- package/docs/dev/PHASE17_TASKS.md +0 -321
- package/docs/dev/PHASE18_TASKS.md +0 -345
- package/docs/dev/PHASE19_TASKS.md +0 -261
- package/docs/dev/PHASE1_TASKS.md +0 -443
- package/docs/dev/PHASE20_TASKS.md +0 -280
- package/docs/dev/PHASE21_TASKS.md +0 -355
- package/docs/dev/PHASE22_TASKS.md +0 -371
- package/docs/dev/PHASE23_TASKS.md +0 -274
- package/docs/dev/PHASE24_TASKS.md +0 -326
- package/docs/dev/PHASE25_TASKS.md +0 -452
- package/docs/dev/PHASE26_TASKS.md +0 -253
- package/docs/dev/PHASE27_TASKS.md +0 -410
- package/docs/dev/PHASE2_TASKS.md +0 -328
- package/docs/dev/PHASE3_TASKS.md +0 -571
- package/docs/dev/PHASE4_TASKS.md +0 -531
- package/docs/dev/PHASE5_TASKS.md +0 -835
- package/docs/dev/PHASE6_TASKS.md +0 -347
- package/docs/dev/PHASE7_TASKS.md +0 -257
- package/docs/dev/PHASE8_TASKS.md +0 -299
- package/docs/dev/PHASE9_TASKS.md +0 -320
- package/docs/dev/PureContext_MCP_PRD_v1.0.docx +0 -0
- package/docs/dev/SELF_HOSTING.md +0 -142
- package/docs/dev/TEAM_SETUP.md +0 -316
- package/docs/dev/TELEMETRY.md +0 -99
- package/docs/dev/feature-analysis.md +0 -305
- package/docs/dev/phase-1-notes.md +0 -3
|
@@ -1,476 +0,0 @@
|
|
|
1
|
-
# Phase 10 — Task Breakdown
|
|
2
|
-
|
|
3
|
-
**Goal**: Add framework adapters for Rust web frameworks (Axum, Actix-web, Rocket), Java backend frameworks (Spring Boot, Micronaut, Quarkus), and ORM enrichment adapters (Hibernate, SQLAlchemy, Django ORM). This phase completes the framework adapter roadmap.
|
|
4
|
-
|
|
5
|
-
**Scope rationale**: These frameworks represent the most popular choices in their respective ecosystems. Rust web frameworks are increasingly adopted for high-performance services. Spring Boot dominates enterprise Java. ORM adapters enrich existing language handlers with database schema metadata, improving code understanding for data-driven applications.
|
|
6
|
-
|
|
7
|
-
**Approach**: Tasks are grouped by ecosystem (Rust, Java, ORM). Within each group, adapters are independent and can be developed in parallel.
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## Task 80: Axum Adapter (Rust)
|
|
12
|
-
|
|
13
|
-
Extract route and middleware symbols from Axum web applications. Axum uses a tower-based routing DSL.
|
|
14
|
-
|
|
15
|
-
**Deliverables:**
|
|
16
|
-
|
|
17
|
-
- `src/adapters/axum.ts` — implements `FrameworkAdapter`
|
|
18
|
-
- `name`: `'axum'`
|
|
19
|
-
- `extensions()`: `[]` — `.rs` files handled by Rust handler
|
|
20
|
-
- `detect(projectRoot)`:
|
|
21
|
-
- Read `Cargo.toml` — check for `axum` in `[dependencies]`
|
|
22
|
-
- Regex: `/axum\s*=/`
|
|
23
|
-
- `fileFilter(filePath)`: `.rs` files only
|
|
24
|
-
- `extractFrameworkSymbols(tree, source, filePath)`:
|
|
25
|
-
- Scan for `Router::new()` chains:
|
|
26
|
-
- `.route("/path", get(handler))` → emit kind `'route'`
|
|
27
|
-
- `.route("/path", post(handler).put(handler2))` → emit multiple routes
|
|
28
|
-
- HTTP methods: `get`, `post`, `put`, `patch`, `delete`, `head`, `options`, `trace`
|
|
29
|
-
- For each route:
|
|
30
|
-
- `frameworkMeta.http_method`: method name uppercase
|
|
31
|
-
- `frameworkMeta.route_path`: path string
|
|
32
|
-
- `frameworkMeta.axum_route: true`
|
|
33
|
-
- Scan for `.layer(...)` calls → emit kind `'middleware'`
|
|
34
|
-
- Extract middleware type from argument
|
|
35
|
-
- `frameworkMeta.axum_layer: true`
|
|
36
|
-
- Scan for `#[derive(FromRequest)]` or `impl FromRequest` → emit kind `'type'`
|
|
37
|
-
- `frameworkMeta.axum_extractor: true`
|
|
38
|
-
- `enrichMetadata(symbol)`: no-op
|
|
39
|
-
- Register via `registerAdapter(axumAdapter)`
|
|
40
|
-
|
|
41
|
-
**Key technical notes:**
|
|
42
|
-
- Axum routes are defined via method chaining — parse the full chain
|
|
43
|
-
- Path parameters use `:param` syntax: `/users/:id`
|
|
44
|
-
- Nested routers via `.nest("/prefix", router)` — combine prefixes
|
|
45
|
-
- Tower layers are middleware — extract type names
|
|
46
|
-
|
|
47
|
-
**Verify:** Index `test/fixtures/axum-project/`. Verify routes with GET/POST extracted. Verify middleware layers extracted. Verify path parameters preserved.
|
|
48
|
-
|
|
49
|
-
**Tests:** `.route()` single method, `.route()` multiple methods, path with `:param`, `.nest()` prefix, `.layer()` middleware, `FromRequest` extractor.
|
|
50
|
-
|
|
51
|
-
---
|
|
52
|
-
|
|
53
|
-
## Task 81: Actix-web Adapter (Rust)
|
|
54
|
-
|
|
55
|
-
Extract route and middleware symbols from Actix-web applications. Actix uses procedural macros for route definitions.
|
|
56
|
-
|
|
57
|
-
**Deliverables:**
|
|
58
|
-
|
|
59
|
-
- `src/adapters/actix-web.ts` — implements `FrameworkAdapter`
|
|
60
|
-
- `name`: `'actix-web'`
|
|
61
|
-
- `extensions()`: `[]` — `.rs` files handled by Rust handler
|
|
62
|
-
- `detect(projectRoot)`:
|
|
63
|
-
- Read `Cargo.toml` — check for `actix-web` in `[dependencies]`
|
|
64
|
-
- `fileFilter(filePath)`: `.rs` files only
|
|
65
|
-
- `extractFrameworkSymbols(tree, source, filePath)`:
|
|
66
|
-
- Scan for route attribute macros:
|
|
67
|
-
- `#[get("/path")]`, `#[post("/path")]`, etc. → emit kind `'route'`
|
|
68
|
-
- HTTP methods: `get`, `post`, `put`, `patch`, `delete`, `head`, `options`, `trace`, `connect`
|
|
69
|
-
- For each route:
|
|
70
|
-
- Extract path from attribute argument
|
|
71
|
-
- `frameworkMeta.http_method`: macro name uppercase
|
|
72
|
-
- `frameworkMeta.route_path`: path string
|
|
73
|
-
- `frameworkMeta.actix_route: true`
|
|
74
|
-
- Scan for `web::resource("/path")` / `web::scope("/prefix")` chains:
|
|
75
|
-
- `.route(web::get().to(handler))` → emit route
|
|
76
|
-
- Scan for `.wrap()` calls → emit kind `'middleware'`
|
|
77
|
-
- `frameworkMeta.actix_middleware: true`
|
|
78
|
-
- Scan for `impl FromRequest for Type` → emit kind `'type'`
|
|
79
|
-
- `frameworkMeta.actix_extractor: true`
|
|
80
|
-
- `enrichMetadata(symbol)`: no-op
|
|
81
|
-
- Register via `registerAdapter(actixWebAdapter)`
|
|
82
|
-
|
|
83
|
-
**Key technical notes:**
|
|
84
|
-
- Actix routes can be defined via macros (`#[get]`) or programmatically (`web::resource`)
|
|
85
|
-
- Extract both patterns for complete coverage
|
|
86
|
-
- Path parameters use `{param}` syntax: `/users/{id}`
|
|
87
|
-
- Guards add conditions to routes — note but don't extract separately
|
|
88
|
-
|
|
89
|
-
**Verify:** Index `test/fixtures/actix-project/`. Verify macro-defined routes extracted. Verify programmatic routes extracted. Verify middleware extracted.
|
|
90
|
-
|
|
91
|
-
**Tests:** `#[get("/path")]` macro, `#[post]` macro, `web::resource().route()` programmatic, path with `{param}`, `.wrap()` middleware, `FromRequest` impl.
|
|
92
|
-
|
|
93
|
-
---
|
|
94
|
-
|
|
95
|
-
## Task 82: Rocket Adapter (Rust)
|
|
96
|
-
|
|
97
|
-
Extract route and middleware symbols from Rocket web applications. Rocket uses procedural macros similar to Actix.
|
|
98
|
-
|
|
99
|
-
**Deliverables:**
|
|
100
|
-
|
|
101
|
-
- `src/adapters/rocket.ts` — implements `FrameworkAdapter`
|
|
102
|
-
- `name`: `'rocket'`
|
|
103
|
-
- `extensions()`: `[]` — `.rs` files handled by Rust handler
|
|
104
|
-
- `detect(projectRoot)`:
|
|
105
|
-
- Read `Cargo.toml` — check for `rocket` in `[dependencies]`
|
|
106
|
-
- `fileFilter(filePath)`: `.rs` files only
|
|
107
|
-
- `extractFrameworkSymbols(tree, source, filePath)`:
|
|
108
|
-
- Scan for route attribute macros:
|
|
109
|
-
- `#[get("/path")]`, `#[post("/path")]`, etc. → emit kind `'route'`
|
|
110
|
-
- `#[route(GET, path = "/path")]` → emit kind `'route'`
|
|
111
|
-
- For each route:
|
|
112
|
-
- `frameworkMeta.http_method`: method from macro
|
|
113
|
-
- `frameworkMeta.route_path`: path string
|
|
114
|
-
- `frameworkMeta.rocket_route: true`
|
|
115
|
-
- Scan for `#[catch(code)]` → emit kind `'route'`
|
|
116
|
-
- `frameworkMeta.rocket_catcher: true`
|
|
117
|
-
- `frameworkMeta.status_code`: the code number
|
|
118
|
-
- Scan for `impl Fairing for Type` → emit kind `'middleware'`
|
|
119
|
-
- `frameworkMeta.rocket_fairing: true`
|
|
120
|
-
- Scan for `#[derive(FromForm)]`, `#[derive(FromRequest)]` → emit kind `'type'`
|
|
121
|
-
- `frameworkMeta.rocket_guard: true`
|
|
122
|
-
- `enrichMetadata(symbol)`: no-op
|
|
123
|
-
- Register via `registerAdapter(rocketAdapter)`
|
|
124
|
-
|
|
125
|
-
**Key technical notes:**
|
|
126
|
-
- Rocket path parameters use `<param>` syntax: `/users/<id>`
|
|
127
|
-
- Rocket fairings are lifecycle middleware (request, response, attach)
|
|
128
|
-
- Error catchers (`#[catch]`) are special routes for HTTP error codes
|
|
129
|
-
- Request guards are validators/extractors
|
|
130
|
-
|
|
131
|
-
**Verify:** Index `test/fixtures/rocket-project/`. Verify routes extracted. Verify catchers extracted with status codes. Verify fairings extracted.
|
|
132
|
-
|
|
133
|
-
**Tests:** `#[get]` macro, `#[post]` with form data, `#[route(GET, path = "...")]`, path with `<param>`, `#[catch(404)]` catcher, `Fairing` impl, `FromForm` derive.
|
|
134
|
-
|
|
135
|
-
---
|
|
136
|
-
|
|
137
|
-
## Task 83: Spring Boot Adapter (Java)
|
|
138
|
-
|
|
139
|
-
Extract route, bean, and component symbols from Spring Boot applications. Spring uses annotations extensively.
|
|
140
|
-
|
|
141
|
-
**Deliverables:**
|
|
142
|
-
|
|
143
|
-
- `src/adapters/spring-boot.ts` — implements `FrameworkAdapter`
|
|
144
|
-
- `name`: `'spring-boot'`
|
|
145
|
-
- `extensions()`: `[]` — `.java` files handled by Java handler
|
|
146
|
-
- `detect(projectRoot)`:
|
|
147
|
-
- Check for `pom.xml` with `spring-boot-starter` artifact
|
|
148
|
-
- OR `build.gradle` with `org.springframework.boot` dependency
|
|
149
|
-
- OR `src/main/resources/application.properties` or `application.yml`
|
|
150
|
-
- `fileFilter(filePath)`: `.java` and `.kt` files
|
|
151
|
-
- `extractFrameworkSymbols(tree, source, filePath)`:
|
|
152
|
-
- **Controllers:**
|
|
153
|
-
- `@RestController` or `@Controller` on class → emit kind `'class'` with `frameworkMeta.spring_controller: true`
|
|
154
|
-
- `@RequestMapping("/prefix")` on class → capture base path
|
|
155
|
-
- `@GetMapping`, `@PostMapping`, `@PutMapping`, `@DeleteMapping`, `@PatchMapping` on methods → emit kind `'route'`
|
|
156
|
-
- Combine class prefix with method path
|
|
157
|
-
- `frameworkMeta.http_method`, `frameworkMeta.route_path`, `frameworkMeta.spring_route: true`
|
|
158
|
-
- **Services and components:**
|
|
159
|
-
- `@Service`, `@Component`, `@Repository` on class → emit with `frameworkMeta.spring_bean: true`
|
|
160
|
-
- **Configuration:**
|
|
161
|
-
- `@Configuration` class → emit with `frameworkMeta.spring_config: true`
|
|
162
|
-
- `@Bean` methods → emit kind `'function'` with `frameworkMeta.spring_bean: true`
|
|
163
|
-
- **Dependency injection:**
|
|
164
|
-
- `@Autowired` fields/constructors → note in metadata (don't emit separate symbol)
|
|
165
|
-
- **Scheduled tasks:**
|
|
166
|
-
- `@Scheduled` methods → emit kind `'function'` with `frameworkMeta.spring_scheduled: true`
|
|
167
|
-
- **Event listeners:**
|
|
168
|
-
- `@EventListener` methods → emit kind `'function'` with `frameworkMeta.spring_listener: true`
|
|
169
|
-
- `enrichMetadata(symbol)`: no-op
|
|
170
|
-
- Register via `registerAdapter(springBootAdapter)`
|
|
171
|
-
|
|
172
|
-
**Key technical notes:**
|
|
173
|
-
- Spring path variables use `{param}` syntax: `/users/{id}`
|
|
174
|
-
- RequestMapping can specify multiple paths and methods
|
|
175
|
-
- Spring Boot apps often use Kotlin — support both Java and Kotlin files
|
|
176
|
-
- Bean names default to method/class name unless specified
|
|
177
|
-
|
|
178
|
-
**Verify:** Index `test/fixtures/spring-boot-project/`. Verify REST endpoints extracted with correct paths. Verify @Service and @Component beans detected. Verify @Scheduled jobs extracted.
|
|
179
|
-
|
|
180
|
-
**Tests:** `@GetMapping`, `@PostMapping`, `@RequestMapping` with path, `@RestController` with class-level path, `@Service`, `@Component`, `@Bean` method, `@Scheduled`, path variable `{id}`.
|
|
181
|
-
|
|
182
|
-
---
|
|
183
|
-
|
|
184
|
-
## Task 84: Micronaut Adapter (Java)
|
|
185
|
-
|
|
186
|
-
Extract route and bean symbols from Micronaut applications. Micronaut is similar to Spring but with compile-time DI.
|
|
187
|
-
|
|
188
|
-
**Deliverables:**
|
|
189
|
-
|
|
190
|
-
- `src/adapters/micronaut.ts` — implements `FrameworkAdapter`
|
|
191
|
-
- `name`: `'micronaut'`
|
|
192
|
-
- `extensions()`: `[]`
|
|
193
|
-
- `detect(projectRoot)`:
|
|
194
|
-
- Check for `pom.xml` with `micronaut-*` artifacts
|
|
195
|
-
- OR `build.gradle` with `io.micronaut` dependencies
|
|
196
|
-
- `fileFilter(filePath)`: `.java`, `.kt`, `.groovy` files
|
|
197
|
-
- `extractFrameworkSymbols(tree, source, filePath)`:
|
|
198
|
-
- **Controllers:**
|
|
199
|
-
- `@Controller("/prefix")` on class → emit with base path
|
|
200
|
-
- `@Get`, `@Post`, `@Put`, `@Delete`, `@Patch` on methods → emit kind `'route'`
|
|
201
|
-
- `frameworkMeta.http_method`, `frameworkMeta.route_path`, `frameworkMeta.micronaut_route: true`
|
|
202
|
-
- **Beans:**
|
|
203
|
-
- `@Singleton`, `@Prototype`, `@Bean` → emit with `frameworkMeta.micronaut_bean: true`
|
|
204
|
-
- **Clients:**
|
|
205
|
-
- `@Client("/base")` interface → emit kind `'interface'` with `frameworkMeta.micronaut_client: true`
|
|
206
|
-
- **Scheduled:**
|
|
207
|
-
- `@Scheduled` methods → emit with `frameworkMeta.micronaut_scheduled: true`
|
|
208
|
-
- **Event listeners:**
|
|
209
|
-
- `@EventListener` methods → emit with `frameworkMeta.micronaut_listener: true`
|
|
210
|
-
- `enrichMetadata(symbol)`: no-op
|
|
211
|
-
- Register via `registerAdapter(micronautAdapter)`
|
|
212
|
-
|
|
213
|
-
**Key technical notes:**
|
|
214
|
-
- Micronaut paths use `{param}` like Spring
|
|
215
|
-
- Micronaut clients are declarative HTTP clients — useful for understanding service interactions
|
|
216
|
-
- Micronaut supports Java, Kotlin, and Groovy
|
|
217
|
-
|
|
218
|
-
**Verify:** Index `test/fixtures/micronaut-project/`. Verify endpoints extracted. Verify @Client interfaces extracted.
|
|
219
|
-
|
|
220
|
-
**Tests:** `@Get("/path")`, `@Controller` with base path, `@Singleton` bean, `@Client` interface, `@Scheduled`.
|
|
221
|
-
|
|
222
|
-
---
|
|
223
|
-
|
|
224
|
-
## Task 85: Quarkus Adapter (Java)
|
|
225
|
-
|
|
226
|
-
Extract route and bean symbols from Quarkus applications. Quarkus uses JAX-RS annotations.
|
|
227
|
-
|
|
228
|
-
**Deliverables:**
|
|
229
|
-
|
|
230
|
-
- `src/adapters/quarkus.ts` — implements `FrameworkAdapter`
|
|
231
|
-
- `name`: `'quarkus'`
|
|
232
|
-
- `extensions()`: `[]`
|
|
233
|
-
- `detect(projectRoot)`:
|
|
234
|
-
- Check for `pom.xml` with `quarkus-*` artifacts
|
|
235
|
-
- OR `build.gradle` with `io.quarkus` dependencies
|
|
236
|
-
- `fileFilter(filePath)`: `.java`, `.kt` files
|
|
237
|
-
- `extractFrameworkSymbols(tree, source, filePath)`:
|
|
238
|
-
- **JAX-RS resources:**
|
|
239
|
-
- `@Path("/prefix")` on class → emit with base path
|
|
240
|
-
- `@GET`, `@POST`, `@PUT`, `@DELETE`, `@PATCH` on methods → emit kind `'route'`
|
|
241
|
-
- `frameworkMeta.http_method`, `frameworkMeta.route_path`, `frameworkMeta.quarkus_route: true`
|
|
242
|
-
- **Beans:**
|
|
243
|
-
- `@ApplicationScoped`, `@Singleton`, `@Dependent` → emit with `frameworkMeta.quarkus_bean: true`
|
|
244
|
-
- **Reactive routes:**
|
|
245
|
-
- `@Route` annotation → emit kind `'route'`
|
|
246
|
-
- `frameworkMeta.quarkus_reactive: true`
|
|
247
|
-
- **Scheduled:**
|
|
248
|
-
- `@Scheduled` methods → emit with `frameworkMeta.quarkus_scheduled: true`
|
|
249
|
-
- **REST clients:**
|
|
250
|
-
- `@RegisterRestClient` interface → emit kind `'interface'` with `frameworkMeta.quarkus_client: true`
|
|
251
|
-
- `enrichMetadata(symbol)`: no-op
|
|
252
|
-
- Register via `registerAdapter(quarkusAdapter)`
|
|
253
|
-
|
|
254
|
-
**Key technical notes:**
|
|
255
|
-
- Quarkus uses JAX-RS (standard Java REST API) unlike Spring
|
|
256
|
-
- Path parameters use `{param}` syntax
|
|
257
|
-
- Quarkus supports both imperative and reactive programming models
|
|
258
|
-
- RESTEasy reactive routes are an alternative to JAX-RS
|
|
259
|
-
|
|
260
|
-
**Verify:** Index `test/fixtures/quarkus-project/`. Verify JAX-RS endpoints extracted. Verify @ApplicationScoped beans detected.
|
|
261
|
-
|
|
262
|
-
**Tests:** `@Path` + `@GET`, `@POST` method, `@ApplicationScoped`, `@RegisterRestClient`, `@Scheduled`, reactive `@Route`.
|
|
263
|
-
|
|
264
|
-
---
|
|
265
|
-
|
|
266
|
-
## Task 86: Hibernate Adapter (Java ORM)
|
|
267
|
-
|
|
268
|
-
Enrich entity symbols with database schema metadata from Hibernate/JPA annotations.
|
|
269
|
-
|
|
270
|
-
**Deliverables:**
|
|
271
|
-
|
|
272
|
-
- `src/adapters/hibernate.ts` — implements `FrameworkAdapter`
|
|
273
|
-
- `name`: `'hibernate'`
|
|
274
|
-
- `extensions()`: `[]`
|
|
275
|
-
- `detect(projectRoot)`:
|
|
276
|
-
- Check for `hibernate-core` or `jakarta.persistence` in dependencies
|
|
277
|
-
- OR `persistence.xml` in `src/main/resources/META-INF/`
|
|
278
|
-
- `fileFilter(filePath)`: `.java`, `.kt` files
|
|
279
|
-
- `extractFrameworkSymbols(tree, source, filePath)`:
|
|
280
|
-
- **Entities:**
|
|
281
|
-
- `@Entity` on class → emit kind `'class'`
|
|
282
|
-
- `frameworkMeta.hibernate_entity: true`
|
|
283
|
-
- `frameworkMeta.table_name`: from `@Table(name = "...")` or class name lowercase
|
|
284
|
-
- **Fields:**
|
|
285
|
-
- For each `@Column` field → emit kind `'const'`
|
|
286
|
-
- `frameworkMeta.column_name`: from annotation or field name
|
|
287
|
-
- `frameworkMeta.column_type`: inferred from Java type
|
|
288
|
-
- `frameworkMeta.nullable`: from `@Column(nullable = ...)`
|
|
289
|
-
- **Relationships:**
|
|
290
|
-
- `@OneToMany`, `@ManyToOne`, `@OneToOne`, `@ManyToMany` → emit kind `'const'`
|
|
291
|
-
- `frameworkMeta.relationship`: type
|
|
292
|
-
- `frameworkMeta.target_entity`: related class
|
|
293
|
-
- **IDs:**
|
|
294
|
-
- `@Id` field → add `frameworkMeta.primary_key: true`
|
|
295
|
-
- `@GeneratedValue` → add `frameworkMeta.generated: true`
|
|
296
|
-
- **Queries:**
|
|
297
|
-
- `@NamedQuery` on class → emit kind `'function'`
|
|
298
|
-
- `frameworkMeta.hibernate_query: true`
|
|
299
|
-
- `frameworkMeta.query_string`: the JPQL query
|
|
300
|
-
- `enrichMetadata(symbol)`:
|
|
301
|
-
- For existing class symbols: add entity metadata if `@Entity` present
|
|
302
|
-
- Register via `registerAdapter(hibernateAdapter)`
|
|
303
|
-
|
|
304
|
-
**Key technical notes:**
|
|
305
|
-
- JPA (Jakarta Persistence) and Hibernate share annotations — handle both
|
|
306
|
-
- Table/column names may differ from class/field names via annotations
|
|
307
|
-
- Relationships define the entity graph — useful for understanding data flow
|
|
308
|
-
- Named queries are reusable JPQL snippets
|
|
309
|
-
|
|
310
|
-
**Verify:** Index a project with Hibernate entities. Verify table names extracted. Verify relationship metadata present.
|
|
311
|
-
|
|
312
|
-
**Tests:** `@Entity` class, `@Table` with custom name, `@Column` field, `@Id` primary key, `@OneToMany` relationship, `@NamedQuery`.
|
|
313
|
-
|
|
314
|
-
---
|
|
315
|
-
|
|
316
|
-
## Task 87: SQLAlchemy Adapter (Python ORM)
|
|
317
|
-
|
|
318
|
-
Enrich model symbols with database schema metadata from SQLAlchemy models.
|
|
319
|
-
|
|
320
|
-
**Deliverables:**
|
|
321
|
-
|
|
322
|
-
- `src/adapters/sqlalchemy.ts` — implements `FrameworkAdapter`
|
|
323
|
-
- `name`: `'sqlalchemy'`
|
|
324
|
-
- `extensions()`: `[]`
|
|
325
|
-
- `detect(projectRoot)`:
|
|
326
|
-
- Check `requirements.txt` or `pyproject.toml` for `sqlalchemy`
|
|
327
|
-
- `fileFilter(filePath)`: `.py` files
|
|
328
|
-
- `extractFrameworkSymbols(tree, source, filePath)`:
|
|
329
|
-
- **Models:**
|
|
330
|
-
- Class inheriting from `Base` or `DeclarativeBase` → emit kind `'class'`
|
|
331
|
-
- `frameworkMeta.sqlalchemy_model: true`
|
|
332
|
-
- `frameworkMeta.table_name`: from `__tablename__` attribute
|
|
333
|
-
- **Columns:**
|
|
334
|
-
- `Column(...)` assignments → emit kind `'const'`
|
|
335
|
-
- `frameworkMeta.column_name`: field name
|
|
336
|
-
- `frameworkMeta.column_type`: from `Column(Type, ...)`
|
|
337
|
-
- `frameworkMeta.nullable`: from `nullable=False` (default True)
|
|
338
|
-
- `frameworkMeta.primary_key`: from `primary_key=True`
|
|
339
|
-
- **Relationships:**
|
|
340
|
-
- `relationship(...)` assignments → emit kind `'const'`
|
|
341
|
-
- `frameworkMeta.relationship`: type name from argument
|
|
342
|
-
- `frameworkMeta.back_populates`: if present
|
|
343
|
-
- **SQLAlchemy 2.0 style:**
|
|
344
|
-
- `mapped_column(...)` → same as Column
|
|
345
|
-
- `Mapped[Type]` type annotations → extract column type
|
|
346
|
-
- **Hybrid properties:**
|
|
347
|
-
- `@hybrid_property` decorated methods → emit kind `'const'`
|
|
348
|
-
- `enrichMetadata(symbol)`:
|
|
349
|
-
- For existing class symbols: add model metadata if inherits Base
|
|
350
|
-
- Register via `registerAdapter(sqlalchemyAdapter)`
|
|
351
|
-
|
|
352
|
-
**Key technical notes:**
|
|
353
|
-
- SQLAlchemy 1.x and 2.x have different syntax patterns — handle both
|
|
354
|
-
- `__tablename__` is required or defaults to class name lowercase
|
|
355
|
-
- Relationship patterns: one-to-many via `relationship()`, foreign keys via `Column(ForeignKey(...))`
|
|
356
|
-
|
|
357
|
-
**Verify:** Index a SQLAlchemy project. Verify table names extracted. Verify column types captured.
|
|
358
|
-
|
|
359
|
-
**Tests:** Model with `__tablename__`, `Column(Integer)`, `Column(String)`, `primary_key=True`, `relationship()`, SQLAlchemy 2.0 `mapped_column`, `@hybrid_property`.
|
|
360
|
-
|
|
361
|
-
---
|
|
362
|
-
|
|
363
|
-
## Task 88: Django ORM Adapter (Python ORM)
|
|
364
|
-
|
|
365
|
-
Enrich model symbols with database schema metadata from Django models.
|
|
366
|
-
|
|
367
|
-
**Deliverables:**
|
|
368
|
-
|
|
369
|
-
- `src/adapters/django-orm.ts` — implements `FrameworkAdapter`
|
|
370
|
-
- `name`: `'django-orm'`
|
|
371
|
-
- `extensions()`: `[]`
|
|
372
|
-
- `detect(projectRoot)`:
|
|
373
|
-
- Check for `manage.py` and `django` in dependencies
|
|
374
|
-
- OR `settings.py` with `DATABASES` config
|
|
375
|
-
- `fileFilter(filePath)`: `models.py` or `models/*.py` files
|
|
376
|
-
- `extractFrameworkSymbols(tree, source, filePath)`:
|
|
377
|
-
- **Models:**
|
|
378
|
-
- Class inheriting from `models.Model` → emit kind `'class'`
|
|
379
|
-
- `frameworkMeta.django_model: true`
|
|
380
|
-
- `frameworkMeta.table_name`: from `Meta.db_table` or `app_modelname`
|
|
381
|
-
- `frameworkMeta.app_label`: from file path
|
|
382
|
-
- **Fields:**
|
|
383
|
-
- `models.CharField(...)`, `models.IntegerField(...)`, etc. → emit kind `'const'`
|
|
384
|
-
- `frameworkMeta.field_type`: Django field class name
|
|
385
|
-
- `frameworkMeta.max_length`: for CharField
|
|
386
|
-
- `frameworkMeta.null`: from `null=True`
|
|
387
|
-
- `frameworkMeta.blank`: from `blank=True`
|
|
388
|
-
- **Relationships:**
|
|
389
|
-
- `models.ForeignKey(...)` → emit kind `'const'`
|
|
390
|
-
- `frameworkMeta.relationship`: `'foreign_key'`
|
|
391
|
-
- `frameworkMeta.target_model`: related model
|
|
392
|
-
- `frameworkMeta.on_delete`: delete behavior
|
|
393
|
-
- `models.ManyToManyField(...)`, `models.OneToOneField(...)` → similar
|
|
394
|
-
- **Managers:**
|
|
395
|
-
- `objects = CustomManager()` → emit kind `'const'`
|
|
396
|
-
- `frameworkMeta.django_manager: true`
|
|
397
|
-
- **Meta class:**
|
|
398
|
-
- Extract `verbose_name`, `ordering`, `indexes`, `constraints`
|
|
399
|
-
- `enrichMetadata(symbol)`: no-op
|
|
400
|
-
- Register via `registerAdapter(djangoOrmAdapter)`
|
|
401
|
-
|
|
402
|
-
**Key technical notes:**
|
|
403
|
-
- Django table names are `appname_modelname` by default
|
|
404
|
-
- Field options vary by type (CharField has max_length, IntegerField doesn't)
|
|
405
|
-
- `on_delete` is required for ForeignKey in Django 2.0+
|
|
406
|
-
- Django uses `models.` prefix for all field types
|
|
407
|
-
|
|
408
|
-
**Verify:** Index a Django project. Verify model table names derived correctly. Verify field types captured with options.
|
|
409
|
-
|
|
410
|
-
**Tests:** `models.Model` class, `CharField`, `IntegerField`, `ForeignKey` with `on_delete`, `ManyToManyField`, `Meta` class with `db_table`, custom manager.
|
|
411
|
-
|
|
412
|
-
---
|
|
413
|
-
|
|
414
|
-
## Task 89: Phase 10 Test Fixtures and Integration Tests
|
|
415
|
-
|
|
416
|
-
Validate all Phase 10 adapters end-to-end.
|
|
417
|
-
|
|
418
|
-
**Deliverables:**
|
|
419
|
-
|
|
420
|
-
- `test/fixtures/axum-project/` — minimal Axum app
|
|
421
|
-
- `test/fixtures/actix-project/` — minimal Actix-web app
|
|
422
|
-
- `test/fixtures/rocket-project/` — minimal Rocket app
|
|
423
|
-
- `test/fixtures/spring-boot-project/` — minimal Spring Boot app
|
|
424
|
-
- `test/fixtures/micronaut-project/` — minimal Micronaut app
|
|
425
|
-
- `test/fixtures/quarkus-project/` — minimal Quarkus app
|
|
426
|
-
- `test/fixtures/hibernate-project/` — Java project with Hibernate entities
|
|
427
|
-
- `test/fixtures/sqlalchemy-project/` — Python project with SQLAlchemy models
|
|
428
|
-
- `test/fixtures/django-project/` — Django project with models
|
|
429
|
-
|
|
430
|
-
- Integration tests `test/integration/phase10.test.ts`:
|
|
431
|
-
1. Axum: `.route("/path", get(handler))` → route symbol
|
|
432
|
-
2. Actix: `#[get("/path")]` macro → route symbol
|
|
433
|
-
3. Rocket: `#[get("/path")]` macro → route symbol
|
|
434
|
-
4. Rocket: `#[catch(404)]` → catcher symbol
|
|
435
|
-
5. Spring Boot: `@GetMapping` → route with path
|
|
436
|
-
6. Spring Boot: `@Service` → bean symbol
|
|
437
|
-
7. Micronaut: `@Get("/path")` → route
|
|
438
|
-
8. Quarkus: JAX-RS `@GET` → route
|
|
439
|
-
9. Hibernate: `@Entity` → model with table name
|
|
440
|
-
10. Hibernate: `@Column` → field with metadata
|
|
441
|
-
11. SQLAlchemy: model with `__tablename__` → table name
|
|
442
|
-
12. SQLAlchemy: `Column(Integer)` → typed field
|
|
443
|
-
13. Django: `models.Model` → model with table name
|
|
444
|
-
14. Django: `ForeignKey` → relationship metadata
|
|
445
|
-
15. Full suite regression: all Phase 1–9 tests still green
|
|
446
|
-
|
|
447
|
-
**Verify:** `npm run test` passes entirely — all Phase 1–10 tests green.
|
|
448
|
-
|
|
449
|
-
---
|
|
450
|
-
|
|
451
|
-
## Order of Execution
|
|
452
|
-
|
|
453
|
-
```
|
|
454
|
-
Task 80: Axum adapter █░░░░░░░░░ Rust
|
|
455
|
-
Task 81: Actix-web adapter ██░░░░░░░░ Rust
|
|
456
|
-
Task 82: Rocket adapter ███░░░░░░░ Rust
|
|
457
|
-
Task 83: Spring Boot adapter ████░░░░░░ Java
|
|
458
|
-
Task 84: Micronaut adapter █████░░░░░ Java
|
|
459
|
-
Task 85: Quarkus adapter ██████░░░░ Java DONE
|
|
460
|
-
Task 86: Hibernate adapter ███████░░░ ORM DONE
|
|
461
|
-
Task 87: SQLAlchemy adapter ████████░░ ORM DONE
|
|
462
|
-
Task 88: Django ORM adapter █████████░ ORM DONE
|
|
463
|
-
Task 89: Fixtures + integration tests ██████████ Polish DONE
|
|
464
|
-
```
|
|
465
|
-
|
|
466
|
-
Tasks within ecosystem groups (Rust: 80–82, Java: 83–85, ORM: 86–88) are independent and can be parallelized. Task 89 validates everything.
|
|
467
|
-
|
|
468
|
-
---
|
|
469
|
-
|
|
470
|
-
## Post-Phase 10: What Comes Next
|
|
471
|
-
|
|
472
|
-
Phase 10 completes the framework adapter roadmap. Remaining phases focus on advanced features:
|
|
473
|
-
|
|
474
|
-
- **Phase 11**: Semantic search (HNSW) for repos with > 50k symbols
|
|
475
|
-
- **Phase 12**: Rate limiting and multi-tenant auth for hosted deployments
|
|
476
|
-
- **Phase 13**: Web UI for exploring the symbol graph visually
|