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.
1.6 KiB
1.6 KiB
id, name, status, depends_on, scope, risk, impact, level
| id | name | status | depends_on | scope | risk | impact | level |
|---|---|---|---|---|---|---|---|
| document-mappings-task-denorm-invariant | Document mappings.task denormalization sync strategy | completed | narrow | medium | component | implementation |
Description
The mappings table has both taskId (FK → tasks.id) and task (denormalized display name). No mechanism keeps them in sync. If taskId points to a task whose slug or name changes, mappings.task becomes stale. When taskId is SET NULL (task deleted), what happens to task?
The review recommends documenting the invariant: "mappings.task is set to tasks.slug at insert time and is not automatically updated when the task's slug changes. When taskId is SET NULL (task deleted), task should also be SET NULL. This is a cache, not a source of truth." Alternatively, remove the denormalized column and use a VIEW that joins.
Acceptance Criteria
coordination.mddocuments the invariant formappings.task: it is a cache oftasks.slug, set at insert time, not auto-updated- The behavior when
taskIdis SET NULL is documented:taskshould also be SET NULL (application-level or trigger) - If keeping the column: add a note that stale
taskvalues are acceptable (cache semantics) - If removing the column: replace with a VIEW definition and update coordination.md
tasks.md:209reference tomappings.taskis updated to be consistent
References
- docs/reviews/storage-architecture-review-2026-04-21.md#C06
- docs/architecture/storage/coordination.md:22
- docs/architecture/storage/tasks.md:209
Notes
To be filled by implementation agent
Summary
To be filled on completion