Files
hub/tasks/sync/delete-replaced-core-code.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

77 lines
2.9 KiB
Markdown

---
id: delete-replaced-core-code
name: Delete Replaced Core Code and Update Package Config
status: completed
depends_on: []
scope: moderate
risk: medium
impact: component
level: implementation
---
## Description
Remove all code from `packages/core/` that has been replaced by the `@alkdev/operations` and `@alkdev/pubsub` npm packages. This is the first step in the core library extraction sync — clearing out the old code before relocating what remains and updating the package structure.
### Files to delete
**PubSub module** (replaced by `@alkdev/pubsub`):
- `packages/core/pubsub/create_pubsub.ts`
- `packages/core/pubsub/typed_event_target.ts`
- `packages/core/pubsub/redis_event_target.ts`
- `packages/core/pubsub/operators.ts`
- `packages/core/pubsub/mod.ts`
**Operations module** (replaced by `@alkdev/operations`):
- `packages/core/operations/types.ts`
- `packages/core/operations/registry.ts`
- `packages/core/operations/env.ts`
- `packages/core/operations/scanner.ts`
- `packages/core/operations/validation.ts`
- `packages/core/operations/from_schema.ts`
- `packages/core/operations/from_openapi.ts`
- `packages/core/operations/mod.ts`
**MCP module** (replaced by `@alkdev/operations/from-mcp`):
- `packages/core/mcp/wrapper.ts`
- `packages/core/mcp/loader.ts`
- `packages/core/mcp/mod.ts`
**Tests and fixtures** (for deleted modules):
- `packages/core/tests/operations/registry.test.ts`
- `packages/core/tests/operations/scanner.test.ts`
- `packages/core/tests/pubsub/redis_event_target.test.ts`
- `packages/core/tests/mcp/loader.test.ts`
- `packages/core/tests/fixtures/registry.ts`
- `packages/core/tests/fixtures/operations/demo/greet.ts`
- `packages/core/tests/fixtures/operations/other/calculate.ts`
- `packages/core/tests/operations/` (directory)
- `packages/core/tests/pubsub/` (directory)
- `packages/core/tests/mcp/` (directory)
- `packages/core/tests/fixtures/operations/` (directory)
### Config updates
**`packages/core/deno.json`**:
- Remove exports: `"./operations"`, `"./pubsub"`, `"./mcp"`
- Remove imports: `"@repeaterjs/repeater"`, `"@modelcontextprotocol/sdk"`, `"ioredis"`, `"@alkdev/typebox/value"`
- Keep `"@alkdev/typebox"` (still needed by config types)
- Keep `"@std/*"` imports if used by remaining modules
- Keep `"@logtape/logtape"` (still needed by logger)
**`packages/core/mod.ts`**:
- Remove re-exports of operations, pubsub, mcp
- Keep re-exports of config, logger (and utils/crypto if it stays)
## Acceptance Criteria
- [ ] All listed files and directories are deleted
- [ ] `packages/core/deno.json` has no references to deleted modules
- [ ] `packages/core/mod.ts` has no references to deleted modules
- [ ] `deno check packages/core/` passes on remaining code
- [ ] No orphaned imports in remaining core files (config, logger, utils/crypto)
- [ ] Root `deno.json` workspace still includes `packages/core` (package removal is a separate task)
## References
- docs/reviews/core-library-extraction-sync-2026-05-18.md (Section 1.1, 1.3)