Skip to content

docs(rfc): draft RFC 0042 — typed numeric promotion (RFC 0022 amendment) - #647

Merged
jensholdgaard merged 2 commits into
mainfrom
rfc/0042-typed-numeric-promotion
Jul 26, 2026
Merged

docs(rfc): draft RFC 0042 — typed numeric promotion (RFC 0022 amendment)#647
jensholdgaard merged 2 commits into
mainfrom
rfc/0042-typed-numeric-promotion

Conversation

@jensholdgaard

Copy link
Copy Markdown
Owner

Why

Enacts RFC 0022 §7.1, whose deferral clause — "deferred until a consumer demands it" — has been met. The FinOps loop's headline query is sum(attr.cost_usd) by attr.model; cost_usd arrives as a double AnyValue, and RFC 0022 §3.1 pins promotion to string values only, projecting everything else as NULL.

Found the honest way: #646 (now drafted, blocked on this RFC) promoted the key config-only, and review caught that the result would be an always-NULL column with sum silently returning empty — strictly worse than today's loud promotion-hint error.

Design in one breath

Per-key type declarations — - { key: cost_usd, type: f64 } — producing OPTIONAL Int64/Float64 columns under the same DSL-path names, with numeric min/max pruning for ordering and cast-free RFC0002.17 aggregation. Bare-string entries stay byte-for-byte RFC 0022.

The load-bearing calls, each with its §-reference:

Call Rule
Strings never parse into numeric columns §3.1's "byte-faithful or NULL" — coercion ambiguity stays out
f64 widens ints; i64 never narrows doubles sources are inconsistent about 0 vs 0.0; no silent truncation
Re-typing conflict (same column name, Utf8 in old files, Int64 now) mismatched column reads as absent — the exact class §3.3 already assigns pre-amendment files; schema-adapter seam, no coercion
Float == is typed-arm-only JSON text has no canonical float form; a fallback arm would be wrong both directions
sum over an all-NULL group returns NULL, not 0 now load-bearing: an unpromotable variant must not fabricate a zero cost

Scope boundary carried in §2

Maintainer direction (this session): the source computes cost, Ourios stores/attributes/aggregates it, consumers own pricing tables and FOCUS-shaped output. Typed promotion is deliberately the whole of Ourios's share.

Status

drafted. §5 has nine criteria (projection totality by proptest over AnyValue variants × classes; the three-file absent/mismatched scan; compaction re-projection across a re-typing; the dogfood sum(attr.cost_usd) corpus gate as RFC0042.9). Implementation follows the ladder after this merges; #646 lands as a slice of it.

Invariants

Doc-only. Touches hazard #5 (schema evolution) on paper: §3.6 keeps the additive-OPTIONAL class and names the one new conflict case with its migration rule. mdbook build clean; §3.1/§3.3/§7.1 quotes and the RFC0002.17 try_cast behaviour re-verified against the current tree.

Enacts RFC 0022 §7.1, whose deferral clause ("deferred until a
consumer demands it") is now met: the FinOps loop's headline query is
sum(attr.cost_usd) by attr.model, and cost_usd arrives as a double
AnyValue, which §3.1 projects as NULL. Found via review on #646 — the
config-only promotion would have made an always-NULL column and a
silently empty sum.

Two classes (i64, f64) as per-key type declarations; f64 widens ints,
nothing parses strings; the cross-file re-typing conflict resolves by
the same rule §3.3 gives pre-amendment files (mismatched column reads
as absent, via the schema-adapter seam, no coercion); float equality
is typed-arm-only because JSON has no canonical float text; aggregates
read the typed column cast-free; an all-NULL group sums to NULL, never
a fabricated zero cost.

Nine §5 criteria incl. projection totality by proptest over AnyValue
variants x classes, the three-file absent/mismatched scan, compaction
re-projection across a re-typing, and the dogfood consumer query as
the corpus gate.

Signed-off-by: Jens Holdgaard Pedersen <Jens@holdgaard.org>
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@jensholdgaard, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 37 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 31a4b31e-1651-4df9-8009-b5bf88acd9dc

📥 Commits

Reviewing files that changed from the base of the PR and between bb54780 and 3af2aac.

📒 Files selected for processing (2)
  • docs/SUMMARY.md
  • docs/rfcs/0042-typed-numeric-promotion.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rfc/0042-typed-numeric-promotion

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a drafted design RFC that amends RFC 0022 to support promoting numeric OTLP attributes into typed Parquet columns, primarily to enable correct/prunable numeric predicates and cast-free scalar aggregation (e.g., sum(attr.cost_usd) by attr.model). Updates the mdBook SUMMARY so the new RFC is discoverable in the documentation set.

Changes:

  • Add RFC 0042 describing per-key typed promotion (i64/f64) alongside existing string promotion, including conflict handling for re-typing across files.
  • Document predicate compilation rules and aggregation semantics for typed columns, plus acceptance criteria and testing strategy.
  • Register the new RFC in docs/SUMMARY.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
docs/SUMMARY.md Adds a navigation entry for RFC 0042 in the RFC list.
docs/rfcs/0042-typed-numeric-promotion.md Introduces drafted RFC 0042 specifying typed numeric attribute promotion as an RFC 0022 amendment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/SUMMARY.md Outdated
Comment thread docs/rfcs/0042-typed-numeric-promotion.md Outdated
… title

Seven bare §-references read as self-references where the referent is
RFC 0022 (or, in one case, genuinely this RFC); each now names its
document. SUMMARY link text matches the RFC title per the convention
of dropping only the amendment parenthetical.

Signed-off-by: Jens Holdgaard Pedersen <Jens@holdgaard.org>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@jensholdgaard
jensholdgaard merged commit c017e42 into main Jul 26, 2026
28 checks passed
@jensholdgaard
jensholdgaard deleted the rfc/0042-typed-numeric-promotion branch July 26, 2026 19:34
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.

2 participants