Files
hub/tasks/architecture/storage/enhance-detections-table.md
glm-5.1 2b63cda1c7 Setup repo: migrate architecture specs, code stubs, and tasks from alkhub_ts
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.
2026-05-25 10:56:32 +00:00

36 lines
1.3 KiB
Markdown

---
id: enhance-detections-table
name: Add Resolution Tracking and Dedup to Detections
status: completed
depends_on: []
scope: narrow
risk: low
impact: isolated
level: implementation
---
## Description
W21: The `detections` table has no resolution tracking (resolved/acknowledged/false-positive), no deduplication (persistent `MODEL_DEGRADATION` creates new row every check interval), no session end correlation, and `anomalyType` value set is unclear.
Add `resolvedAt` timestamp column. Add a UNIQUE constraint on `(sessionId, anomalyType)` with upsert semantics, or document that deduplication is handled at the application level. Specify whether `anomalyType` is extensible.
## Acceptance Criteria
- [ ] `coordination.md` detections table includes nullable `resolvedAt` column
- [ ] Deduplication strategy documented: UNIQUE on `(sessionId, anomalyType)` with upsert, OR application-level dedup with rationale
- [ ] `anomalyType` documented as extensible or closed enum with initial values
- [ ] Relationship to session end noted (auto-resolve on session close?)
## References
- docs/reviews/storage-architecture-review-2026-04-21.md#W21
- docs/architecture/storage/coordination.md:29-39
## Notes
> To be filled by implementation agent
## Summary
> To be filled on completion