fix(validator): hardcoded primitive api_version range belongs in config #60

Closed
opened 2026-05-25 15:14:07 +02:00 by michael · 1 comment
Owner

Problem

core/validator/capabilities.lua hardcodes the supported primitive
api_version range:

local MIN_API_VERSION = 1
local MAX_API_VERSION = 1

These values must be updated manually when fragjan supports a new
primitive API version -- easy to forget, wrong place for configuration.

Fix

Move to config/fragjan.conf:

[primitives]
min_api_version = 1
max_api_version = 1

Pass via cfg -> ctx into capabilities.check_primitive.

Acceptance criteria

  • No hardcoded version numbers in capabilities.lua
  • Values come from cfg (loaded from fragjan.conf)
  • Changing supported api_version range requires only config change
## Problem `core/validator/capabilities.lua` hardcodes the supported primitive api_version range: ```lua local MIN_API_VERSION = 1 local MAX_API_VERSION = 1 ``` These values must be updated manually when fragjan supports a new primitive API version -- easy to forget, wrong place for configuration. ## Fix Move to `config/fragjan.conf`: ```ini [primitives] min_api_version = 1 max_api_version = 1 ``` Pass via `cfg` -> `ctx` into `capabilities.check_primitive`. ## Acceptance criteria - [ ] No hardcoded version numbers in capabilities.lua - [ ] Values come from cfg (loaded from fragjan.conf) - [ ] Changing supported api_version range requires only config change
Author
Owner

core/modules.lua: BUILTINS table is hardcoded in code. Same problem as MIN_API_VERSION -- adding a new builtin requires a code change. Should come from config.

core/modules.lua: BUILTINS table is hardcoded in code. Same problem as MIN_API_VERSION -- adding a new builtin requires a code change. Should come from config.
michael added this to the Basic Version milestone 2026-05-30 16:05:00 +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#60
No description provided.