Skip to content

[compat] First state:new selector from prior manifest #211

Description

@sabino

Objective

Implement the first state: selector slice: state:new should select current supported resources whose unique_id is absent from a prior dbt Manifest state directory.

Current Reality

dxt ls already supports the shared selector engine, YAML selector aliases/composition for the supported subset, source_status:* from prior sources.json, and result:* from prior run_results.json. The compatibility matrix still lists broader state/defer selectors as planned. A small state:new slice moves workflow compatibility forward without taking on manifest diffing, deferral, or run-result semantics.

Role and Labels

  • role: role:worker
  • labels: type:compat, area:selector, area:artifacts, artifact:manifest, command:ls
  • readiness: status:ready, ready-for-agent

Priority

priority:p1: state selectors are a core dbt CI workflow surface, and state:new is the smallest useful manifest-state selector before state:modified or defer.

Readiness

Ready for one selector/artifact worker. Reuse the existing state-artifact reader patterns where possible and keep the first slice limited to current-vs-prior unique_id membership.

Risk

  • risk:artifact-contract: the prior artifact must be dbt Manifest shaped and parsed without inventing dxt-only fields.
  • risk:upstream-ambiguity: dbt Core selector behavior should be pinned for state:new, including graph expansion interactions.

Dependencies / Sequencing

Build on the closed YAML selector/state roadmap and the implemented source_status:* / result:* selector inputs. Keep this separate from state:modified, state:old, state:unmodified, --defer, and --favor-state.

Acceptance Criteria

  • dxt ls --state <state-dir> --select state:new reads <state-dir>/manifest.json and selects supported current resources whose unique_id is missing from the prior manifest.
  • state:new+, +state:new, and existing --exclude behavior compose through the shared graph selector engine in the supported graph subset.
  • Missing or malformed state manifest errors are deterministic and public-safe.
  • The implementation remains Zig product runtime behavior; Python is allowed only for CLI/oracle tests.
  • Existing source_status:*, result:*, YAML selector, and basic selector tests keep passing.

Validation

  • native Zig selector tests for prior-manifest membership and graph expansion
  • focused pytest through the Zig binary for a tiny current/prior fixture pair
  • dbt Core oracle comparison for selected IDs where local dbt dependencies are available
  • python scripts/check_runtime_boundary.py
  • python scripts/check_public_safety.py

Stop Condition

Stop and split if the implementation requires state:modified checksum comparison, deferral relation resolution, package install state, partial parsing, or Python product-runtime behavior.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions