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.
This commit is contained in:
2026-05-25 10:56:32 +00:00
parent 3e3f12d2d5
commit 2b63cda1c7
120 changed files with 11714 additions and 2 deletions

View File

@@ -0,0 +1,50 @@
---
id: archive-migration-research
name: Archive or Update Migration Research Docs
status: completed
depends_on: []
scope: narrow
risk: trivial
impact: isolated
level: implementation
---
## Description
The `docs/research/migration/` directory contains two files describing planned extractions that are now **complete**:
- `operations.md` — Planned extraction of `packages/core/operations/` and `packages/core/mcp/` into `@alkdev/operations`
- `pubsub.md` — Planned extraction of `packages/core/pubsub/` into `@alkdev/pubsub`
Both contain detailed current-state analysis, migration steps, and open questions that are now resolved. They served their purpose but are now outdated and potentially confusing.
### Options
**A. Archive** (recommended): Move both files to `docs/research/migration/completed/` with a status note at the top. This preserves them for historical reference without cluttering the active research directory.
**B. Update**: Rewrite as "completed migration" docs showing before/after. More work for less value — the review doc already captures the migration impact.
**C. Delete**: Remove entirely. Loses historical context.
### Also: Mark resolved findings in consistency review
`docs/reviews/docs-consistency-review-2026-04-17.md` has several findings that are now resolved by the extractions. Add resolution notes:
| Finding | Original Issue | New Resolution |
|---------|---------------|----------------|
| C5 | PendingRequestMap is in core, not hub | Resolved: now in `@alkdev/operations` |
| I2 | `env.ts` has PendingRequestMap interface only | Resolved: full implementation in `@alkdev/operations` |
| I5 | `OperationContext.pubsub` typed as unknown | Resolved: `pubsub` field removed from context |
| I6 | `OperationContext.stream` never populated | Resolved: `stream` field removed from context |
| I7 | `@repeaterjs/repeater` version mismatch risk | Resolved: inlined in `@alkdev/pubsub`, no external dep |
## Acceptance Criteria
- [ ] `docs/research/migration/operations.md` is archived or clearly marked as completed
- [ ] `docs/research/migration/pubsub.md` is archived or clearly marked as completed
- [ ] Consistency review findings C5, I2, I5, I6, I7 are marked as resolved with resolution notes
- [ ] No active doc references `docs/research/migration/` as authoritative for current state
## References
- docs/reviews/core-library-extraction-sync-2026-05-18.md (Section 2.13, 2.14)

View File

@@ -0,0 +1,77 @@
---
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)

View File

@@ -0,0 +1,56 @@
---
id: relocate-core-remaining-modules
name: Relocate Config, Logger, and Crypto to Hub
status: completed
depends_on: [delete-replaced-core-code]
scope: moderate
risk: medium
impact: component
level: 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/config` or 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
1. Create `packages/hub/src/config/` directory and move `config/types.ts` there
2. Create `packages/hub/src/logger/` directory and move `logger/mod.ts` there
3. Create `packages/hub/src/utils/` directory and move `utils/crypto.ts` there
4. Update all imports in moved files (they'll use `@alkdev/typebox` etc. from npm)
5. Add `packages/hub/deno.json` with proper dependencies
6. Update `packages/hub/mod.ts` to export the new modules
7. Remove `packages/core/` entirely
8. Remove `"packages/core"` from root `deno.json` workspace array
9. 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/config` npm 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.ts` exists with config TypeBox schemas
- [ ] `packages/hub/src/logger/mod.ts` exists with logtape wrapper
- [ ] `packages/hub/src/utils/crypto.ts` exists with AES-256-GCM functions
- [ ] `packages/hub/deno.json` has correct dependencies and exports
- [ ] `packages/core/` directory is deleted
- [ ] Root `deno.json` workspace no longer includes `packages/core`
- [ ] `deno check packages/hub/` passes
- [ ] No references to `@alkhub/core` or `packages/core` remain in the codebase
## References
- docs/reviews/core-library-extraction-sync-2026-05-18.md (Section 1.2, 1.3, 6.1, 6.2)

View File

@@ -0,0 +1,53 @@
---
id: review-sync-completeness
name: Review Sync Completeness and Cross-Reference Consistency
status: completed
depends_on: [delete-replaced-core-code, relocate-core-remaining-modules, update-agents-and-overview, update-packages-and-dependencies, update-call-graph-and-operations-docs, update-pubsub-doc, update-secondary-docs, update-tasks-doc-for-taskgraph, archive-migration-research]
scope: broad
risk: high
impact: phase
level: review
---
## Description
Final review gate after all sync tasks are completed. Verify that the codebase and documentation are consistent with the core library extractions. This is the stabilization gate before resuming feature development.
### Checks
1. **No stale references**: Search entire `docs/` directory for:
- `packages/core/operations/` → should be `@alkdev/operations`
- `packages/core/pubsub/` → should be `@alkdev/pubsub`
- `packages/core/mcp/` → should be `@alkdev/operations/from-mcp`
- `core/operations/` → should be `@alkdev/operations`
- `core/pubsub/` → should be `@alkdev/pubsub`
- `PubSubPublishArgsByKey` → should be `PubSubEventMap`
- `@repeaterjs/repeater` as a direct dependency → should note it's inlined in `@alkdev/pubsub`
- `"Not started"` for WebSocket EventTarget → should note it's implemented
- `"Not started"` for Call Protocol → should note it's implemented
2. **Package structure**: Verify `packages/core/` is deleted, workspace config is correct, hub package has proper deno.json
3. **Type check**: `deno check` passes across the workspace
4. **AGENTS.md accuracy**: Read through AGENTS.md and verify every claim is current
5. **overview.md accuracy**: Read through overview.md and verify every status is current
6. **Cross-reference integrity**: Every doc that mentions a module has the correct package name
7. **Breaking changes documented**: Verify that all breaking API changes from the review doc (Section 1.5) are reflected in relevant architecture docs
## Acceptance Criteria
- [ ] No stale `packages/core/operations/` or `packages/core/pubsub/` references in docs
- [ ] No stale `Not started` status for WebSocket EventTarget or Call Protocol
- [ ] `packages/core/` is deleted from workspace
- [ ] `deno check` passes on workspace
- [ ] AGENTS.md is accurate and current
- [ ] overview.md status table is accurate
- [ ] All breaking API changes (ResponseEnvelope, buildEnv, ScannerFS, etc.) are documented in relevant specs
## References
- docs/reviews/core-library-extraction-sync-2026-05-18.md (full document)

View File

@@ -0,0 +1,62 @@
---
id: update-agents-and-overview
name: Update AGENTS.md and overview.md for Extraction
status: completed
depends_on: []
scope: moderate
risk: low
impact: component
level: implementation
---
## Description
Update the two highest-visibility project orientation docs to reflect that operations, pubsub, and mcp are now external npm packages, not in-repo code. These are the docs that developers and agents read first.
### AGENTS.md changes
**Provenance table** — Replace all "Copied from predecessor project" / "Forked from graphql-yoga" / "Not started" entries:
| Module | Current Status | Updated Status |
|--------|---------------|----------------|
| Operations system | "Working, 7 tests passing" | Extracted to `@alkdev/operations` v0.1.0 |
| PubSub (createPubSub) | "Working" | Extracted to `@alkdev/pubsub` v0.1.0 |
| PubSub (operators) | "Working" | Extracted to `@alkdev/pubsub` v0.1.0 |
| TypedEventTarget | "Forked from graphql-yoga" | Extracted to `@alkdev/pubsub` v0.1.0 |
| Redis EventTarget | "Working, 5 tests passing" | Extracted to `@alkdev/pubsub` v0.1.0 |
| WebSocket EventTarget | "Not started" | Implemented in `@alkdev/pubsub` v0.1.0 |
| MCP client | "Working, 1 test passing" | Extracted to `@alkdev/operations/from-mcp` v0.1.0 |
| Call protocol | "Not started" | Implemented in `@alkdev/operations` v0.1.0 |
| Config types | "Needs hub config" | Relocated to hub package |
| Logger | "Needs proper config" | Relocated to hub package |
| Storage | "Not started" | Not started (unchanged) |
**Key Patterns section** — Update to reference `@alkdev/operations` and `@alkdev/pubsub` instead of in-repo code. Add taskgraph pattern. Add ResponseEnvelope.
**Workspace Structure** — Remove `core/` package. Add external deps section.
**Reference Dependencies table** — Add `@alkdev/operations`, `@alkdev/pubsub`, `@alkdev/taskgraph`. Remove `graphql-yoga`. Update `graphology` note to transitive dep.
**Constraints section** — Add constraint: do not duplicate code from `@alkdev/*` packages in-repo.
### overview.md changes
**"What Exists" section** — Replace entirely with current state (extracted packages at v0.1.0, remaining stubs still in packages/core/).
**"What Needs Implementation"** — Remove WebSocket EventTarget, Call protocol (both done). Add taskgraph integration. Keep everything else.
**Architecture Docs section** — Update descriptions of operations, pubsub, call-graph docs.
## Acceptance Criteria
- [ ] AGENTS.md provenance table reflects extraction to npm packages
- [ ] AGENTS.md key patterns reference `@alkdev/operations` and `@alkdev/pubsub`
- [ ] AGENTS.md workspace structure removes `core/` from packages list
- [ ] AGENTS.md reference dependencies table includes 3 new packages and removes graphql-yoga
- [ ] overview.md "What Exists" lists npm package locations
- [ ] overview.md "What Needs Implementation" removes completed items
- [ ] All internal cross-references between docs are consistent
## References
- docs/reviews/core-library-extraction-sync-2026-05-18.md (Section 2.1, 2.2)

View File

@@ -0,0 +1,65 @@
---
id: update-call-graph-and-operations-docs
name: Update call-graph.md and operations.md for @alkdev/operations API
status: completed
depends_on: []
scope: moderate
risk: medium
impact: component
level: implementation
---
## Description
These two architecture docs describe the call protocol and operations system, both of which are now implemented in `@alkdev/operations`. They need significant updates to reflect the actual API surface.
### call-graph.md changes
1. **PendingRequestMap section** — Replace the schematic implementation with actual `@alkdev/operations` API:
- `new PendingRequestMap({ eventTarget })` constructor with optional EventTarget
- `call(operationId, input, { deadline, identity })` returns `Promise<ResponseEnvelope>`
- `subscribe(operationId, input, { idleTimeout, identity })` returns `AsyncIterable<ResponseEnvelope>`
- `respond(requestId, output)` requires `isResponseEnvelope(output)`
- `emitError(requestId, code, message, details?)`, `complete(requestId)`, `abort(requestId)`
- Built-in deadline and idle timeout support
2. **CallHandler section** — Reference `buildCallHandler` from `@alkdev/operations`
3. **buildEnv section** — Remove `callMap` parameter. New API:
- `buildEnv({ registry, context })` — sets `trusted: true` on nested context
- No `callMap` parameter — `PendingRequestMap` handles call routing
- Returns env functions that return `Promise<ResponseEnvelope>`
4. **Dependencies section** — Replace direct `graphology` deps. `graphology` is now a transitive dep through `@alkdev/taskgraph`. For call graph storage, the hub can still use `graphology` directly or use `@alkdev/taskgraph`'s `TaskGraph` class.
5. **CallEventSchema** — Cross-reference that the TypeBox schemas are in `@alkdev/operations` and may differ slightly from what's documented. Add note to verify against package source.
6. **Transport mapping table** — Update WebSocket row: `@alkdev/pubsub/event-target-websocket-server` for hub, `@alkdev/pubsub/event-target-websocket-client` for spoke
### operations.md changes
1. Remove "In-repo location: `packages/core/operations/`" — now `@alkdev/operations` npm package
2. Update component descriptions to reference `@alkdev/operations` exports
3. Add `ResponseEnvelope` concept (universal result wrapper: `local/http/mcp`)
4. Add `CallError` / `InfrastructureErrorCode` concept
5. Add `subscribe()` helper for subscription operations
6. Add `ScannerFS` interface (Deno/Node agnostic)
7. Update Schema Adapters section to use `SchemaAdapter` pattern from `@alkdev/operations/from-typemap`
8. Remove "SSE Subscription Handler Fix" from open issues — fixed in `@alkdev/operations/from-openapi`
9. Update Call Protocol Integration section to reference `@alkdev/operations` API
10. Update `buildEnv` to remove `callMap` parameter
## Acceptance Criteria
- [ ] call-graph.md PendingRequestMap section shows actual `@alkdev/operations` API
- [ ] call-graph.md buildEnv section has no `callMap` parameter
- [ ] call-graph.md dependencies reference `@alkdev/taskgraph` transitively
- [ ] call-graph.md transport table references `@alkdev/pubsub` event targets
- [ ] operations.md references `@alkdev/operations` package throughout
- [ ] operations.md open issues no longer include fixed items
- [ ] operations.md documents ResponseEnvelope and CallError
- [ ] No references to `packages/core/operations/` remain in either doc
## References
- docs/reviews/core-library-extraction-sync-2026-05-18.md (Section 2.4, 2.5)

View File

@@ -0,0 +1,38 @@
---
id: update-packages-and-dependencies
name: Update packages.md Dependency Structure
status: completed
depends_on: []
scope: narrow
risk: low
impact: component
level: implementation
---
## Description
Update `docs/architecture/packages.md` to reflect the new dependency structure: `@alkhub/core` is removed, hub and spoke import directly from `@alkdev/*` npm packages.
### Key changes
1. Remove `@alkhub/core` section entirely
2. Add sections for the 3 external `@alkdev/*` packages with their exports
3. Update `@alkhub/hub` dependencies: add `@alkdev/operations`, `@alkdev/pubsub`, `@alkdev/taskgraph`; remove `@repeaterjs/repeater` (inlined in pubsub)
4. Update `@alkhub/spoke` dependencies: add `@alkdev/operations`, `@alkdev/pubsub`
5. Update dependency direction: `spoke → @alkdev/operations, @alkdev/pubsub`, `hub → @alkdev/operations, @alkdev/pubsub, @alkdev/taskgraph`
6. Update rules: replace "core is transport-agnostic" with "packages should be transport-agnostic"
7. Note that `ioredis` is now an optional peer dep of `@alkdev/pubsub` (only if Redis ET is used), not a direct dep of hub
8. Note that `@modelcontextprotocol/sdk` is an optional peer dep of `@alkdev/operations` (only if MCP adapter is used)
## Acceptance Criteria
- [ ] `@alkhub/core` section is removed
- [ ] 3 external `@alkdev/*` package sections are documented with exports
- [ ] Hub and spoke dependency lists are updated
- [ ] Dependency direction diagram is updated
- [ ] Rules section reflects new structure (no core package)
- [ ] Storage location decision section still applies (unchanged)
## References
- docs/reviews/core-library-extraction-sync-2026-05-18.md (Section 2.3)

View File

@@ -0,0 +1,45 @@
---
id: update-pubsub-doc
name: Update pubsub-redis.md for @alkdev/pubsub
status: completed
depends_on: []
scope: moderate
risk: low
impact: component
level: implementation
---
## Description
`docs/architecture/pubsub-redis.md` describes code that's now in `@alkdev/pubsub`. The doc needs a substantial rewrite to reflect the new package's API surface, including EventEnvelope, WebSocket and Worker event targets, the `prefix`/`close()` Redis API, and the expanded operator set.
### Key changes
1. **Source location** — Change from `packages/core/pubsub/` to `@alkdev/pubsub` npm package
2. **createPubSub API** — Document `PubSubEventMap` pattern (simple `{ [eventType: string]: payload }`) replacing `PubSubPublishArgsByKey`. `publish(type, id, payload)` always takes 3 explicit args.
3. **EventEnvelope** — New concept: `{ type, id, payload }` is the universal cross-process message format. Types starting with `__` are reserved for adapter control messages (used by WS event targets for `__subscribe`/`__unsubscribe`).
4. **Redis EventTarget** — Add `prefix` option (e.g., `"alk:events:"`) and `close()` method. Remove the "configure serializer or wrap event target" workaround — `prefix` is now a parameter.
5. **WebSocket EventTarget** — No longer "Not started" / "Deferred". Document both:
- `@alkdev/pubsub/event-target-websocket-client` — spoke-side adapter
- `@alkdev/pubsub/event-target-websocket-server` — hub-side adapter with `addConnection()`/`removeConnection()`, per-connection `SpokeEventTarget`, backpressure handling
6. **Worker EventTarget** — New adapter: host (`createWorkerHostEventTarget(worker)`) and thread (`createWorkerThreadEventTarget()`)
7. **Operators** — List all 13: `filter`, `map`, `pipe`, `take`, `reduce`, `toArray`, `batch`, `dedupe`, `window`, `flat`, `groupBy`, `chain`, `join`
8. **Repeater** — Inlined, no external `@repeaterjs/repeater` dependency
9. **Package exports** — Document the 5 subpath exports: `.`, `./event-target-redis`, `./event-target-websocket-client`, `./event-target-websocket-server`, `./event-target-worker`
10. **Prior Art** — Update to reflect `@alkdev/pubsub` is a standalone package, not forked graphql-yoga code
## Acceptance Criteria
- [ ] Source location references `@alkdev/pubsub` throughout
- [ ] `createPubSub` API docs use `PubSubEventMap` pattern
- [ ] EventEnvelope concept is documented
- [ ] Redis EventTarget docs include `prefix` and `close()`
- [ ] WebSocket client and server event targets are documented (not marked as deferred)
- [ ] Worker event target is documented
- [ ] All 13 operators are listed
- [ ] No references to `packages/core/pubsub/` remain
- [ ] Prior Art section reflects standalone package, not in-repo fork
## References
- docs/reviews/core-library-extraction-sync-2026-05-18.md (Section 2.6)

View File

@@ -0,0 +1,64 @@
---
id: update-secondary-docs
name: Update hub-architecture, hub-config, hub-startup, spoke-runner, ADR-013
status: completed
depends_on: [update-call-graph-and-operations-docs, update-pubsub-doc]
scope: moderate
risk: low
impact: component
level: implementation
---
## Description
Update the secondary architecture docs that reference the old `packages/core/` paths and pre-extraction status. These docs don't need rewrites — just path and status reference updates.
### hub-architecture.md
- Component table: Operations row `core/operations/``@alkdev/operations`
- PubSub row: `core/pubsub/``@alkdev/pubsub`
- Call protocol row: `core/``@alkdev/operations` (see call-graph.md)
- WebSocket adapter: "pending" → "available in `@alkdev/pubsub`"
### hub-config.md
- `createRedisEventTarget` example: add `prefix: "alk:events:"` parameter
- Update any references to `PendingRequestMap` location
### hub-startup.md
- Note that PendingRequestMap and CallHandler come from `@alkdev/operations`
- PubSub setup references `@alkdev/pubsub` with `prefix` option
### spoke-runner.md
- WebSocket EventTarget: `@alkdev/pubsub/event-target-websocket-client`
- PendingRequestMap: `@alkdev/operations`
- Scanner: `@alkdev/operations` with `ScannerFS` Deno adapter (show example)
- SchemaAdapters: `@alkdev/operations/from-typemap`
- `FromSchema()` / `FromOpenAPI()`: `@alkdev/operations/from-schema` / `@alkdev/operations/from-openapi`
### ADR-013 (schema-system-integration)
- Update `packages/core/operations/scanner.ts``@alkdev/operations/scanner`
- Update `packages/core/operations/from_schema.ts``@alkdev/operations/from_schema`
- Update `packages/core/operations/from_openapi.ts``@alkdev/operations/from_openapi`
- Update scanner enhancement task to reference `SchemaAdapter` pattern from `@alkdev/operations/from-typemap`
### mcp-server.md
- No significant changes needed (MCP server is hub-level, references to MCP client are now via `@alkdev/operations/from-mcp`)
### agent-sessions.md
- Update `FromOpenAPI` reference to `@alkdev/operations/from-openapi`
### coordination.md
- Update `FromOpenAPI` reference to `@alkdev/operations/from-openapi`
## Acceptance Criteria
- [ ] hub-architecture.md component table references external packages
- [ ] hub-config.md Redis ET example includes prefix
- [ ] hub-startup.md references `@alkdev/operations` for call protocol
- [ ] spoke-runner.md references `@alkdev/pubsub` and `@alkdev/operations` throughout
- [ ] ADR-013 paths updated to `@alkdev/operations/*`
- [ ] No references to `packages/core/operations/` or `packages/core/pubsub/` remain in any secondary doc
- [ ] No file says "Not started" for WebSocket EventTarget or Call Protocol
## References
- docs/reviews/core-library-extraction-sync-2026-05-18.md (Section 2.82.12)

View File

@@ -0,0 +1,39 @@
---
id: update-tasks-doc-for-taskgraph
name: Update storage/tasks.md for @alkdev/taskgraph
status: completed
depends_on: []
scope: narrow
risk: low
impact: component
level: implementation
---
## Description
Update the "Graphology Integration" section and sync flow in `docs/architecture/storage/tasks.md` to reference `@alkdev/taskgraph` instead of direct `graphology` usage.
### Key changes
1. **Graphology Integration section** — Replace manual `DirectedGraph` construction with `TaskGraph.fromRecords()`:
- Instead of "Load rows → Build a graphology DirectedGraph → Run algorithms", use "Load rows → Build a TaskGraph via `TaskGraph.fromRecords(tasks, edges)` → Run analysis functions"
- Reference `@alkdev/taskgraph` analysis functions: `criticalPath()`, `parallelGroups()`, `bottlenecks()`, `riskPath()`, `shouldDecomposeTask()`, `workflowCost()`
- Graphology is still a transitive dependency through `@alkdev/taskgraph` but hub code should prefer the `TaskGraph` API
2. **NAPI note** — Update "Why not taskgraph NAPI for v1" to note that `@alkdev/taskgraph` is now the TypeScript package (pure graphology-based, <5ms for 100 nodes) and the Rust CLI is for offline analysis only. No NAPI needed.
3. **Frontmatter parsing** — Reference `@alkdev/taskgraph`'s `parseFrontmatter()` and `serializeFrontmatter()` functions for task file I/O. Note: `parseTaskFile()` and `parseTaskDirectory()` are Node.js only (use `node:fs/promises`). For Deno, use `parseFrontmatter()` with Deno file I/O.
4. **References section** — Update graphology link to reference the @alkdev/taskgraph package instead of local paths.
## Acceptance Criteria
- [ ] Graphology Integration section references `TaskGraph.fromRecords()` API
- [ ] Analysis functions reference `@alkdev/taskgraph` exports
- [ ] NAPI note is updated for current state
- [ ] Frontmatter parsing references `@alkdev/taskgraph` functions
- [ ] References section updated
## References
- docs/reviews/core-library-extraction-sync-2026-05-18.md (Section 2.7)