feat(semantic): curator-driven protocol hardening — decision memory + relation repair

- Add @RATIONALE/@REJECTED to 103+ C4/C5 contracts across backend core, services, API routes, and frontend models
- Fix 109 unresolved @RELATION edges (Auth.*, SupersetClient.*, AgentChat.*, ADR cross-refs)
- Add 13 @ingroup tags for DSA/HCA attention grouping
- Repair 29 stale graph edges via index rebuild
- Update .kilo agent prompts and skills for GRACE-Poly v2.6 compliance
- Git integration: merge routes, branch lifecycle, remote providers, UX components
- 0 broken anchor pairs, index rebuilt with 0 parse warnings
This commit is contained in:
2026-07-02 08:53:19 +03:00
parent 64564da988
commit 8c10632494
144 changed files with 10111 additions and 762 deletions

View File

@@ -0,0 +1,86 @@
# Semantic Curation Report — 2026-07-01
## Summary
- **Unresolved relations**: 359 → **330** (reduced by 29)
- **Audit unresolved severity**: 440 → **402** (reduced by 38)
- **Index**: Fresh, rebuilt with 0 parse warnings
- **Contracts**: 6006 | **Relations**: 3014 | **Orphans**: 1950
## Files Modified (10 files, 36 relation fixes)
### Priority Files (7 of 7 completed)
1. **`backend/src/api/auth.py`** — 6 fixes
- `Auth.Service``auth_service` (module contract in `services/auth_service.py`)
- `Auth.OAuth``AuthOauthModule` (module contract in `core/auth/oauth.py`)
- `Auth.Dependency.GetCurrentUser``get_current_user` (function in `dependencies.py`)
2. **`backend/src/agent/_persistence.py`** — 1 fix
- `Api.Agent.Conversations``AgentChat.Api.Conversations`
3. **`backend/src/agent/middleware.py`** — 2 fixes
- `Models.AssistantAuditRecord``AssistantAuditRecord`
- `Api.Assistant.Audit``get_assistant_audit`
4. **`backend/src/agent/_confirmation.py`** — Note: `AgentChat.Tools` IS a valid contract but not resolved by DuckDB index (pre-existing blind spot)
5. **`backend/src/agent/_tool_resolver.py`** — same as #4
6. **`backend/src/agent/langgraph_setup.py`** — same as #4
7. **`backend/src/api/routes/agent_superset.py`** — 7 fixes
- `SupersetDashboardsWriteMixin.create_dashboard``create_dashboard`
- `SupersetDashboardsWriteMixin.copy_dashboard``copy_dashboard`
- `SupersetDashboardsWriteMixin.update_dashboard``update_dashboard`
- `SupersetClient.CreateDataset``SupersetClientCreateDataset`
- `SupersetClient.DeleteDataset``SupersetClientDeleteDataset`
- `SupersetClient.DuplicateDataset``SupersetClientDuplicateDataset`
- `SupersetClient.RefreshDatasetSchema``SupersetClientRefreshDatasetSchema`
### Additional Files Fixed
8. **`backend/src/core/auth/jwt.py`** — 5 fixes
- `Auth.Config``AuthConfigModule`
- `Auth.TokenBlacklist``TokenBlacklist`
- `Auth.Jwt.HashToken``Auth.Jwt._HashToken`
9. **`backend/src/api/routes/agent_superset_explore.py`** — 9 fixes
- `SupersetDatabasesMixin.*``SupersetClientGetDatabaseSchemas`/`DatabaseTables`/`GetTableMetadata`/etc.
- `SupersetAuditMixin.permissions_audit``SupersetAudit.PermissionsAudit`
- `SupersetSavedQueriesMixin.*``SupersetSavedQueries.List`/`Get`
10. **`backend/src/services/auth_service.py`** — 2 fixes
- `create_access_token``Auth.Jwt.CreateAccessToken`
11. **`backend/src/dependencies.py`** — 1 fix
- `is_token_blacklisted``Auth.Jwt.IsTokenBlacklisted`
12. **`backend/src/app.py`** — 2 fixes
- `AuthApi``Api.Auth`
- `AuthJwtModule``Auth.Jwt`
13. **`backend/src/core/superset_client/_sql_lab.py`** — 1 fix
- `SupersetClientBase._fetch_all_pages``SupersetClientFetchAllPages`
## Patterns Fixed
| Pattern | Count | Resolution |
|---------|-------|------------|
| `Auth.*` → wrong scope | 9 | Pointed to actual contract ID (`auth_service`, `AuthOauthModule`, `AuthConfigModule`, `TokenBlacklist`, `get_current_user`) |
| `Superset*Mixin.*` → wrong scope | 8 | Pointed to actual function-level contract IDs |
| `Api.Agent.*` → wrong ID | 1 | `AgentChat.Api.Conversations` |
| `Models.` prefix → missing prefix | 1 | Dropped `Models.` prefix (`AssistantAuditRecord`) |
| `Api.Assistant.Audit` → no contract | 1 | `get_assistant_audit` |
| Auth shorthand → full contract | 3 | `AuthApi``Api.Auth`, `AuthJwtModule``Auth.Jwt`, `create_access_token``Auth.Jwt.CreateAccessToken` |
## Remaining Debt (330 unresolved relations)
1. **`AgentChat.Tools`** — valid contract not indexing (DuckDB blind spot). Affects 3 source relations + 2 test BINDS_TO.
2. **Test BINDS_TO references** (~40+) — tests reference contracts that don't exist or have different names
3. **ADR cross-references** (~30) — ADR files use `:ADR` suffix which doesn't match actual IDs
4. **ValidationTaskService/SchedulerService** (~12) — code exists but has no GRACE contracts
5. **`APIClient`, `Core.ConnectionService`, `AsyncAPIClient`** — external/utility references
6. **`Models.User`, `Models.*`** — model contracts with wrong scope prefix
## Escalations
None required. All 7 priority files processed. 36 relation fixes applied across 10 files. Index rebuilt with 0 warnings.