Skip to content

Architecture Refactor: SourceAdapter Pattern + SourceRegistry #1

@bradygaster

Description

@bradygaster

Overview

Refactor ACCES discovery layer from monolithic content.ts/community.ts files into a pluggable SourceAdapter pattern with centralized SourceRegistry. This enables plug-and-play source extensibility, parallel execution, and graceful degradation. Prerequisite for all Phase 1 & Phase 2 source expansion work.

Background

Current architecture hardcodes discovery logic in two files (content.ts and community.ts), making it difficult to add new sources without tangling dependencies. Per gap analysis:

  • Current state: ~32% signal completeness with RSS + GitHub only
  • Architecture bottleneck: Cannot scale beyond 3-4 sources without significant code duplication
  • Team decision (decisions.md): Implement adapter pattern before expanding sources

Requirements

  • Extract RSS feed discovery into RSSSourceAdapter implementing SourceAdapter interface
  • Extract GitHub repository discovery into GitHubSourceAdapter implementing SourceAdapter interface
  • Create SourceAdapter interface with methods: \�alidate(), \discover(), \getName()\
  • Create SourceRegistry class for auto-discovery, validation, and parallel execution
  • Each adapter must own its own: env var requirements, rate limiting, error handling, validation logic
  • Registry must support graceful degradation (skip broken adapters, log warnings)
  • Maintain backward compatibility with existing ContentItem/DiscoveryResult types in src/types.ts
  • No new external dependencies — use Node.js built-ins only

Squad SDK Integration

Use Squad SDK patterns for the adapter system:

  • Adapter interface design: Follow Squad SDK's \SkillAdapter\ pattern (capability discovery, validation, execution)
  • Registry pattern: Inspired by Squad SDK's skill registration system (auto-discovery, dependency injection)
  • Error boundaries: Each adapter runs in isolation with Squad-style error handling (try/catch, log + continue)

Acceptance Criteria

  • AC1: RSSSourceAdapter and GitHubSourceAdapter produce identical DiscoveryResult output to current implementation
  • AC2: SourceRegistry.discoverAll() executes all adapters in parallel and returns combined results
  • AC3: If one adapter fails, others continue execution (graceful degradation)
  • AC4:
    pm run build && npm run start\ produces identical output files to current implementation (9 reports)
  • AC5: TypeScript compiles with zero errors in strict mode
  • AC6: New adapters can be added by creating a class implementing SourceAdapter and adding to registry — no changes to orchestrator (src/index.ts)

Dependencies

None — This is the foundation for all other source expansion work.

Assigned To

  • McNulty (TypeScript implementation, testing)
  • Stringer (Squad SDK architecture patterns, code review)

Estimated Effort

2.5 sessions

  • Session 1: Define SourceAdapter interface, create SourceRegistry skeleton
  • Session 2: Extract RSS + GitHub into adapters, test parity
  • Session 3: Refine error handling, documentation, team review

Metadata

Metadata

Assignees

No one assigned

    Labels

    go:needs-researchNeeds investigationsquadSquad triage inbox — Lead will assign to a membersquad:freamonAssigned to Freamon (Lead / Editor-in-Chief)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions