Copy architecture docs, ADRs, storage domain specs, research, reviews, and 56 storage architecture tasks from the alkhub_ts monorepo. Adapt for standalone @alkdev/hub repo structure (src/ not packages/hub/). Sanitize all sensitive information: - Replace private IPs (10.0.0.1) with localhost defaults - Remove internal server hostnames (dev1, ns528096) - Replace /workspace/ private paths with npm package references - Remove hardcoded credentials from examples - Rewrite infrastructure.md without private network details Add Deno project scaffolding: deno.json (pinned deps), .gitignore, AGENTS.md, entry point. Migrate existing code stubs (crypto, config types, logger) with updated import paths.
42 lines
1.4 KiB
Markdown
42 lines
1.4 KiB
Markdown
---
|
|
id: add-missing-indexes-sessions
|
|
name: Add Missing Indexes — Sessions & Coordination Domain
|
|
status: completed
|
|
depends_on: []
|
|
scope: narrow
|
|
risk: low
|
|
impact: component
|
|
level: implementation
|
|
---
|
|
|
|
## Description
|
|
|
|
W03 (partial): Add missing indexes for sessions and coordination domain tables.
|
|
|
|
Missing indexes:
|
|
- `sessions`: `unq_sessions_slug` — UNIQUE constraint on `slug` not listed (unlike other UNIQUEs)
|
|
- `sessions`: `idx_sessions_parent_id` on `(parentId)` — find child sessions of coordinator
|
|
- `detections`: `idx_detections_session_id` on `(sessionId)` — find detections for a session (table currently has no indexes at all)
|
|
- `mappings`: `idx_mappings_workspace_id` on `(workspaceId)` — workspace-scoped mapping queries
|
|
|
|
## Acceptance Criteria
|
|
|
|
- [ ] `table-reference.md` indexes section includes `unq_sessions_slug`, `idx_sessions_parent_id`, `idx_detections_session_id`, `idx_mappings_workspace_id`
|
|
- [ ] Per-domain docs (`sessions.md`, `coordination.md`) reference the new indexes
|
|
- [ ] `detections` table now has at least one index documented
|
|
- [ ] All new indexes have documented purpose (query pattern)
|
|
|
|
## References
|
|
|
|
- docs/reviews/storage-architecture-review-2026-04-21.md#W03
|
|
- docs/architecture/storage/table-reference.md:87-145
|
|
- docs/architecture/storage/sessions.md
|
|
- docs/architecture/storage/coordination.md
|
|
|
|
## Notes
|
|
|
|
> To be filled by implementation agent
|
|
|
|
## Summary
|
|
|
|
> To be filled on completion |