Skip to content

refactor(adf): dismantle monolithic types.ts into domain-owned modules #10

@SmartBrandStrategies

Description

@SmartBrandStrategies

Linked feedback: ADX-007

Problem

packages/adf/src/types.ts currently co-locates AST, patch protocol, manifest/bundle,
lockfile, evidence, and formatter constants. This broad shared surface obscures domain
ownership and encourages cross-domain imports.

Evidence:

  • Monolithic export surface starts at packages/adf/src/types.ts:12

Scope

  • Create domain-owned type modules, for example:
    • packages/adf/src/ast/types.ts
    • packages/adf/src/patch/types.ts
    • packages/adf/src/manifest/types.ts
    • packages/adf/src/evidence/types.ts
    • packages/adf/src/sync/types.ts
  • Migrate imports to nearest domain modules.
  • Optionally keep temporary compatibility re-exports during migration window.

Acceptance Criteria

  • types.ts is removed or reduced to compatibility exports only.
  • Import graph remains acyclic (no circular deps introduced).
  • Public package exports remain stable or are documented as a breaking change.
  • All ADF tests and typecheck pass.

Test Plan

  • pnpm run typecheck
  • pnpm run test --filter @stackbilt/adf
  • Verify no cross-domain import regressions via code review of changed imports.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:adfADF parser/bundler/patcher packagepriority:p1Should ship this cycletype:refactorCode restructuring without behavior change

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions