Skip to content

Refactor selector system internals into parser/matcher/resolver modules #159

@thymikee

Description

@thymikee

Problem

src/daemon/selectors.ts is currently ~540 LOC and combines selector parsing/tokenization, matching/resolution, disambiguation scoring, and selector-chain generation.

Goal

Decompose selector system internals into focused modules while preserving selector DSL behavior.

Proposed split

  • src/daemon/selectors-parse.ts
    • parse/tokenize/unquote/boolean parsing
  • src/daemon/selectors-match.ts
    • selector and term matching primitives
  • src/daemon/selectors-resolve.ts
    • fallback chain resolution + disambiguation scoring
  • src/daemon/selectors-build.ts
    • selector-chain generation for replay/action recording
  • Keep src/daemon/selectors.ts as thin public facade.

Acceptance criteria

  • No selector DSL behavior changes.
  • Existing exports keep signatures and semantics.
  • New modules target <=300 LOC where practical.
  • Existing selector + replay-heal tests pass unchanged.

Validation

  • pnpm typecheck
  • pnpm test:unit
  • pnpm test:smoke

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions