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.
2.0 KiB
2.0 KiB
id, name, status, depends_on, scope, risk, impact, level
| id | name | status | depends_on | scope | risk | impact | level | |||
|---|---|---|---|---|---|---|---|---|---|---|
| add-partial-indexes | Add Partial Indexes and Call Graph Index Improvements | completed |
|
narrow | low | component | implementation |
Description
Four related index/constraint improvements across different domains:
-
S02: Add partial indexes for common access patterns — active API keys (
WHERE revoked_at IS NULL AND enabled = true), connected spokes (WHERE status = 'connected'), non-archived sessions, active tasks (WHERE status IN ('pending', 'in-progress', 'blocked')). -
S04: Add
accounts.displayNameindex for user search/autocomplete UIs. Without it, user search requires full table scans. -
S17: Add
call_graph_nodes.startedAtindex alongside or instead ofcreatedAtfor p99 latency analysis queries. -
S18: Add unique constraint on
call_graph_edges(sourceId, targetId, edgeType)to prevent duplicate edges from retries/reconnections.
Acceptance Criteria
- Partial indexes defined in
table-reference.mdfor: active API keys, connected spokes, non-archived sessions, active tasks displayNameindex added to accounts table inidentity.mdandtable-reference.mdstartedAtindex added to call_graph_nodes incall-graph.mdandtable-reference.md- Unique constraint on
(sourceId, targetId, edgeType)added to call_graph_edges incall-graph.mdandtable-reference.md - All indexes documented with WHERE clauses/purpose in per-domain docs
References
- docs/reviews/storage-architecture-review-2026-04-21.md#S02
- docs/reviews/storage-architecture-review-2026-04-21.md#S04
- docs/reviews/storage-architecture-review-2026-04-21.md#S17
- docs/reviews/storage-architecture-review-2026-04-21.md#S18
- docs/architecture/storage/table-reference.md
- docs/architecture/storage/identity.md
- docs/architecture/storage/call-graph.md
Notes
To be filled by implementation agent
Summary
To be filled on completion