Skip to content

BKG 2.0, EBL 3.0: Improve OOGDetails description - #642

Merged
HenrikHL merged 2 commits into
masterfrom
OOGDetails_minValue
Aug 5, 2026
Merged

BKG 2.0, EBL 3.0: Improve OOGDetails description#642
HenrikHL merged 2 commits into
masterfrom
OOGDetails_minValue

Conversation

@HenrikHL

@HenrikHL HenrikHL commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

BKG 2.0 / EBL 3.0: Clarify OOGDetails description and enforce non-negative values

✨ Enhancement 📝 Documentation 🕐 10-20 Minutes

Grey Divider

AI Description

• Clarify OOGDetails schema description to better reflect equipment-unit association.
• Add minimum: 0 constraints to measurement value fields across BKG/EBL/PINT specs.
• Align validation rules between EBL core, issuance, and PINT artifacts.
Diagram

graph TD
  C["API consumers/validators"] --> S1["BKG v2.0.5 spec"] --> O["OOGDetails schema"] --> V["Measurement value (min 0)"]
  C --> S2["EBL v3.0.4 spec"] --> O --> V
  C --> S3["EBL ISS v3.0.4 spec"] --> O --> V
  C --> S4["EBL PINT v3.0.0 spec"] --> O --> V
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Factor shared schemas into a single source of truth
  • ➕ Avoids repeating OOGDetails/measurement constraints across multiple artifacts
  • ➕ Reduces drift risk between EBL core/issuance/PINT variants
  • ➕ Makes future schema tightening (e.g., min/max, units) easier to apply consistently
  • ➖ Requires a build/publish step (bundling) or cross-file $ref strategy
  • ➖ May complicate consumer tooling if external refs are not supported uniformly
2. Introduce a dedicated NonNegativeMeasurement schema and $ref it
  • ➕ Keeps the change localized and explicit
  • ➕ Improves readability and reuse within each spec
  • ➖ Still duplicates across multiple spec files unless combined with shared-source approach

Recommendation: Current approach is appropriate for a targeted alignment: it is minimal, backwards-compatible for valid payloads, and improves validation immediately. If future PRs continue to touch the same schemas across BKG/EBL/ISS/PINT, consider consolidating shared components (or a reusable NonNegativeMeasurement schema) to reduce cross-artifact drift.

Files changed (4) +7 / -3

Enhancement (4) +7 / -3
BKG_v2.0.5.yamlEnforce non-negative measurement value +1/-0

Enforce non-negative measurement value

• Adds 'minimum: 0' to the numeric 'value' field in the relevant measurement schema, preventing negative measurement values in BKG v2.0.5.

bkg/v2/BKG_v2.0.5.yaml

EBL_v3.0.4.yamlClarify OOGDetails description and add value minimum +2/-1

Clarify OOGDetails description and add value minimum

• Updates the Out of Gauge Details description to explicitly associate OOG cargo with the equipment unit. Adds 'minimum: 0' to the measurement 'value' field to enforce non-negative values.

ebl/v3/EBL_v3.0.4.yaml

EBL_ISS_v3.0.4.yamlAlign issuance OOGDetails description and value minimum +2/-1

Align issuance OOGDetails description and value minimum

• Matches the OOGDetails description wording with the updated EBL spec. Adds 'minimum: 0' to the measurement 'value' field for consistent validation in issuance artifacts.

ebl/v3/issuance/EBL_ISS_v3.0.4.yaml

EBL_PINT_v3.0.0.yamlAlign PINT OOGDetails description and enforce value minimum +2/-1

Align PINT OOGDetails description and enforce value minimum

• Updates the OOGDetails description to reflect equipment-unit association. Adds 'minimum: 0' to the measurement 'value' field (ordering differs slightly but semantics match).

pint/v3/EBL_PINT_v3.0.0.yaml

@qodo-code-review

qodo-code-review Bot commented Aug 5, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Offsets forced non-negative ✓ Resolved 🐞 Bug ≡ Correctness
Description
The PR adds minimum: 0 to the shared Measurement.value schema, but Measurement is also used
for center-of-gravity longitudinal/transverse/vertical offsets; this makes negative offsets invalid
and will break schema validation for payloads that express offsets relative to mid/top reference
points. This impacts multiple specs (BKG v2, EBL v3, EBL issuance, PINT) because they all reuse the
same Measurement schema for offsets.
Code

ebl/v3/EBL_v3.0.4.yaml[R9672-9676]

        value:
          type: number
          format: float
+          minimum: 0
          description: |
Evidence
Measurement is referenced by center-of-gravity offset fields, while the reference point enum
includes middle/top positions—cases where signed offsets are necessary. Adding minimum: 0 to
Measurement.value therefore constrains these offsets across all the modified specs.

ebl/v3/EBL_v3.0.4.yaml[9641-9661]
ebl/v3/EBL_v3.0.4.yaml[9666-9676]
bkg/v2/BKG_v2.0.5.yaml[6967-7006]
bkg/v2/BKG_v2.0.5.yaml[7008-7028]
bkg/v2/BKG_v2.0.5.yaml[7033-7045]
ebl/v3/issuance/EBL_ISS_v3.0.4.yaml[2726-2742]
pint/v3/EBL_PINT_v3.0.0.yaml[3362-3382]
pint/v3/EBL_PINT_v3.0.0.yaml[3387-3399]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`minimum: 0` was added to `#/components/schemas/Measurement/properties/value`, but `Measurement` is reused for center-of-gravity offsets. Offsets can legitimately be negative when measured from mid/top reference points, so the shared constraint is too strict.

### Issue Context
In these specs, `CenterOfGravity` includes a `referencePoint`/`location` enumeration that includes *middle* and *top* reference points (e.g., `TOP_CENTER_CENTER`, `MIDDLE_CENTER_CENTER`). Offsets relative to such reference points need to support signed values.

### Fix Focus Areas
- ebl/v3/EBL_v3.0.4.yaml[9641-9678]
- bkg/v2/BKG_v2.0.5.yaml[6967-7045]
- ebl/v3/issuance/EBL_ISS_v3.0.4.yaml[2726-2742]
- pint/v3/EBL_PINT_v3.0.0.yaml[3362-3400]

### Suggested approach
1. Remove `minimum: 0` from the shared `Measurement.value` schema.
2. Introduce a new schema (e.g., `NonNegativeMeasurement`) that `allOf`-references `Measurement` and constrains `value` with `minimum: 0`.
3. Update only the fields that are inherently non-negative (dimensions, overhang distances, etc.) to use `NonNegativeMeasurement`, while keeping offsets on the signed `Measurement`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

Comment thread ebl/v3/EBL_v3.0.4.yaml
@HenrikHL HenrikHL changed the title BKG 2.0, EBL 3.0: Improve OOGDetails description and set min value BKG 2.0, EBL 3.0: Improve OOGDetails description Aug 5, 2026
@HenrikHL
HenrikHL merged commit 44df8f7 into master Aug 5, 2026
1 check passed
@HenrikHL
HenrikHL deleted the OOGDetails_minValue branch August 5, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant