Fixture inconsistency: DecimalTenthStep and QuantityFractionalTooBig disagree on scale-9 Decimal literals
メンテナーはふだん 5 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- xml
- 領域
- testing-qa
調査の方向性
Start by reading the four fixtures in tests/cql/ValueLiteralsAndSelectors.xml and tests/cql/CqlTypesTest.xml alongside CQL 1.5.2 §9 and the two proposed resolutions. Reproduce the conflict with the cql-tests runner so you can see how DecimalTenthStep and QuantityFractionalTooBig disagree under a reject-scale-9 policy. Done means the corpus adopts one policy consistently, either by changing QuantityFractionalTooBig to an 8-decimal literal or by removing invalid="true" from the TenthStep fixtures and adding matching output.
索引モデルが issue の本文から書いたものです。
説明
Summary
Two fixtures in the published conformance corpus assert incompatible oracles for Decimal literals exceeding CQL 1.5.2 §9's "maximum of 8 decimal places of precision" rule. The two expressions use exactly 9 fractional digits and reach the same parse path, but their <output> oracles disagree on whether that should be an error or a passing exact value. No engine policy on scale-9 Decimal literals can satisfy both fixtures simultaneously.
The two fixtures
File: tests/cql/ValueLiteralsAndSelectors.xml
<test name="DecimalTenthStep" invalid="true">
<expression>0.000000001</expression>
</test>
<test name="DecimalPosTenthStep" invalid="true">
<expression>+0.000000001</expression>
</test>
<test name="DecimalNegTenthStep" invalid="true">
<expression>-0.000000001</expression>
</test>
File: tests/cql/CqlTypesTest.xml
<test name="QuantityFractionalTooBig">
<expression>5.999999999 'g'</expression>
<output>5.999999999 'g'</output>
</test>
The three TenthStep fixtures expect the engine to raise an error on a scale-9 Decimal literal. QuantityFractionalTooBig expects the engine to succeed and return a scale-9 Quantity whose value carries the same 9-decimal fractional component.
Normative context
CQL 1.5.2 §9 "Types" (https://cql.hl7.org/09-b-cqlreference.html#types):
Decimal. The Decimal type represents real values in the range (−10^28..10^28) with a maximum of 8 decimal places of precision.
Both expressions are scale-9 Decimal literals, so both exceed this rule. There is no sub-clause that exempts Quantity-wrapped Decimal literals from the 8-decimal precision bound; the Quantity type's value component is specified as Decimal.
Why this is an inconsistency, not two separable oracles
Both expressions reach the engine's Decimal parser along the same code path: the ELM translator emits a Decimal literal whose value is parsed by the runtime's from-string equivalent, regardless of whether the literal appears bare or inside a Quantity. The Quantity type's value component is a Decimal; there is no Quantity-specific parser that bypasses the 8-decimal rule.
- An engine policy of "reject scale > 8" closes the three
TenthStepcases (correctly raises an error) but breaksQuantityFractionalTooBig(which expects success). - An engine policy of "accept scale > 8" passes
QuantityFractionalTooBigbut fails the threeTenthStepcases (no error is raised).
A single uniform policy at the Decimal parse layer cannot satisfy both.
Repro
Build an engine that implements the §9 precision bound at Decimal parse time (e.g. reject or return Null on scale > 8). Run the four cases through the cql-tests runner:
DecimalTenthStep/DecimalPosTenthStep/DecimalNegTenthStepreturnNullor raise; the fixture oracle isinvalid="true"which classifies as "expected error of category True".Nullis not "error"; raising matches.QuantityFractionalTooBigfails because the Quantity constructor chain encounters a rejected Decimal component.
Alternatively, build an engine that accepts scale > 8 verbatim: all four cases now disagree with their respective oracles in the opposite direction.
Observed behaviour across first-party engines
Both CQFramework reference engines (Java engine 5.6.1 via $cql, cql-execution 4.0.0-beta.1) accept scale-9 Decimal literals as valid and return them without error. Neither implements the §9 bound as a parse-time rejection. The three TenthStep fixtures' invalid="true" oracle is currently not matched by either first-party engine.
Proposed resolutions
Either direction unblocks a consistent engine policy; the fixture suite needs to pick one.
-
Strict (direct §9 reading). Rewrite
QuantityFractionalTooBigso its expression uses an 8-decimal-or-fewer Decimal (e.g.5.99999999 'g'), or setinvalid="true"and remove<output>. This preserves theTenthStepfamily's error-expectation and makes the §9 precision bound enforceable uniformly at the Decimal layer. -
Permissive (observed-engine reading). Drop
invalid="true"from the threeTenthStepfixtures and add<output>0.000000001</output>(or<output>0</output>under aroundedreading). This acknowledges that multiple first-party engines accept scale > 8 via their underlying numeric representation and that the §9 bound is treated as a presentation rule rather than a parse-time rule.
Prior investigation
An empirical attempt at the strict policy (reject scale > 8 at the decimal.from-string layer) against the full 2037-case corpus produced 0 net recoveries and 1 regression (the QuantityFractionalTooBig case). Investigation receipt at docs/engineering/dec-01-decimal-precision-enforcement-blocked-receipt-2026-11-24.md in the originating repo.
Related upstream filing from the same investigation family: #1953 in cqframework/clinical_quality_language (cql-to-elm Divide function-call form missing libraryName=System).
- 主要言語
- 言語のデータがありません
- スター
- 8
- フォーク
- 9
- 平均マージ
- 4日 2時間
- マージ済み PR(30日)
- 3
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cqframework/cql-tests のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
cqframework/cql-tests#182 ·
メンテナーはふだん 5 日以内に返信
-
CqlComparisonOperatorsTest: NotEquivalentNullNull marks `null !~ null` invalid, where the specification gives it as false対応中かも @leftonmars が 13 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
cqframework/cql-tests#172 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
cqframework/cql-tests#170 ·
メンテナーはふだん 5 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
cqframework/cql-tests#158 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
cqframework/cql-tests#157 ·
メンテナーはふだん 5 日以内に返信
cqframework/cql-tests の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
hermes hooks doctor smoke test never checks the hook exit code — a crashing hook (exit=1) renders ✓ "ran clean" and "All shell hooks look healthy"対応中かも @cestercian が今日担当しました。 オープンcomp/cli P2 type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
NousResearch/hermes-agent#162259 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area: ui priority: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
tetsuji16/microProject#1721 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
sagemathinc/sagebrush-agent#230 ·
メンテナーはふだん 1 日以内に返信
-
[fullsend] E2E: extensions — spec asserts extensions 1.2.0 UI but nightly deploys the RHDH-bundled extensions plugin対応中かも @fullsend-ai-coder が今日担当しました。 オープンe2e-failure ready-to-code
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
redhat-developer/rhdh-plugin-export-overlays#4969 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信