Skip to content

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

Closed

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

Activity

  1. added a commit that references this issue on Mar 17, 2026
    80c1715
  2. added a commit that references this issue on Mar 17, 2026
    ca6f60e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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