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 |
|---|---|---|---|---|---|---|---|
| add-cross-project-dep-guard | Add DB-level guard for cross-project task dependencies | completed | narrow | medium | component | implementation |
Description
"Tasks can only depend on tasks within the same project" is declared in tasks.md:217 but only "enforced at the application level." task_dependencies has FK columns with no projectId or check constraint. Application-level enforcement is vulnerable to race conditions, direct SQL access, or bugs.
Choose one:
- (A) Add a DB trigger that checks
dependsOnTaskIdandtaskIdbelong to the same project - (B) Add a denormalized
projectIdcolumn totask_dependencieswith a composite FK - (C) Document the risk explicitly and specify that the sync operation validates project scope within a transaction (SELECT FOR SHARE)
Acceptance Criteria
- The chosen enforcement mechanism is documented in
tasks.md - If option A: trigger definition is specified;
tasks.mdnotes the trigger name and behavior - If option B:
projectIdcolumn is added totask_dependenciesschema; composite FK documented;table-reference.mdupdated - If option C: the risk is documented and the sync validation pattern is specified (SELECT FOR SHARE + INSERT in same transaction)
- The cross-project dependency invariant is restated in
tasks.mdwith the enforcement mechanism
References
- docs/reviews/storage-architecture-review-2026-04-21.md#C09
- docs/architecture/storage/tasks.md:217
- docs/architecture/storage/tasks.md:357
Notes
To be filled by implementation agent
Summary
To be filled on completion