Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
9189197
Refactor GORM 7 to a stateless class-singleton architecture
borinquenkid Apr 24, 2026
cbe9ff0
Enhance GORM 7 stateless refactor and SimpleMap persistence
borinquenkid Apr 25, 2026
4ded696
Enhance GORM 7 stateless refactor and SimpleMap persistence
borinquenkid Apr 25, 2026
ce2ee99
Stabilize core AST transformations and stateless persistence for Groo…
borinquenkid Apr 25, 2026
efb19d7
Stabilize GORM 7 Core APIs and Transformations for Groovy 4 / Java 24
borinquenkid Apr 25, 2026
2c8f628
Core: Stabilize GORM 7 APIs and Transformations for Groovy 4 / Java 24
borinquenkid Apr 25, 2026
9bca19c
Hibernate 7: Stabilize module for GORM 7 stateless refactor
borinquenkid Apr 25, 2026
9d24707
Temp
borinquenkid Apr 26, 2026
14ddf99
Revert "Stabilize GORM 7 Core APIs and Transformations for Groovy 4 /…
borinquenkid Apr 26, 2026
a3e9640
Fixing Multitenancy
borinquenkid Apr 27, 2026
dea6fca
Refactor Simple Map datastore for stateless multi-tenancy and correct…
borinquenkid Apr 29, 2026
7978445
Cleanup debug logs and finalize Simple Map refactoring and transactio…
borinquenkid Apr 29, 2026
b0b4817
Fixed core
borinquenkid Apr 29, 2026
cc457dd
Fix Hibernate 7 multi-datasource entity registration and transaction …
borinquenkid Apr 30, 2026
efe79f1
Implement core SessionResolver infrastructure
borinquenkid Apr 30, 2026
218661b
Finalize SessionResolver integration in grails-datastore-core
borinquenkid Apr 30, 2026
2e3d437
Refactor GrailsSessionContext to use ServiceRegistry for Datastore re…
borinquenkid Apr 30, 2026
f0a1d53
Refactor DatastoreUtils to use idempotent bindSession
borinquenkid Apr 30, 2026
aa20bac
Stabilize Hibernate 7 implementation and fix multi-datasource routing
borinquenkid May 1, 2026
7335662
fix(hibernate7): resolve compilation blockers and document runtime fa…
borinquenkid May 1, 2026
5e36852
fix(h7): resolve multi-datasource routing and H7 session.contains() b…
borinquenkid May 2, 2026
eeb943d
fix(h7): fix all HibernateGormStaticApiSpec failures (68/68 pass)
borinquenkid May 2, 2026
bc249c1
fix(h7): fix HibernatePagedResultList type and lastUpdated with dynam…
borinquenkid May 2, 2026
d6df79a
fix(h7): return managed Hibernate instance from performMerge; handle …
borinquenkid May 2, 2026
5a389c8
fix(h7): fix withNewSession to open native Hibernate session before b…
borinquenkid May 2, 2026
5d4801d
docs: update ISSUES.md with H7 critical fixes and MongoDB migration g…
borinquenkid May 2, 2026
f0f9cfa
fix(h7): improve named parameter binding and fix ValidationException …
borinquenkid May 2, 2026
adc1ae2
Fix @Query named parameter binding in Data Services for H7 strict val…
borinquenkid May 2, 2026
e9c35ee
Fix H7 veto exceptions for deepValidate:false and insert() validation
borinquenkid May 2, 2026
c4b852b
fix(h7): resolve proxy routing and Instance API test failures
borinquenkid May 3, 2026
b784553
fix(h7): fix connection leak spec and nested session binding
borinquenkid May 3, 2026
1c0c74f
fix(h7): Achieve 100% test pass rate for Hibernate 7 module
borinquenkid May 3, 2026
715c003
chore: implement coordinated session management and stabilize Hiberna…
borinquenkid May 4, 2026
ec57e27
fix: resolve native SQL parameter binding and compilation errors in H…
borinquenkid May 4, 2026
1513d4f
more progress
borinquenkid May 5, 2026
12e2dfe
fix: SCHEMA multi-tenancy session routing for H7 child datastores
borinquenkid May 5, 2026
6fb0df3
clean up artifacts not needed
borinquenkid May 5, 2026
d353dbb
test(h7): add GormRegistryScalabilitySpec to verify O(M+N) memory gua…
borinquenkid May 5, 2026
c49f576
test(core): add GormRegistryScalabilitySpec to verify O(M+N) memory g…
borinquenkid May 5, 2026
3f2f903
docs: update ISSUES.md — H7 core 100% passing, document core regressions
borinquenkid May 5, 2026
391ed30
fix: repair GormEnhancer regressions from O(M+N) refactor
borinquenkid May 5, 2026
213ec97
fix(test): make GormRegistryScalabilitySpec parallel-safe
borinquenkid May 5, 2026
de3e887
docs: update ISSUES.md — all datamapping modules passing, pivot to H7…
borinquenkid May 5, 2026
abe7b40
docs+fix: consolidate ISSUES.md; fix MongoStaticApi missing Connectio…
borinquenkid May 6, 2026
3e62e44
fix(mongodb): fix 20 MongoDB core test failures (54 -> 34)
borinquenkid May 6, 2026
23b4696
fix(h7): fix GrailsHibernateTemplate and TransactionalTransform for D…
borinquenkid May 6, 2026
5778650
docs(h7): add Javadoc to GrailsHibernateTemplate.executeWithNewSession()
borinquenkid May 6, 2026
65065c3
docs: update ISSUES.md with GeoJSON investigation status
borinquenkid May 7, 2026
477da60
docs: update ISSUES.md with GeoJSON debug findings
borinquenkid May 7, 2026
20a910a
mongodb: - ✅ Fixed two codec issues (return statements and class mism…
borinquenkid May 7, 2026
ec23641
Fix MongoDB embedded collection updates and dirty collection detection
borinquenkid May 7, 2026
f9ef004
Update ISSUES.md with final test results - 553/560 passing (98.8%)
borinquenkid May 7, 2026
bca5084
Fix Mongo query/update regressions and DynamicFinder BuildableCriteri…
borinquenkid May 7, 2026
ee81ba3
Fix MongoDB versioning, dirty checking, and embedded update conflicts
borinquenkid May 8, 2026
fe2309c
UPdate ISSUES.md
borinquenkid May 9, 2026
41eb2d5
Fix H5 core compilation and port scalability tests to Mongo/H5
borinquenkid May 9, 2026
82f70ca
chore: update issue tracker for Hibernate5 core regressions
borinquenkid May 10, 2026
50fc211
Fix ListOrderBySpec: implement clearOrders in HibernateQuery for H5. …
borinquenkid May 10, 2026
3d89a39
Fix Hibernate 5 session state and GORM API regressions. Collaborator:…
borinquenkid May 10, 2026
80f394c
Stabilize Hibernate 5.6: fix multi-tenancy, manual IDs, and version i…
borinquenkid May 10, 2026
9ae6588
Fix DetachedCriteriaProjectionAliasSpec test failures
borinquenkid May 11, 2026
a4c6f75
Fix primitive ID insertion in performUpsert for Hibernate 5
borinquenkid May 11, 2026
f9c7b34
Fix WhereQueryWithAssociationSortSpec and ClosureEventTriggeringInter…
borinquenkid May 11, 2026
fb82932
Fix MultipleOneToOneSpec test failure
borinquenkid May 11, 2026
a60ea3b
Fix DeepValidationSpec by enabling deepValidate support in Grails 7 J…
borinquenkid May 11, 2026
b367f0b
Fix hib5 O(M+N)
borinquenkid May 11, 2026
feacb10
more fixes
borinquenkid May 12, 2026
125da63
1 Fix GormEnhancer to enforce TenantNotFoundException in SCHEMA mode
borinquenkid May 12, 2026
5362ab7
docs: Update ISSUES.md to reflect 100% pass rate for MongoDB sibling …
borinquenkid May 12, 2026
ac62d47
Update GrailsTestPlugin
borinquenkid May 12, 2026
a89cf9c
fix plugins
borinquenkid May 12, 2026
cf77d7d
RAT changes
borinquenkid May 12, 2026
15e52ea
Updated ISSUES.md to cover O(M+N) fixes and future improvements
borinquenkid May 12, 2026
c441625
Stabilize GORM and Hibernate test failures
borinquenkid May 13, 2026
dbc7279
Refactor GormEnhancer to singleton pattern for state management
borinquenkid May 13, 2026
a04b406
Remove unused NAMED_QUERIES and add GormEnhancerRegistry spec
borinquenkid May 13, 2026
d61355b
refactor: Consolidate GormEnhancer constructors to reduce redundancy
borinquenkid May 13, 2026
c7e2a1e
fix: H5 HibernateGormEnhancer must pass transactionManager to parent
borinquenkid May 13, 2026
78c6edf
Add factory specs for GormApiFactory and MongoGormApiFactory
borinquenkid May 13, 2026
5e0967e
Add getStaticApi override to MongoGormEnhancer to directly create Mon…
borinquenkid May 13, 2026
22baf31
Fix MongoDB persistence: Add flush to GormStaticApi.saveAll()
borinquenkid May 13, 2026
47e7f4c
Add MongoGormInstanceApi with auto-flush on save()
borinquenkid May 13, 2026
3a3d8de
Fix MongoGormInstanceApi: return result from super.save()
borinquenkid May 13, 2026
076a285
Fix MongoDB persistence: Use MongoGormInstanceApi in MongoDatastore
borinquenkid May 13, 2026
4215bc5
Add comprehensive test specs for transaction template factories and M…
borinquenkid May 13, 2026
55f4d45
MongoDB transaction rollback with factory-pattern gate and context-aw…
borinquenkid May 13, 2026
556134e
Fix jline dependency version in documentation configs
borinquenkid May 13, 2026
4dd91df
Tighten GormEnhancer constructor API
borinquenkid May 13, 2026
9154bff
Add precondition assertions to GormEnhancer constructor
borinquenkid May 13, 2026
4c09daf
Extract ConnectionSourceNameResolver class
borinquenkid May 13, 2026
94520d0
Fix jline:jline version in grails-console
borinquenkid May 13, 2026
d386cf0
Fix GormEnhancer constructor API and test compatibility
borinquenkid May 13, 2026
ed50c09
Add tests for GormRegistry entity registration methods
borinquenkid May 13, 2026
4d0e499
Fix Hibernate dependency resolution in grails-plugin and docs
borinquenkid May 13, 2026
c2903b6
Delegate constraint registration to GormRegistry
borinquenkid May 13, 2026
649e8b7
Fix entity registration to delegate orchestration while preserving en…
borinquenkid May 13, 2026
8de8bef
Fix Hibernate dependency resolution and registerConstraints override …
borinquenkid May 13, 2026
e91da2b
Refactor GormEnhancer.registerEntity to delegate to GormRegistry
borinquenkid May 13, 2026
ec526ac
Refactor to GormRegistry
borinquenkid May 14, 2026
f902807
Refactor GORM API resolution to registry factories
borinquenkid May 14, 2026
4947089
refactor: clean up Gorm enhancer registry ownership
borinquenkid May 14, 2026
df23e54
refactor: split GORM API registries
borinquenkid May 14, 2026
296c06b
refactor: move API lookup to registries
borinquenkid May 14, 2026
51de914
fix: call public API finder methods instead of resolver directly
borinquenkid May 14, 2026
2ffa76b
refactor: remove unused get*Api(String, String) overloads
borinquenkid May 14, 2026
348f94e
refactor: remove unused onlyExtendedMethods parameter
borinquenkid May 14, 2026
f13ddc0
refactor: remove unused empty enhance() method
borinquenkid May 14, 2026
63f2dcf
refactor: remove unused parameters and public wrapper from GormEnhancer
borinquenkid May 14, 2026
c6706a9
refactor: remove unused enhance(PersistentEntity) method
borinquenkid May 14, 2026
f5be3b4
refactor: remove unused enhance(PersistentEntity) method
borinquenkid May 15, 2026
0910ee8
Fix GormEnhancer constructor call in GrailsDataCoreTckManager
borinquenkid May 15, 2026
a394f4b
Fix GormEnhancer constructor calls in SimpleMapQuerySpec
borinquenkid May 15, 2026
e644e79
Fix registry factory resolution and qualifier API regressions
borinquenkid May 15, 2026
fd761db
Fix Hibernate 7 core regression specs
borinquenkid May 15, 2026
e6c94c5
refactor: remove unused enhance(PersistentEntity) method
borinquenkid May 15, 2026
4add87e
Codenarc and CodeStyle
borinquenkid May 15, 2026
e4711dc
Fix Hibernate test syntax regressions
borinquenkid May 15, 2026
262fa04
Fix date parsing error message expectations in databinding tests
borinquenkid May 16, 2026
1aeb045
Fix quoting issues and test compatibility updates
borinquenkid May 16, 2026
9c20b54
Add missing service initialization in H7 database-per-tenant test
borinquenkid May 16, 2026
c2ded8b
Ensure H7 database-per-tenant test matches H5 structure
borinquenkid May 16, 2026
4a5ebd9
Fix string quoting and test expectations in datamapping, databinding,…
borinquenkid May 16, 2026
38d2a66
Fix string quoting issues in HTMLCodecTests
borinquenkid May 16, 2026
a4f2a19
Fix string quoting issues in converters and core test specs
borinquenkid May 16, 2026
5732d19
Fix HTMLCodecTests string quoting and test data
borinquenkid May 16, 2026
ac00bb7
Fix string quoting issues in validation and converters test specs
borinquenkid May 16, 2026
a85fda2
Groovy compilation issues
borinquenkid May 16, 2026
5fd2a67
Expand testing for Gorm Api Registries
borinquenkid May 16, 2026
da14cbb
Optimize registry lookup paths
borinquenkid May 16, 2026
3d0778f
Benchmark lock contention patterns in registry paths
borinquenkid May 16, 2026
d0b1c39
Refactor JpaCriteriaQueryCreator to inject and reuse PredicateGenerator
borinquenkid May 17, 2026
3f9cce9
Update ISSUES.md with Neo4j O(M+N) migration plan and B.2 strategy
borinquenkid May 17, 2026
3917e0e
Implement O(M+N) scaling refactor and performance documentation
borinquenkid May 17, 2026
1a94471
Optimize GORM Core lookup performance and API resolution for O(M+N) s…
borinquenkid May 17, 2026
0077700
Fix regression in GormRegistry and GormApiResolver
borinquenkid May 17, 2026
f2b94b7
Fix core GORM qualifier and tenant regressions
borinquenkid May 18, 2026
6565376
Stabilize GORM core datastore resolution
borinquenkid May 18, 2026
58e741d
mongo module and simple module has been updated to align with the cor…
borinquenkid May 19, 2026
dbe6a48
update ISSUES.md for H7
borinquenkid May 19, 2026
efb4bb2
broken test compilation
borinquenkid May 20, 2026
a83c477
codenarc and codestyle
borinquenkid May 20, 2026
a6b0098
RAT fix
borinquenkid May 20, 2026
9652d99
refactor: restore architectural core to pre-corruption state
borinquenkid May 21, 2026
69693f5
fix: update AsyncEntity, DefaultJsonViewHelper, and DynamicElementRea…
borinquenkid May 21, 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