learning_ai_notes/docs/roadmaps/09_BACKEND_REUSE_ALIGNMENT_ROADMAP.md
saravanakumardb1 4667f85e20 docs(cleanup): move historical roadmaps to docs/archive/ and update AGENTS.md
Sprint B — closes audit item B7 (doc consolidation).

- docs/AGENT_TASK_ROADMAP.md, docs/ARCHITECTURE_REVIEW_AND_REUSE_ROADMAP.md,
  docs/GAP_ANALYSIS.md were each self-marked as historical snapshots
  but kept polluting the top of docs/. Moved them under docs/archive/
  in the previous commit; this commit:
  - Adds docs/archive/README.md explaining what's archived vs active
  - Repoints cross-doc links in docs/IMPLEMENTATION_TRACKER.md,
    docs/WEB_AI_FAST_ROADMAP.md, and docs/roadmaps/*.md to the new
    archive paths
  - Fixes relative links inside the archived files themselves so
    historical readers can still navigate back to active docs
- AGENTS.md §1.1 refreshed: reflects the May 22 re-verified state
  (382/96/97 tests), links the two new runbooks, and points readers
  away from docs/archive/ as a work source.
2026-05-22 23:23:50 -07:00

3.4 KiB

Backend Reuse Alignment Roadmap

Historical reuse roadmap. This draft is superseded by ../PRODUCTION_READINESS_HANDOFF_ROADMAP.md for active production-readiness execution. Backend platform/API drift is currently tracked there in P0.5, P2, P3, and P5.

Status: Draft Parent: docs/archive/ARCHITECTURE_REVIEW_AND_REUSE_ROADMAP.md Scope: backend/

Goal

Keep the backend strongly product-specific for notes domain logic while maximizing reuse of ByteLyst shared packages and avoiding premature extraction of notes-specific code into common platform layers.

Preserve As Product-Local

  • notes module remains local
  • workspaces module remains local
  • note-relationships module remains local
  • note-tasks module remains local
  • note-artifacts module remains local
  • note-agent-actions module remains local

Shared Package Alignment

  • Continue using @bytelyst/auth
  • Continue using @bytelyst/config
  • Continue using @bytelyst/cosmos
  • Continue using @bytelyst/datastore
  • Continue using @bytelyst/errors
  • Continue using @bytelyst/fastify-core
  • Continue using @bytelyst/logger
  • Continue using @bytelyst/testing

Dependency Notes

  • Finalize backend contract decisions before broad web/mobile DTO cleanup
  • Use this roadmap to define what must stay local before proposing any common-plat extraction
  • Coordinate blob/extraction/MCP decisions with the platform/shared-services roadmap

Phase B0 — Identity and Config Alignment

  • Keep shared/product.json as the backend identity source
  • Ensure all persisted docs use the canonical product identity field
  • Review backend env schema for any duplicated or drifting product constants
  • Keep service URLs explicit for platform/extraction/MCP dependencies

Phase B1 — Shared-Service Boundary Discipline

  • Confirm no platform-service concern is being reimplemented locally
  • Keep auth/identity concerns delegated to shared platform patterns
  • Keep extraction logic delegated to extraction-service
  • Keep blob authorization/upload patterns delegated to shared blob/platform flows
  • Keep MCP orchestration compatible with shared mcp-server

Phase B2 — Contract and DTO Hygiene

  • Review backend response shapes used by web/mobile
  • Identify DTO duplication across backend/web/mobile
  • Introduce a repo-local shared contracts layer only if duplication becomes costly
  • Do not move notes-specific contracts to common platform unless another product clearly needs them

Phase B3 — Hardening

  • Add route behavior tests using Fastify inject()
  • Add repository behavior tests
  • Add cross-entity tests for notes + relationships/tasks/artifacts/agent actions
  • Review request tracing and error behavior against workspace standards
  • Replace raw stdout/stderr startup output with shared logger patterns if practical

Guardrails

  • Do not move notes-specific modules into platform-service
  • Do not create shared abstractions that only benefit this one product
  • Do not over-generalize the notes domain into common platform prematurely

Done When

  • backend remains clearly product-specific
  • shared package usage is explicit and clean
  • backend contracts are stable enough for web/mobile integration
  • backend quality is improved without architectural drift