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.8 KiB
2.8 KiB
id, name, status, depends_on, scope, risk, impact, level
| id | name | status | depends_on | scope | risk | impact | level | |
|---|---|---|---|---|---|---|---|---|
| relocate-core-remaining-modules | Relocate Config, Logger, and Crypto to Hub | completed |
|
moderate | medium | component | implementation |
Description
Move the three remaining modules from packages/core/ into packages/hub/, then remove the packages/core/ package entirely. These modules are hub-specific concerns:
config/types.ts(169 lines) — TypeBox schemas for HubConfig, SpokeConfig, BaseConfig, PostgresConfig, RedisConfig, etc. Both hub and spoke need config types. For now, these go into hub; if spokes need shared config types later, we can extract them into a thin@alkdev/configor inline them in the spoke package.logger/mod.ts(27 lines) — Logtape wrapper. Currently a stub (only logs["logtape", "meta"]category). Needs proper configuration — that's a hub startup concern.utils/crypto.ts(119 lines) — AES-256-GCM encryption/decryption, PBKDF2 key derivation, key generation. Hub-only (encryption key management lives in the hub).
After relocating, packages/core/ is empty and should be removed from the workspace.
Steps
- Create
packages/hub/src/config/directory and moveconfig/types.tsthere - Create
packages/hub/src/logger/directory and movelogger/mod.tsthere - Create
packages/hub/src/utils/directory and moveutils/crypto.tsthere - Update all imports in moved files (they'll use
@alkdev/typeboxetc. from npm) - Add
packages/hub/deno.jsonwith proper dependencies - Update
packages/hub/mod.tsto export the new modules - Remove
packages/core/entirely - Remove
"packages/core"from rootdeno.jsonworkspace array - Verify
deno check packages/hub/passes
Note on SpokeConfig
SpokeConfig types are used by spokes, but for now the spoke package can duplicate the small number of fields it needs (SpokeConfig is just hub.url + hub.auth.tokenFile). When we implement the spoke, we'll decide whether to:
- A) Duplicate the few spoke-relevant fields in the spoke package
- B) Create a thin shared
@alkdev/confignpm package - C) Have the spoke import hub's config types (not ideal, creates coupling)
This decision can be deferred until spoke implementation begins.
Acceptance Criteria
packages/hub/src/config/types.tsexists with config TypeBox schemaspackages/hub/src/logger/mod.tsexists with logtape wrapperpackages/hub/src/utils/crypto.tsexists with AES-256-GCM functionspackages/hub/deno.jsonhas correct dependencies and exportspackages/core/directory is deleted- Root
deno.jsonworkspace no longer includespackages/core deno check packages/hub/passes- No references to
@alkhub/coreorpackages/coreremain in the codebase
References
- docs/reviews/core-library-extraction-sync-2026-05-18.md (Section 1.2, 1.3, 6.1, 6.2)