Skip to content

feat(server): rfc 0022 green pt4 — storage.promoted_attributes config plumbing, status → green - #348

Merged
jensholdgaard merged 5 commits into
mainfrom
rfc0022-green-pt4
Jul 3, 2026
Merged

feat(server): rfc 0022 green pt4 — storage.promoted_attributes config plumbing, status → green#348
jensholdgaard merged 5 commits into
mainfrom
rfc0022-green-pt4

Conversation

@jensholdgaard

@jensholdgaard jensholdgaard commented Jul 3, 2026

Copy link
Copy Markdown
Owner

RFC 0022 green pt4 — the storage.promoted_attributes config plumbing (§3.2), completing the RFC's operator-facing surface. Flips the RFC status redgreen: all seven §5 scenarios pass (writer .1/.2 #345, query-side .3/.4/.6 #346, pruning/drift .5/.7 #347) and the knob the spec promises now exists end-to-end.

What

Phase A — config schema + resolution (ourios-server):

  • storage.promoted_attributes.{resource,log} on the strict RFC 0020 schema (deny_unknown_fields sub-section). Elements get the scalar treatment via a new scalar_vec (the scalar_opt model applied per element, RFC 0020 §3.3 rule 7), and ${env:…} substitution applies per element in StorageSection::substitute.
  • A build_promoted_attributes validator resolves the key lists onto ServerConfig (empty keys — e.g. a reference that resolved to nothing — are a config error; dedup and the implicit service.name stay PromotedAttributes::new's contract). The env-only path keeps the default set: the RFC adds a file key, not an OURIOS_* variable.

Phase B — threading to every write path:

  • Receiver/ingest: ReceiverConfig.promotedbuild_write_sinksParquetRecordSink::with_promoted_attributes(..) (builder, matching with_audit_barrier). Both encode sites switch to encode_records_to_parquet_with_promoted: the locked flush (flush_partition) and the off-lock publish (publish_partition gains the parameter; publish_owned captures the set alongside the store handle).
  • Compaction (§3.4): previously compact_partition hardcoded the default set via Writer::open_in, so a rewrite would have silently dropped configured promoted columns — the opposite of §3.4's "re-projects with the current set". New compact_partition_with_promoted / run_sweep_with_promoted variants (the bare names delegate with the default set, the established _with_promoted convention), Compactor::with_promoted_attributes(..), and the server threads the resolved set into both roles.

Tests

  • Config: parse + per-element env substitution, empty default, strict unknown-key rejection inside the sub-section, scalar-where-list schema error (file.rs); resolution onto ServerConfig + empty-key rejection (main.rs).
  • Sink threading: a new ourios-ingester integration suite pins that both write paths (locked flush_all, off-lock publish_owned) project the configured set into flushed files (schema read back via a parquet dev-dep, version in lockstep with the arrow stack).
  • Compaction: a compaction.rs test consolidates default-set inputs under a configured set and asserts the consolidated file carries the configured column + the implicit service.name (§3.4 convergence).

Invariants / hazards (CLAUDE.md §3/§4)

  • §3.5 schema evolution: additive OPTIONAL columns only, per RFC 0022 §3.4 — no historical rewrite required; compaction convergence is a side effect, nothing depends on it.
  • §3.2 rollout ordering (RFC 0022): unchanged — strict parsing means a config carrying the key requires a binary at or above this change; upgrade first, extend the config second.
  • Hazard docs: apply RFC maturity-model amendments #2 (cardinality): the set stays opt-in per key; defaults unchanged (empty beyond service.name).
  • Hazard docs: apply RFC maturity-model amendments #4 (small files / wide schema): default floor unchanged.
  • Tests are specifications: all additions; no existing test weakened or deleted.

Verification

cargo fmt --all --check, cargo clippy --all-targets --all-features -- -D warnings, cargo test --all-features, mdbook build (status frontmatter change) — all green locally.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added support for configured “promoted attributes” in server storage settings.
    • Promoted columns now flow through ingestion, receiving, and compaction so relevant data appears in Parquet output.
    • Queryable Parquet files can now include both explicitly promoted attributes and related resource fields.
  • Bug Fixes

    • Improved schema handling during flush and compaction to preserve promoted fields consistently across execution paths.
  • Documentation

    • Updated the RFC status to reflect completion.

jensholdgaard and others added 3 commits July 4, 2026 00:22
…3.2)

The RFC 0020 schema extension: a strict promoted_attributes sub-section
under storage.* with per-element ${env:...} substitution (scalar_vec —
the scalar_opt model applied per list element), resolved onto
ServerConfig via a build_promoted_attributes validator (empty keys are a
config error; dedup + the implicit service.name stay the
PromotedAttributes contract). Env-only config keeps the default set —
the RFC adds a file key, not an OURIOS_* variable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…22 §3.2/§3.4)

ReceiverConfig -> build_write_sinks -> the record sink's new
with_promoted_attributes builder; both encode sites (the locked
flush_partition and the off-lock publish_partition) switch to
encode_records_to_parquet_with_promoted. Compaction previously
hardcoded the default set via Writer::open_in, so a rewrite would have
silently dropped configured promoted columns — the opposite of §3.4's
re-projection; compact_partition_with_promoted / run_sweep_with_promoted
now carry the set (the bare names delegate with the default, per the
_with_promoted convention) and the server threads the resolved set into
both roles. Threading pinned by tests on both sink paths and on the
consolidated compaction output.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jensholdgaard
jensholdgaard requested a review from Copilot July 3, 2026 22:23
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 43 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: 8adba762-dc18-4c54-96a6-f34e4fbd4f88

📥 Commits

Reviewing files that changed from the base of the PR and between 1934aeb and 6f4dbb8.

📒 Files selected for processing (3)
  • crates/ourios-ingester/Cargo.toml
  • crates/ourios-ingester/src/compactor.rs
  • crates/ourios-server/src/main.rs
📝 Walkthrough

Walkthrough

This PR implements RFC 0022 §3.2/§3.4 by introducing a PromotedAttributes configuration set that flows from server YAML config through ReceiverConfig and Compactor into Parquet encoding and compaction functions (compact_partition_with_promoted, encode_records_to_parquet_with_promoted, Writer::open_in_with_promoted), replacing default-only column projection with a configurable attribute set, plus new config schema, tests, and an RFC status update.

Changes

Promoted attributes threading

Layer / File(s) Summary
Parquet compaction and writer promoted-attribute API
crates/ourios-parquet/src/compaction.rs, crates/ourios-parquet/src/lib.rs
compact_partition delegates to new compact_partition_with_promoted, which opens the consolidated writer via Writer::open_in_with_promoted; new function is re-exported and tested.
Ingester compactor uses promoted attributes
crates/ourios-ingester/src/compactor.rs, crates/ourios-ingester/src/lib.rs
Compactor gains a promoted field, with_promoted_attributes builder, and run_sweep_with_promoted entry point used during sweeps; both run_sweep variants re-exported.
Record sink promoted-attribute encoding and tests
crates/ourios-ingester/src/record_sink.rs, crates/ourios-ingester/Cargo.toml, crates/ourios-ingester/tests/rfc0022_promoted_threading.rs
ParquetRecordSink/SharedParquetSink carry a promoted field used in flush/publish encoding; new dev-dependency and integration tests verify schema projection on both flush paths.
Server config schema for promoted attributes
crates/ourios-server/src/config/file.rs
StorageSection gains promoted_attributes (resource/log lists) with a scalar_vec deserializer supporting env substitution and validation tests.
Server main and receiver wiring of promoted attributes
crates/ourios-server/src/main.rs, crates/ourios-server/src/receiver.rs
ServerConfig.promoted is built via build_promoted_attributes and passed into ReceiverConfig and Compactor; build_write_sinks propagates it into ParquetRecordSink.
RFC 0022 status update
docs/rfcs/0022-queryable-attribute-columns.md
RFC status metadata changed from red to green.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Main as ourios-server main
  participant Config as ServerConfig
  participant Receiver
  participant Compactor
  participant Writer as ourios-parquet Writer

  Main->>Config: build_promoted_attributes(resource, log)
  Config-->>Main: PromotedAttributes
  Main->>Receiver: ReceiverConfig { promoted }
  Main->>Compactor: with_promoted_attributes(promoted)
  Receiver->>Receiver: build_write_sinks(store, promoted)
  Receiver->>Writer: encode_records_to_parquet_with_promoted(promoted)
  Compactor->>Writer: compact_partition_with_promoted(promoted) -> open_in_with_promoted
  Writer-->>Compactor: consolidated file with promoted columns
Loading

Possibly related PRs

  • jensholdgaard/ourios#243: Extends the same ParquetRecordSink flush encoding path in crates/ourios-ingester/src/record_sink.rs.
  • jensholdgaard/ourios#245: Builds on the same SharedParquetSink buffering/publish plumbing in record_sink.rs extended here for promoted attributes.
  • jensholdgaard/ourios#345: Wires the same promoted-attribute writer APIs (encode_records_to_parquet_with_promoted, Writer::open_in_with_promoted, PromotedAttributes) through the ingester/compactor/server.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Clear and specific; it matches the main change of plumbing storage.promoted_attributes through server and write paths.
Description check ✅ Passed It covers the summary, RFC linkage, tests, and verification, but it doesn't follow the template's exact Summary/Related/Checklist headings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rfc0022-green-pt4

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

This PR completes the operator-facing RFC 0022 plumbing for storage.promoted_attributes by extending the strict server config schema, resolving/promoting key sets onto the runtime ServerConfig, and threading the resulting PromotedAttributes through all write paths (receiver flush/publish and compaction rewrites). It also flips RFC 0022’s status from red to green to reflect that the end-to-end surface and scenarios are now implemented and tested.

Changes:

  • Extend ourios-server file config schema with storage.promoted_attributes.{resource,log} including per-element scalar parsing and ${env:...} substitution, then validate/resolve onto ServerConfig.
  • Thread PromotedAttributes through receiver sinks and ingester write paths so both flush and off-lock publish project the configured promoted columns.
  • Make compaction re-project rewritten output under the current promoted set via _with_promoted variants, and add targeted tests.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
docs/rfcs/0022-queryable-attribute-columns.md Flip RFC 0022 status frontmatter red → green.
crates/ourios-server/src/receiver.rs Plumb PromotedAttributes into receiver sink construction and tests.
crates/ourios-server/src/main.rs Resolve storage.promoted_attributes onto ServerConfig and thread into receiver + compactor.
crates/ourios-server/src/config/file.rs Add strict config schema for promoted attributes, scalar list parsing, and per-element env substitution.
crates/ourios-parquet/src/lib.rs Re-export promoted-aware compaction entrypoint.
crates/ourios-parquet/src/compaction.rs Add compact_partition_with_promoted and ensure compaction uses promoted-aware writer; add test.
crates/ourios-ingester/src/record_sink.rs Add promoted set to sink; use promoted-aware encoding in both flush and publish paths.
crates/ourios-ingester/src/compactor.rs Add promoted-aware sweep/compaction wiring and Compactor::with_promoted_attributes.
crates/ourios-ingester/src/lib.rs Re-export promoted-aware sweep function.
crates/ourios-ingester/tests/rfc0022_promoted_threading.rs New integration tests asserting both write paths project the configured promoted set.
crates/ourios-ingester/Cargo.toml Add parquet dev-dependency for schema inspection in new test.
Cargo.lock Lockfile update to include the new dev-dependency.

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

Comment thread crates/ourios-ingester/Cargo.toml Outdated
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

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 11 out of 12 changed files in this pull request and generated 1 comment.

Comment thread crates/ourios-server/src/main.rs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/ourios-ingester/src/compactor.rs (1)

299-323: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Add a compactor-level promoted-set test. The current coverage exercises compact_partition_with_promoted and the sink threading paths, but not Compactor::with_promoted_attributes(...) itself. Add an end-to-end sweep test through this constructor and assert the consolidated Parquet file includes the configured promoted columns.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/ourios-ingester/src/compactor.rs` around lines 299 - 323, Add an
end-to-end compactor test that goes through Compactor::new and
Compactor::with_promoted_attributes instead of only
compact_partition_with_promoted. In the new test, configure a promoted set on
the Compactor, run a sweep/compaction path, and verify the resulting
consolidated Parquet file still contains the configured promoted columns. Use
the Compactor::with_promoted_attributes method and the existing compaction/sink
test helpers so the coverage exercises the constructor path directly.
🧹 Nitpick comments (2)
crates/ourios-ingester/Cargo.toml (1)

101-103: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Minor: inconsistent version-pinning style vs. neighboring tempfile dependency.

tempfile right above is exact-pinned ("=3.27.0"), while the new parquet dev-dependency uses a caret range ("58"). Not a functional issue (the workspace Cargo.lock still pins exact resolved versions), just a style inconsistency worth aligning if the project intends exact-pin discipline for dev-dependencies.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/ourios-ingester/Cargo.toml` around lines 101 - 103, The new parquet
dev-dependency uses a version range style that is inconsistent with the
exact-pinned tempfile entry nearby. Update the dependency declaration in
Cargo.toml to match the project’s pinning convention if exact pins are intended
for dev-dependencies, keeping the parquet entry aligned with the neighboring
dependency style and the existing ourios-parquet/arrow stack compatibility note.
crates/ourios-parquet/src/compaction.rs (1)

760-817: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider a property test for promoted-set reprojection.

This new test is example-based (one fixed key, one file pair). Given compact_partition_with_promoted is a "reconstruction" path over an explicit invariant (output schema = promoted-set columns + row conservation for arbitrary key sets), a proptest case generating varied resource-key sets alongside the existing compaction_conserves_every_row proptest would give stronger coverage of the RFC 0022 projection invariant across arbitrary promoted configurations.

As per coding guidelines, "Use property tests (proptest) for anything with an invariant: the template miner, the Parquet writer, the query planner. Reconstruction is always a property test."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/ourios-parquet/src/compaction.rs` around lines 760 - 817, The new
compaction reprojection test is example-based but the behavior is an invariant,
so strengthen it by turning the
`compaction_reprojects_under_the_given_promoted_set` coverage into a `proptest`
similar to `compaction_conserves_every_row`. Generate varied promoted key sets
and resource-attribute combinations, then assert through
`compact_partition_with_promoted` that the output schema always includes the
promoted columns plus the implicit `service.name` path and that row conservation
still holds.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@crates/ourios-ingester/src/compactor.rs`:
- Around line 299-323: Add an end-to-end compactor test that goes through
Compactor::new and Compactor::with_promoted_attributes instead of only
compact_partition_with_promoted. In the new test, configure a promoted set on
the Compactor, run a sweep/compaction path, and verify the resulting
consolidated Parquet file still contains the configured promoted columns. Use
the Compactor::with_promoted_attributes method and the existing compaction/sink
test helpers so the coverage exercises the constructor path directly.

---

Nitpick comments:
In `@crates/ourios-ingester/Cargo.toml`:
- Around line 101-103: The new parquet dev-dependency uses a version range style
that is inconsistent with the exact-pinned tempfile entry nearby. Update the
dependency declaration in Cargo.toml to match the project’s pinning convention
if exact pins are intended for dev-dependencies, keeping the parquet entry
aligned with the neighboring dependency style and the existing
ourios-parquet/arrow stack compatibility note.

In `@crates/ourios-parquet/src/compaction.rs`:
- Around line 760-817: The new compaction reprojection test is example-based but
the behavior is an invariant, so strengthen it by turning the
`compaction_reprojects_under_the_given_promoted_set` coverage into a `proptest`
similar to `compaction_conserves_every_row`. Generate varied promoted key sets
and resource-attribute combinations, then assert through
`compact_partition_with_promoted` that the output schema always includes the
promoted columns plus the implicit `service.name` path and that row conservation
still holds.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 460bdee1-6ce5-4547-84ca-13ab550a2a8d

📥 Commits

Reviewing files that changed from the base of the PR and between 3f08632 and 1934aeb.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (11)
  • crates/ourios-ingester/Cargo.toml
  • crates/ourios-ingester/src/compactor.rs
  • crates/ourios-ingester/src/lib.rs
  • crates/ourios-ingester/src/record_sink.rs
  • crates/ourios-ingester/tests/rfc0022_promoted_threading.rs
  • crates/ourios-parquet/src/compaction.rs
  • crates/ourios-parquet/src/lib.rs
  • crates/ourios-server/src/config/file.rs
  • crates/ourios-server/src/main.rs
  • crates/ourios-server/src/receiver.rs
  • docs/rfcs/0022-queryable-attribute-columns.md

… dev-dep

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

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 11 out of 12 changed files in this pull request and generated no new comments.

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