Skip to content

#131 update focus validator to support focus 1.3 requirements modelling and entity type Object.#132

Open
mike-finopsorg wants to merge 3 commits intodevfrom
131-update-focus-validator-to-support-focus-13-requirements-modelling
Open

#131 update focus validator to support focus 1.3 requirements modelling and entity type Object.#132
mike-finopsorg wants to merge 3 commits intodevfrom
131-update-focus-validator-to-support-focus-13-requirements-modelling

Conversation

@mike-finopsorg
Copy link
Contributor

Signed-off-by: Mike Fuller mike@finops.org

@mike-finopsorg mike-finopsorg self-assigned this Feb 19, 2026
@mike-finopsorg mike-finopsorg added this to the 2.1 milestone Feb 19, 2026
@mike-finopsorg mike-finopsorg added the enhancement New feature or request label Feb 19, 2026
…and entity type Object.

Signed-off-by: Mike Fuller <mike@finops.org>
Signed-off-by: Mike Fuller <mike@finops.org>
@mike-finopsorg mike-finopsorg force-pushed the 131-update-focus-validator-to-support-focus-13-requirements-modelling branch from ce54958 to 7ad49d7 Compare February 26, 2026 03:12
Signed-off-by: Mike Fuller <mike@finops.org>
@mike-finopsorg
Copy link
Contributor Author

Ready for your review @Matt-Cowsert, after which we can move to release v2.1.0

Copy link
Collaborator

@Matt-Cowsert Matt-Cowsert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generator architecture for the JSON checks makes sense — consistent pattern across array and single-value paths, and using SkippedMissingGeneratorCheck instead of crashing on unknown check functions feels like the right call for forward compatibility.

Version bump and outputter_web.py changes look clean.

Non-blocking comments

1. Inconsistent brace patterns in SQL templates

Some generators use {{table_name}} (double braces in the f-string) and others use {{{{table_name}}}} (quadruple). Both work because the downstream .replace() on lines 4890-4891 and 5986-5987 handles both patterns, but the inconsistency could trip up future contributors. Worth standardizing on one pattern.

Quadruple-brace generators: JSONCheckPathNumericFormatGenerator, JSONCheckPathUnitFormatGenerator, JSONCheckPathDistinctParentGenerator, FormatJSONFormatGenerator (8 occurrences total).

2. _generate_unit_format_regex duplicated across classes

The ~50-line unit format regex builder is copy-pasted identically in JSONCheckPathUnitFormatGenerator and JSONFormatUnitGenerator (and presumably the existing FormatUnitGenerator). If the FOCUS unit spec evolves, three places need updating. Consider extracting to a module-level function.

3. Near-duplicate generator pairs

JSONFormatNumericGenerator / JSONCheckPathNumericFormatGenerator and JSONFormatUnitGenerator / JSONCheckPathUnitFormatGenerator are structurally identical. A shared base class could cut ~400 lines.

4. No tests for the 14 new generators

The JSON path validation logic (array vs. single, null handling, type detection) has enough edge cases that unit tests would add real value. Not blocking for initial merge, but worth tracking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR] Create 1.3 Requirements Model enablement artifacts

2 participants