feat(primitive): list-values -- validate table literal values against allowed/forbidden list #84

Closed
opened 2026-05-26 18:01:16 +02:00 by michael · 0 comments
Owner

Goal

New primitive to extract values from a Lua table literal on a single line
and check them against an allowed or forbidden list defined in the rule YAML.

Use cases

  • validate provides field in module init.lua against known interface labels
  • validate type field in module init.lua against known type values
  • detect forbidden values in any single-line table literal

Interface

check:
  primitive: daw.fragjan.check.list-values
  key_pattern: "provides = {"
  mode: allowed          # or: forbidden
  values:
    - "vcs"
    - "storage"
    - "ui"

Behaviour

  • Find first line matching key_pattern
  • Extract all quoted string values from that line
  • mode=allowed: flag any value not in values list
  • mode=forbidden: flag any value that is in values list
  • No match for key_pattern: skip file (not a finding)

Parameters

  • key_pattern (string, required): pattern to identify the target line
  • mode (string, required): allowed | forbidden
  • values (list, required): list of string values to check against

Output fields

  • value: the offending value
  • mode: allowed | forbidden

Notes

Single-line only -- multi-line table literals are out of scope for now.
Repo to create: DAW/daw-modul-fragjan-check-list-values
Related: DAW/fragjan#75 (provides validation), DAW/fragjan#78 (correlation)

## Goal New primitive to extract values from a Lua table literal on a single line and check them against an allowed or forbidden list defined in the rule YAML. ## Use cases - validate `provides` field in module init.lua against known interface labels - validate `type` field in module init.lua against known type values - detect forbidden values in any single-line table literal ## Interface ```yaml check: primitive: daw.fragjan.check.list-values key_pattern: "provides = {" mode: allowed # or: forbidden values: - "vcs" - "storage" - "ui" ``` ## Behaviour - Find first line matching key_pattern - Extract all quoted string values from that line - mode=allowed: flag any value not in values list - mode=forbidden: flag any value that is in values list - No match for key_pattern: skip file (not a finding) ## Parameters - key_pattern (string, required): pattern to identify the target line - mode (string, required): allowed | forbidden - values (list, required): list of string values to check against ## Output fields - value: the offending value - mode: allowed | forbidden ## Notes Single-line only -- multi-line table literals are out of scope for now. Repo to create: DAW/daw-modul-fragjan-check-list-values Related: DAW/fragjan#75 (provides validation), DAW/fragjan#78 (correlation)
michael added this to the Basic Version milestone 2026-05-30 16:08:42 +02:00
michael 2026-05-30 21:34:11 +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#84
No description provided.