Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
689d6f4
Refactor GORM 7 to a stateless class-singleton architecture
borinquenkid Apr 24, 2026
88f33ae
Enhance GORM 7 stateless refactor and SimpleMap persistence
borinquenkid Apr 25, 2026
98340fa
Enhance GORM 7 stateless refactor and SimpleMap persistence
borinquenkid Apr 25, 2026
b0730c9
Stabilize core AST transformations and stateless persistence for Groo…
borinquenkid Apr 25, 2026
c4acdbe
Stabilize GORM 7 Core APIs and Transformations for Groovy 4 / Java 24
borinquenkid Apr 25, 2026
75ae380
Core: Stabilize GORM 7 APIs and Transformations for Groovy 4 / Java 24
borinquenkid Apr 25, 2026
2820066
Hibernate 7: Stabilize module for GORM 7 stateless refactor
borinquenkid Apr 25, 2026
a06e77e
Temp
borinquenkid Apr 26, 2026
77fd547
Revert "Stabilize GORM 7 Core APIs and Transformations for Groovy 4 /…
borinquenkid Apr 26, 2026
ff3a2df
Fixing Multitenancy
borinquenkid Apr 27, 2026
3a3736c
Refactor Simple Map datastore for stateless multi-tenancy and correct…
borinquenkid Apr 29, 2026
e0e36a7
Cleanup debug logs and finalize Simple Map refactoring and transactio…
borinquenkid Apr 29, 2026
e3ac267
Fixed core
borinquenkid Apr 29, 2026
32f3837
Fix Hibernate 7 multi-datasource entity registration and transaction …
borinquenkid Apr 30, 2026
f59776c
Implement core SessionResolver infrastructure
borinquenkid Apr 30, 2026
588c22a
Finalize SessionResolver integration in grails-datastore-core
borinquenkid Apr 30, 2026
c13548a
Refactor GrailsSessionContext to use ServiceRegistry for Datastore re…
borinquenkid Apr 30, 2026
a582a77
Refactor DatastoreUtils to use idempotent bindSession
borinquenkid Apr 30, 2026
11ade93
Stabilize Hibernate 7 implementation and fix multi-datasource routing
borinquenkid May 1, 2026
216983e
fix(hibernate7): resolve compilation blockers and document runtime fa…
borinquenkid May 1, 2026
af30a8b
fix(h7): resolve multi-datasource routing and H7 session.contains() b…
borinquenkid May 2, 2026
3ffbbba
fix(h7): fix all HibernateGormStaticApiSpec failures (68/68 pass)
borinquenkid May 2, 2026
a685d07
fix(h7): fix HibernatePagedResultList type and lastUpdated with dynam…
borinquenkid May 2, 2026
35d0cdd
fix(h7): return managed Hibernate instance from performMerge; handle …
borinquenkid May 2, 2026
a4b6a26
fix(h7): fix withNewSession to open native Hibernate session before b…
borinquenkid May 2, 2026
a7539bc
docs: update ISSUES.md with H7 critical fixes and MongoDB migration g…
borinquenkid May 2, 2026
2a4fe25
fix(h7): improve named parameter binding and fix ValidationException …
borinquenkid May 2, 2026
bc94253
Fix @Query named parameter binding in Data Services for H7 strict val…
borinquenkid May 2, 2026
475b96c
Fix H7 veto exceptions for deepValidate:false and insert() validation
borinquenkid May 2, 2026
ca71889
fix(h7): resolve proxy routing and Instance API test failures
borinquenkid May 3, 2026
cc1c713
fix(h7): fix connection leak spec and nested session binding
borinquenkid May 3, 2026
099fb9d
fix(h7): Achieve 100% test pass rate for Hibernate 7 module
borinquenkid May 3, 2026
2b2cd20
chore: implement coordinated session management and stabilize Hiberna…
borinquenkid May 4, 2026
a93bffe
fix: resolve native SQL parameter binding and compilation errors in H…
borinquenkid May 4, 2026
3ee7bf7
more progress
borinquenkid May 5, 2026
2045336
fix: SCHEMA multi-tenancy session routing for H7 child datastores
borinquenkid May 5, 2026
3d9c30b
clean up artifacts not needed
borinquenkid May 5, 2026
1ddb603
test(h7): add GormRegistryScalabilitySpec to verify O(M+N) memory gua…
borinquenkid May 5, 2026
1be3415
test(core): add GormRegistryScalabilitySpec to verify O(M+N) memory g…
borinquenkid May 5, 2026
63cfe6b
docs: update ISSUES.md — H7 core 100% passing, document core regressions
borinquenkid May 5, 2026
89def8b
fix: repair GormEnhancer regressions from O(M+N) refactor
borinquenkid May 5, 2026
02d9cb7
fix(test): make GormRegistryScalabilitySpec parallel-safe
borinquenkid May 5, 2026
b6a9340
docs: update ISSUES.md — all datamapping modules passing, pivot to H7…
borinquenkid May 5, 2026
33a70b9
docs+fix: consolidate ISSUES.md; fix MongoStaticApi missing Connectio…
borinquenkid May 6, 2026
bcdeb94
fix(mongodb): fix 20 MongoDB core test failures (54 -> 34)
borinquenkid May 6, 2026
c9c5a72
fix(h7): fix GrailsHibernateTemplate and TransactionalTransform for D…
borinquenkid May 6, 2026
717a0ea
docs(h7): add Javadoc to GrailsHibernateTemplate.executeWithNewSession()
borinquenkid May 6, 2026
b83e3e3
docs: update ISSUES.md with GeoJSON investigation status
borinquenkid May 7, 2026
5a66efc
docs: update ISSUES.md with GeoJSON debug findings
borinquenkid May 7, 2026
21ba724
mongodb: - ✅ Fixed two codec issues (return statements and class mism…
borinquenkid May 7, 2026
657bf74
Fix MongoDB embedded collection updates and dirty collection detection
borinquenkid May 7, 2026
78aaac8
Update ISSUES.md with final test results - 553/560 passing (98.8%)
borinquenkid May 7, 2026
4ccbb4d
Fix Mongo query/update regressions and DynamicFinder BuildableCriteri…
borinquenkid May 7, 2026
3637f56
Fix MongoDB versioning, dirty checking, and embedded update conflicts
borinquenkid May 8, 2026
68bfd37
UPdate ISSUES.md
borinquenkid May 9, 2026
b92af98
Fix H5 core compilation and port scalability tests to Mongo/H5
borinquenkid May 9, 2026
62c4dee
chore: update issue tracker for Hibernate5 core regressions
borinquenkid May 10, 2026
43397a9
Fix ListOrderBySpec: implement clearOrders in HibernateQuery for H5. …
borinquenkid May 10, 2026
5b8c6ba
Fix Hibernate 5 session state and GORM API regressions. Collaborator:…
borinquenkid May 10, 2026
a1ec82a
Stabilize Hibernate 5.6: fix multi-tenancy, manual IDs, and version i…
borinquenkid May 10, 2026
1235baf
Fix DetachedCriteriaProjectionAliasSpec test failures
borinquenkid May 11, 2026
36faaee
Fix primitive ID insertion in performUpsert for Hibernate 5
borinquenkid May 11, 2026
505d90a
Fix WhereQueryWithAssociationSortSpec and ClosureEventTriggeringInter…
borinquenkid May 11, 2026
e13355d
Fix MultipleOneToOneSpec test failure
borinquenkid May 11, 2026
2ea64a2
Fix DeepValidationSpec by enabling deepValidate support in Grails 7 J…
borinquenkid May 11, 2026
89b5d58
Fix hib5 O(M+N)
borinquenkid May 11, 2026
7e1196d
more fixes
borinquenkid May 12, 2026
3993c67
1 Fix GormEnhancer to enforce TenantNotFoundException in SCHEMA mode
borinquenkid May 12, 2026
5fb8952
docs: Update ISSUES.md to reflect 100% pass rate for MongoDB sibling …
borinquenkid May 12, 2026
24a87de
Update GrailsTestPlugin
borinquenkid May 12, 2026
01149ed
fix plugins
borinquenkid May 12, 2026
01cd412
RAT changes
borinquenkid May 12, 2026
6f66842
Merge branch '8.0.x-hibernate7' into 8.0.x-hibernate7.gorm-scaling an…
borinquenkid May 12, 2026
d1efb91
Updated ISSUES.md to cover O(M+N) fixes and future improvements
borinquenkid May 12, 2026
8632318
Stabilize GORM and Hibernate test failures
borinquenkid May 13, 2026
ab679e1
Refactor GormEnhancer to singleton pattern for state management
borinquenkid May 13, 2026
cf1d155
Remove unused NAMED_QUERIES and add GormEnhancerRegistry spec
borinquenkid May 13, 2026
358e41e
refactor: Consolidate GormEnhancer constructors to reduce redundancy
borinquenkid May 13, 2026
02d25c9
fix: H5 HibernateGormEnhancer must pass transactionManager to parent
borinquenkid May 13, 2026
c7af18c
Add factory specs for GormApiFactory and MongoGormApiFactory
borinquenkid May 13, 2026
2c855c8
Add getStaticApi override to MongoGormEnhancer to directly create Mon…
borinquenkid May 13, 2026
8ae5e8d
Fix MongoDB persistence: Add flush to GormStaticApi.saveAll()
borinquenkid May 13, 2026
4f8b05b
Add MongoGormInstanceApi with auto-flush on save()
borinquenkid May 13, 2026
21aeec0
Fix MongoGormInstanceApi: return result from super.save()
borinquenkid May 13, 2026
f63c9f2
Fix MongoDB persistence: Use MongoGormInstanceApi in MongoDatastore
borinquenkid May 13, 2026
0c0e16e
Add comprehensive test specs for transaction template factories and M…
borinquenkid May 13, 2026
9297976
MongoDB transaction rollback with factory-pattern gate and context-aw…
borinquenkid May 13, 2026
1be49d8
Fix jline dependency version in documentation configs
borinquenkid May 13, 2026
0218d11
Tighten GormEnhancer constructor API
borinquenkid May 13, 2026
81adbaf
Add precondition assertions to GormEnhancer constructor
borinquenkid May 13, 2026
aa5a5f3
Extract ConnectionSourceNameResolver class
borinquenkid May 13, 2026
912d202
Fix jline:jline version in grails-console
borinquenkid May 13, 2026
8998d72
Fix GormEnhancer constructor API and test compatibility
borinquenkid May 13, 2026
0dc115e
Add tests for GormRegistry entity registration methods
borinquenkid May 13, 2026
e1c8f76
Fix Hibernate dependency resolution in grails-plugin and docs
borinquenkid May 13, 2026
f3d99dc
Delegate constraint registration to GormRegistry
borinquenkid May 13, 2026
34f7b9c
Fix entity registration to delegate orchestration while preserving en…
borinquenkid May 13, 2026
4f157e3
Fix Hibernate dependency resolution and registerConstraints override …
borinquenkid May 13, 2026
6bbaef2
Refactor GormEnhancer.registerEntity to delegate to GormRegistry
borinquenkid May 13, 2026
883906a
Refactor to GormRegistry
borinquenkid May 14, 2026
68afa58
Refactor GORM API resolution to registry factories
borinquenkid May 14, 2026
acf9de2
Merge remote-tracking branch 'origin/8.0.x-hibernate7' into 8.0.x-hib…
borinquenkid May 14, 2026
88174ef
compile error
borinquenkid May 14, 2026
225377f
refactor: clean up Gorm enhancer registry ownership
borinquenkid May 14, 2026
cb608f4
refactor: split GORM API registries
borinquenkid May 14, 2026
1f43b5c
refactor: move API lookup to registries
borinquenkid May 14, 2026
2d57504
fix: call public API finder methods instead of resolver directly
borinquenkid May 14, 2026
a391700
refactor: remove unused get*Api(String, String) overloads
borinquenkid May 14, 2026
eba68bd
refactor: remove unused onlyExtendedMethods parameter
borinquenkid May 14, 2026
2025bc1
refactor: remove unused empty enhance() method
borinquenkid May 14, 2026
49a596e
refactor: remove unused parameters and public wrapper from GormEnhancer
borinquenkid May 14, 2026
6ebd81c
refactor: remove unused enhance(PersistentEntity) method
borinquenkid May 14, 2026
229b919
refactor: remove unused enhance(PersistentEntity) method
borinquenkid May 15, 2026
4f5e4c9
Merge branch '8.0.x-hibernate7' into 8.0.x-hibernate7.gorm-scaling
borinquenkid May 15, 2026
73658df
Fix GormEnhancer constructor call in GrailsDataCoreTckManager
borinquenkid May 15, 2026
d9bd4eb
Fix GormEnhancer constructor calls in SimpleMapQuerySpec
borinquenkid May 15, 2026
4a43ad6
Fix registry factory resolution and qualifier API regressions
borinquenkid May 15, 2026
b65d48a
Fix Hibernate 7 core regression specs
borinquenkid May 15, 2026
a8dd84c
refactor: remove unused enhance(PersistentEntity) method
borinquenkid May 15, 2026
184081c
Codenarc and CodeStyle
borinquenkid May 15, 2026
7baeeab
Fix Hibernate test syntax regressions
borinquenkid May 15, 2026
1c6d98a
Move code-style violation reports to build/reports/style-violations/
borinquenkid May 16, 2026
f59eb0d
Fix date parsing error message expectations in databinding tests
borinquenkid May 16, 2026
807ad17
Fix quoting issues and test compatibility updates
borinquenkid May 16, 2026
15880d5
Add missing service initialization in H7 database-per-tenant test
borinquenkid May 16, 2026
5ef85eb
Ensure H7 database-per-tenant test matches H5 structure
borinquenkid May 16, 2026
5ebce9f
Fix string quoting and test expectations in datamapping, databinding,…
borinquenkid May 16, 2026
38bc25c
Fix string quoting issues in HTMLCodecTests
borinquenkid May 16, 2026
383a9d5
Fix string quoting issues in converters and core test specs
borinquenkid May 16, 2026
f4c84d6
Fix HTMLCodecTests string quoting and test data
borinquenkid May 16, 2026
6602d74
Fix string quoting issues in validation and converters test specs
borinquenkid May 16, 2026
1702b40
Groovy compilation issues
borinquenkid May 16, 2026
f505c63
Expand testing for Gorm Api Registries
borinquenkid May 16, 2026
0dc41f5
Optimize registry lookup paths
borinquenkid May 16, 2026
052293a
Benchmark lock contention patterns in registry paths
borinquenkid May 16, 2026
29bb3f4
Refactor JpaCriteriaQueryCreator to inject and reuse PredicateGenerator
borinquenkid May 17, 2026
af6539f
Update ISSUES.md with Neo4j O(M+N) migration plan and B.2 strategy
borinquenkid May 17, 2026
d9a072c
Implement O(M+N) scaling refactor and performance documentation
borinquenkid May 17, 2026
dec1556
Optimize GORM Core lookup performance and API resolution for O(M+N) s…
borinquenkid May 17, 2026
ef10061
Merge remote-tracking branch 'origin/8.0.x-hibernate7' into 8.0.x-hib…
borinquenkid May 17, 2026
12b194f
Fix regression in GormRegistry and GormApiResolver
borinquenkid May 17, 2026
c112923
Fix core GORM qualifier and tenant regressions
borinquenkid May 18, 2026
e2a9f92
Stabilize GORM core datastore resolution
borinquenkid May 18, 2026
268f18c
mongo module and simple module has been updated to align with the cor…
borinquenkid May 19, 2026
4189d55
update ISSUES.md for H7
borinquenkid May 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
266 changes: 266 additions & 0 deletions .agents/skills/repowise/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,266 @@
---
name: repowise
description: Guide for running, interpreting, and fixing code style violations in grails-core using GrailsCodeStylePlugin — covering CodeNarc, Checkstyle, PMD, SpotBugs, and Spotless
license: Apache-2.0
---

<!-- Add your custom instructions below. Repowise will never modify anything outside the REPOWISE markers. -->
<!-- Examples: coding style rules, test commands, workflow preferences, constraints -->

## Repository Configuration
- **Avoid repo pollution**: Do not commit local AI tooling files.
- **Do not generate CLAUDE.md**: Use `repowise init --no-claude-md` or set `editor_files.claude_md: false` in config.
- **Personal installation only**: Configure Repowise/MCP settings in your personal global environment (`~/.claude/` or `~/Library/Application Support/Claude/`), not in the repository root (e.g., avoid `.mcp.json` at root).
- **Git ignore**: Always keep `.repowise/` in `.gitignore`.


<!-- REPOWISE:START — Do not edit below this line. Auto-generated by Repowise. -->
## IMPORTANT: Codebase Intelligence Instructions for grails-core

> This repository is indexed by [Repowise](https://repowise.dev).
> Use the MCP tools below for orientation, discovery, and enriched context
> (documentation, ownership, history, decisions). **Always verify against
> actual source files before making changes** — the index may be stale.

Last indexed: 2026-05-16 (commit 052293a95a)
### Entry Points
- `grails-test-examples/gsp-spring-boot/app/src/main/java/hello/Application.java`
- `grails-forge/grails-forge-analytics-postgres/src/main/java/org/grails/forge/analytics/postgres/Application.java`
- `grails-forge/grails-forge-analytics-postgres/src/main/java/org/grails/forge/analytics/postgres/Main.java`
- `grails-forge/grails-forge-cli/src/main/java/org/grails/forge/cli/Application.java`
- `grails-forge/grails-forge-web-netty/src/main/java/org/grails/forge/netty/Application.java`
- `grails-wrapper/src/main/java/grails/init/Start.java`
### Tech Stack
**Languages:** Java, Python
**Frameworks:** Pydantic

**Infra:** Gradle### Hotspots (High Churn)
| File | Churn | 90d Commits | Owner |
|------|-------|-------------|-------|
| `grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/query/PredicateGenerator.java` | 99.9th %ile | 47 | Walter Duque de Estrada |
| `grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/HibernateDatastore.java` | 99.9th %ile | 46 | Walter Duque de Estrada |
| `grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/query/HibernateHqlQuery.java` | 99.8th %ile | 26 | Walter Duque de Estrada |
| `grails-data-hibernate7/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/secondpass/CollectionSecondPassBinder.java` | 99.8th %ile | 62 | Walter Duque de Estrada |
| `grails-data-hibernate7/core/src/main/groovy/grails/orm/CriteriaMethodInvoker.java` | 99.7th %ile | 27 | Walter Duque de Estrada |

### Repowise MCP Tools

This project has a Repowise MCP server configured. These tools provide documentation, ownership, architectural decisions, and risk signals. Use them for orientation and discovery — then read actual source to verify before editing.

**Recommended workflow:**

1. Start with `get_overview()` on a new task to orient yourself.
2. Call `get_context(targets=["path/to/file.py"])` for enriched context on unfamiliar files — but always read the source before editing.
3. Call `get_risk(targets=["path/to/file.py"])` before changing hotspot files.
4. Don't know where something lives? Call `search_codebase(query="authentication flow")`.
5. Need to understand why code is structured a certain way? Call `get_why(query="why JWT over sessions")` before architectural changes.
6. After **architectural changes**, consider calling `update_decision_records(action="create", ...)` to record the rationale.
7. Need to understand how two modules connect? Call `get_dependency_path(source="src/auth", target="src/db")`.
8. Before cleanup tasks, call `get_dead_code()` to find confirmed unused code.
9. For documentation or diagrams, call `get_architecture_diagram(scope="src/auth")`.

**Note:** MCP tool responses reflect the last index run. If the index is stale, verify against source files.

| Tool | When to use |
|------|-------------|
| `get_overview()` | Orient yourself on a new task |
| `get_context(targets=[...])` | Enriched context on unfamiliar files |
| `get_risk(targets=[...])` | Before changing hotspot files |
| `get_why(query="...")` | Before architectural changes |
| `update_decision_records(action=...)` | After architectural changes — record decisions |
| `search_codebase(query="...")` | When locating code |
| `get_dependency_path(source=..., target=...)` | When tracing module connections |
| `get_dead_code()` | Before any cleanup or removal |
| `get_architecture_diagram(scope=...)` | For visual structure or documentation |

## Tool Overview

| Tool | Purpose | Typical use |
|------|---------|-------------|
| `get_overview` | Architecture summary | First call on any unfamiliar codebase |
| `get_answer` | One-call RAG Q&A | First call on any code question |
| `get_context` | Rich context for targets | Before reading or modifying code |
| `search_codebase` | Semantic search | Discovering code by topic |
| `get_risk` | Modification risk | Before changing hotspot files |
| `get_why` | Architectural decisions | Before structural changes |
| `get_dead_code` | Unreachable code | Cleanup tasks |

---

## `get_overview`

Architecture summary, module map, entry points, git health, and community summary.

**Parameters:** None required.

| Parameter | Type | Description |
|-----------|------|-------------|
| `repo` | string | *(workspace only)* Target repo alias, or `"all"` |

**Returns:** Architecture description, key modules with purpose and owner, entry points, tech stack, hotspot files, knowledge silos, community summary (top communities by size with labels and cohesion scores).

**When to use:** First call on any unfamiliar codebase. Gives the agent a mental map before diving into specifics.

**Example call:**

```
get_overview()
```

---

## `get_answer`

One-call RAG: retrieves over the wiki, gates synthesis on confidence, and returns a cited 2–5 sentence answer.

**Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `question` | string | Yes | Natural language question about the codebase |
| `repo` | string | No | *(workspace only)* Target repo alias |

**Returns:** A synthesized answer with file/symbol citations and a confidence label (`high`, `medium`, `low`). High-confidence answers can be cited directly. Low-confidence answers return ranked wiki excerpts instead.

**When to use:** First call on any code question. Collapses search → read → reason into one round-trip. If confidence is low, follow up with `search_codebase` to discover candidate pages.

**Example call:**

```
get_answer(question="How does the authentication flow work?")
```

---

## `get_context`

The workhorse tool. Returns docs, symbols, ownership, freshness, and community membership for any combination of files, modules, or symbols.

**Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `targets` | list[string] | Yes | File paths, module names, or symbol IDs. Batch multiple targets in one call. |
| `include` | list[string] | No | Additional data to include: `"source"` (symbol body), `"callers"` (who calls this), `"callees"` (what this calls), `"metrics"` (PageRank, centrality), `"community"` (cluster membership) |
| `compact` | boolean | No | Default `true`. Set `false` for full structure block and importer list. |
| `repo` | string | No | *(workspace only)* Target repo alias, or `"all"` |

**Returns per target:** Documentation summary, symbols defined, ownership percentages, freshness score, co-change partners, architectural decisions governing the file. With `include` options: source code, call graph, graph metrics, community membership.

**When to use:** Before reading or modifying code. Pass all relevant targets in one call to minimize round-trips. In workspace mode, enriched with cross-repo co-change and contract data.

**Example calls:**

```
get_context(targets=["src/auth/middleware.ts"])
get_context(targets=["middleware", "api/routes", "payments"], include=["callers", "metrics"])
get_context(targets=["src/auth"], compact=false, include=["community"])
```

---

## `search_codebase`

Semantic search over the full wiki. Natural language queries.

**Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `query` | string | Yes | Natural language search query |
| `repo` | string | No | *(workspace only)* Target repo alias, or `"all"` to search across workspace |

**Returns:** Ranked wiki pages with relevance scores, snippets, and file paths.

**When to use:** When `get_answer` returned low confidence and you need to discover candidate pages by topic. Also useful for broad exploration ("how do we handle retries?", "payment processing flow").

In workspace mode, searches across all repos and merges results.

**Example call:**

```
search_codebase(query="rate limit OR throttle OR retry")
```

---

## `get_risk`

Modification risk assessment for files or a set of changed files.

**Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `targets` | list[string] | No | File paths to assess |
| `changed_files` | list[string] | No | Files in a PR/changeset for blast radius analysis |
| `repo` | string | No | *(workspace only)* Target repo alias |

**Returns:** Per-file risk score (0–10), hotspot status, dependent count, co-change partners, blast radius, recommended reviewers, test gap analysis, security signals. In workspace mode, enriched with cross-repo co-change partners and contract dependencies.

**When to use:** Before modifying files — especially hotspots. Understand what could break, who to involve in review, and whether tests cover the affected area.

**Example calls:**

```
get_risk(targets=["src/auth/middleware.ts"])
get_risk(changed_files=["src/api/routes.ts", "src/middleware/cors.ts"])
```

---

## `get_why`

Architectural decision intelligence. Three modes depending on parameters.

**Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `query` | string | No | Natural language query about decisions, OR a file path |
| `repo` | string | No | *(workspace only)* Target repo alias |

**Modes:**

1. **NL search** — pass a question: `get_why(query="why JWT over sessions?")` → searches decision records
2. **Path-based** — pass a file path: `get_why(query="src/auth/service.ts")` → returns decisions governing that file
3. **Health dashboard** — no args: `get_why()` → stale decisions, conflicts, ungoverned hotspots

**Returns:** Matching decision records with title, rationale, alternatives considered, affected files, staleness score. Health mode returns stale decisions, conflicts, and ungoverned hotspots.

**When to use:** Before architectural changes — understand existing intent and constraints. After changes — record new decisions.

**Example calls:**

```
get_why(query="rate limiting")
get_why(query="src/payments/processor.ts")
get_why()
```

---

## `get_dead_code`

Unreachable code sorted by confidence tier with cleanup impact estimates.

**Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `min_confidence` | float | No | Minimum confidence threshold (default: 0.4) |
| `include_internals` | boolean | No | Include private/underscore symbols (default: false) |
| `repo` | string | No | *(workspace only)* Target repo alias |

**Returns:** Dead code findings grouped by confidence tier (`safe_to_delete` ≥ 0.70, `review_first` < 0.70). Each finding includes: file path, kind (unreachable_file, unused_export, unused_internal, zombie_package), confidence score, line count, and cleanup impact estimate.

**When to use:** Cleanup tasks. Conservative by design — `safe_to_delete` excludes dynamically-loaded patterns and framework-decorated functions.

**Example calls:**

```
get_dead_code()
get_dead_code(min_confidence=0.8, include_internals=true)
```

<!-- REPOWISE:END -->
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ tmp/
!etc/bin
etc/bin/results
.vscode/
.repowise/
/scratch/
/local.properties
local-tasks.gradle
Expand Down
Loading
Loading