feat(primitive): either -- pass if one of N files exists #80

Closed
opened 2026-05-26 10:27:50 +02:00 by michael · 0 comments
Owner

Goal

Add an either primitive that passes if at least one of two files exists.
Enables rules like "pass if .merkwerk exists OR .merkwerk.example exists".

Motivation

Some rules cannot be expressed with a single exists check because either
of two alternatives satisfies the requirement. The current primitives have
no conditional or disjunctive logic.

Proposed rule (blocked until primitive exists)

rule_id: merkwerk-config-exists
check:
  primitive: daw.fragjan.check.either
  paths:
    - .merkwerk
    - .merkwerk.example
  type: file
result:
  severity: error
  message: "neither .merkwerk nor .merkwerk.example found"

Acceptance criteria

  • either primitive spec defined (fragjan_primitive/v1)
  • Prototype implementation in daw-modul-fragjan-check-either
  • merkwerk-config-exists rule added to daw-project pack
## Goal Add an `either` primitive that passes if at least one of two files exists. Enables rules like "pass if .merkwerk exists OR .merkwerk.example exists". ## Motivation Some rules cannot be expressed with a single `exists` check because either of two alternatives satisfies the requirement. The current primitives have no conditional or disjunctive logic. ## Proposed rule (blocked until primitive exists) ```yaml rule_id: merkwerk-config-exists check: primitive: daw.fragjan.check.either paths: - .merkwerk - .merkwerk.example type: file result: severity: error message: "neither .merkwerk nor .merkwerk.example found" ``` ## Acceptance criteria - [ ] either primitive spec defined (fragjan_primitive/v1) - [ ] Prototype implementation in daw-modul-fragjan-check-either - [ ] merkwerk-config-exists rule added to daw-project pack
michael added this to the Basic Version milestone 2026-05-30 16:04:44 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DAW/fragjan#80
No description provided.