Skip to content

Athena: harden raw JSONL trace queries - #20

Merged
huronat merged 4 commits into
mainfrom
feat/parquet-traces
Jul 28, 2026
Merged

huronat merged 4 commits into
mainfrom
feat/parquet-traces

Conversation

@huronat

@huronat huronat commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • keep raw JSONL as the only authoritative trace store; remove the unused Parquet table, prefix, IAM grant, and proposal document
  • publish new chunks by event UTC day and maintain compact stream/day plus per-object event-time range indexes
  • query Athena with exact injected streams, physical days, and hidden $path predicates; unknown legacy objects remain conservative, never invisible
  • retain a mixed-version compatibility cursor so old trackers remain readable during rollout
  • fix job:* follow-up lookup, exact machine/source stream pruning, shared 45-second request deadlines, and standard Athena outcome metrics
  • report bucket raw/read-model freshness and require a compatible remote read-model format before HTTP readiness

No raw S3 object is moved, copied, rewritten, or deleted. Existing raw objects
remain queryable without a migration. A metadata-only range backfill is
recommended before broad historical use so legacy capture-day objects can be
pruned efficiently; it is not required for correctness.

Bounds and safety

  • read-only SELECT statements only
  • seven-day event-time window
  • 1,000 exact raw-object paths and 200,000 path-predicate bytes
  • 50,000 returned events and 64 MiB of returned envelopes
  • one 45-second Athena budget shared by every query in an MCP request
  • 20 GiB workgroup scan cutoff
  • MCP role remains bucket/Glue/Athena read-only

Validation

  • cargo test --locked — 295 passed
  • cargo test --locked --no-default-features — 274 passed
  • cargo test --locked --features s3,gcs,mcp-http,athena — 312 passed
  • cargo build --release --locked
  • HTTP MCP smoke — health, auth, initialize, tools, protocol, origin, rate limit, and TLS passed
  • Helm lint plus default/optional render and probe/egress assertions passed
  • both CloudFormation templates passed AWS validation
  • live raw-table aggregate: 4,692,308 events in one legacy physical day, spanning 2026-06-21 through 2026-07-22, scanned 7,650,211,000 bytes
  • live exact $path query against one immutable object returned 24 events and scanned 15,660 bytes
  • event-partitions/ and the old derived Parquet prefix were empty before this change; no bucket objects were written

Deployment

The code commit does not publish or roll out a binary. The existing
CloudFormation stacks can safely be updated from this PR to delete only the
empty trace_events_v1 Glue table and its IAM grant while retaining
synty.raw_events, the bounded workgroup, and the read-only MCP role.

Summary by CodeRabbit

  • New Features
    • Partition raw event storage/indexing by UTC event day (including correct delayed-event placement).
    • Improve trace querying with per-day/object pruning, a shared Athena time budget, and clearer limit/timeout outcomes.
    • Add bucket freshness surfaced across health/readiness/status, and include a published-at timestamp in read-model metadata.
  • Bug Fixes
    • More conservative coverage when partition/index metadata is missing or legacy, with safe fallbacks.
    • Refine readiness semantics when freshness/format compatibility checks fail.
  • Documentation
    • Update guidance on partition layout, pruning behavior, query limits/budgets, endpoint readiness/health requirements, and recommended metadata-only backfill.

Keep immutable JSONL authoritative while defining a schema-compatible Parquet projection and read-only MCP permission. A representative stream-day contains 2,438 chunks and 1.51 GB, so the separate layout enables compaction without moving raw data or changing the reader contract.

Validate the empty live table with a bounded Athena query that returns zero rows and scans zero bytes.
@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8059dc6b-db72-4942-a62e-54d161ec6ef2

📥 Commits

Reviewing files that changed from the base of the PR and between e770fa8 and 6042581.

📒 Files selected for processing (1)
  • src/event_partitions.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/event_partitions.rs

📝 Walkthrough

Walkthrough

Changes

The PR adds event-time partition indexes, updates event synchronization and storage to use per-day paths, and changes Athena queries to select indexed days and object paths under a shared deadline. It also adds bucket freshness metadata to readiness and CLI status reporting, with updated operational documentation.

Event-time storage and indexing

Layer / File(s) Summary
Partition index model and metadata
src/event_partitions.rs, src/main.rs
Adds stream and object indexes containing event-time ranges, legacy days, candidate selection, persistence, freshness scanning, and coverage tests.
Partitioned event publication and download
src/track.rs, src/sync.rs
Writes events by UTC event day, publishes immutable day-specific chunks with object indexes, and downloads using per-day cursors with legacy fallback support.

Athena and readiness

Layer / File(s) Summary
Athena selection and shared deadlines
src/trace_athena.rs
Propagates request deadlines through execution and pagination, selects candidate days and $path values, and updates SQL predicates and outcome classification.
Bucket freshness and readiness state
src/mcp.rs, src/mcp_http.rs, src/readmodel.rs, src/view.rs, src/tui.rs
Records bucket metadata and publication timestamps, requires a compatible remote read-model for readiness, and exposes freshness fields in HTTP and CLI status output.
Storage and query documentation
README.md, docs/design.md, deploy/aws/mcp-reader.yaml
Documents event-day storage, zero-copy Athena pruning, query limits, backfill behavior, readiness semantics, and the raw_events Glue table.

Sequence Diagram(s)

sequenceDiagram
  participant TraceClient
  participant Backend
  participant event_partitions
  participant AwsEventQuery
  participant Athena
  TraceClient->>Backend: trace request
  Backend->>event_partitions: resolve candidate days and objects
  event_partitions-->>Backend: day and raw object paths
  Backend->>AwsEventQuery: run SQL with shared deadline
  AwsEventQuery->>Athena: execute and paginate query
  Athena-->>AwsEventQuery: rows or classified outcome
  AwsEventQuery-->>Backend: query result and metrics
  Backend-->>TraceClient: trace response
Loading

Possibly related PRs

Suggested reviewers: svonava

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 52.24% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title concisely matches the PR’s main focus on hardening Athena raw JSONL trace queries.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/parquet-traces

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

coderabbitai[bot]
coderabbitai Bot previously requested changes Jul 27, 2026

@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.

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@deploy/aws/mcp-reader.yaml`:
- Around line 33-35: Constrain the GlueParquetTable parameter’s AllowedPattern
using the same table-name validation as the Athena stack, preventing `*` and
other values that expand the Glue resource grant beyond one table. Keep the
existing default value unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d0dfe9c9-79e4-48a7-a384-76ef1d26f5e2

📥 Commits

Reviewing files that changed from the base of the PR and between cc8ac53 and 0c4b944.

📒 Files selected for processing (6)
  • README.md
  • deploy/aws/athena-trace.yaml
  • deploy/aws/mcp-reader.yaml
  • docs/design.md
  • docs/parquet-traces.md
  • src/trace_athena.rs

Comment thread deploy/aws/mcp-reader.yaml Outdated
Replace the unused Parquet catalog with event-day and immutable-object range metadata, preserving the existing raw S3 objects while making delayed events queryable through exact Athena path pruning. The live path predicate reduced a representative scan from 7,650,211,000 bytes to 15,660 bytes.\n\nBound multi-query trace requests to one 45-second budget, 1,000 paths, 50,000 rows, and 64 MiB; normalize job ids, prune exact stream identities, expose bucket freshness, and retain mixed-version cursors. Validate 295 default, 274 no-default, and 312 cloud-feature tests plus Helm, HTTP MCP, and CloudFormation checks.
@huronat huronat changed the title Athena: add additive Parquet trace catalog Athena: harden raw JSONL trace queries Jul 28, 2026
@huronat
huronat dismissed coderabbitai[bot]’s stale review July 28, 2026 00:13

The sole finding is obsolete on 0515cc6: the Parquet parameter, table, and IAM grant were removed. CodeRabbit verified the reported wildcard path no longer applies in discussion_r3661785706.

coderabbitai[bot]
coderabbitai Bot previously requested changes Jul 28, 2026

@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.

Actionable comments posted: 10

Caution

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

⚠️ Outside diff range comments (2)
src/readmodel.rs (1)

83-90: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Test that repoint persists publication time.

The fixture-only updates do not exercise the new behavior. Add a scenario test that repoints a temporary model, reads current.json, and verifies published_at is a non-empty RFC3339 timestamp.

As per coding guidelines, “Every behavioral change must include a scenario-style unit test based on user expectations.”

🤖 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 `@src/readmodel.rs` around lines 83 - 90, Add a scenario-style unit test for
repoint that uses a temporary model directory, invokes repoint, reads and
deserializes current.json, and verifies published_at is non-empty and parses as
an RFC3339 timestamp. Keep the test focused on the persisted publication time
and follow existing test helpers and setup conventions.

Source: Coding guidelines

README.md (1)

215-218: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Document both Glue tables, not one.

The PR adds the versioned trace_events_v1 Parquet table while retaining the raw-events table, and grants the MCP role read-only access to both. This wording can lead to incomplete IAM permissions or an incorrect Athena deployment; name both tables and clarify which resources deploy/aws/athena-trace.yaml creates.

🤖 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 `@README.md` around lines 215 - 218, Update the README description of the
MCP-only workload to name both the raw-events table and the versioned
trace_events_v1 Parquet table, and state that the MCP role has read-only access
to both. Clarify that deploy/aws/athena-trace.yaml creates the external tables
and managed-results workgroup without write or crawl operations.
🧹 Nitpick comments (6)
src/trace_athena.rs (5)

483-499: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Empty object selection returns silently with no metric.

When selection.paths is empty the request short-circuits to zero rows without emitting an athena_trace metrics run, so "nothing selected" is indistinguishable from "never queried" in the [metrics athena_trace] stream. Emitting a run with outcome=empty keeps the health surface complete.

As per coding guidelines, "Health and quality operations must emit metrics through metrics::Run".

🤖 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 `@src/trace_athena.rs` around lines 483 - 499, The empty-selection branch in
the query method should emit a metrics::Run with outcome=empty before returning
zero rows. Update the branch guarded by selection.paths.is_empty() while
preserving the existing empty QueryRows result and normal query execution for
non-empty selections.

Source: Coding guidelines


550-565: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Test-only injection branch embedded in production selection.

self.days fabricates synthetic test.jsonl paths inside the production code path. It is reachable from Backend::new only via None, so it is safe today, but the fake-path construction is dead weight in the shipped binary. A #[cfg(test)] query/selection seam (or making selected_objects a trait method the tests stub) would keep the production path free of test scaffolding.

🤖 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 `@src/trace_athena.rs` around lines 550 - 565, The selected_objects method
embeds test-only synthetic path generation through self.days; move this
injection seam behind #[cfg(test)] or replace it with a test-stubbable selection
abstraction. Keep production selection free of the days field and test.jsonl
fabrication while preserving the existing test behavior through the chosen seam.

138-180: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

Only the deadline path stops the execution.

If get_query_execution itself errors (throttling, transient network), the loop bails while the Athena execution keeps running and scanning/billing. Routing every early exit from this loop through the same stop_query_execution call would make cancellation uniform.

🤖 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 `@src/trace_athena.rs` around lines 138 - 180, Update the polling loop around
get_query_execution so every early error exit, including polling failures and
query/status extraction errors, first attempts to stop the Athena execution
through the existing stop_query_execution call. Preserve the current timeout
cancellation and error context, and ensure cancellation is also attempted before
propagating any failure from the polling path.

1157-1192: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Test does not exercise the failing-open case it implies.

stream_pruning_uses_exact_machine_and_canonical_source_suffixes only covers recognized sources. Add a case with an unrecognized source/scope.sources value to pin down the intended behavior — today it returns every stream, which is the bypass flagged at Lines 523-542.

As per coding guidelines, "Every behavioral change must include a scenario-style unit test based on user expectations".

🤖 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 `@src/trace_athena.rs` around lines 1157 - 1192, The test
stream_pruning_uses_exact_machine_and_canonical_source_suffixes only covers
recognized sources; add a scenario with an unrecognized source and matching
scope.sources to verify selected_streams does not fail open by returning every
stream. Assert the expected user-facing result for the unknown source, while
preserving the existing recognized-source assertions.

Source: Coding guidelines


851-860: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Outcome classification is coupled to error prose.

query_outcome substring-matches on message text, so rewording any ensure!/bail! in this file silently reclassifies the metric (e.g. a limit message that drops the word "exceeds" becomes error). A typed error enum, or at minimum a constant shared by the message and the classifier, would keep the metric stable.

🤖 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 `@src/trace_athena.rs` around lines 851 - 860, Decouple query_outcome from
matching arbitrary error prose by introducing stable typed error categories or
shared constants for timeout and limit conditions, and use those identifiers
both when constructing errors and when classifying outcomes. Update
query_outcome and the relevant ensure!/bail! call sites in this module while
preserving the existing timeout, limit, and error outcome values.
src/event_partitions.rs (1)

265-285: 🚀 Performance & Scalability | 🔵 Trivial | ⚖️ Poor tradeoff

bucket_newest_event lists the entire event-partitions/ prefix, which grows unbounded with day/object-index count.

bucket.list(&format!("{PREFIX}/")) scans every key under event-partitions/, including one track.<day>.json object-index entry per (stream, day) ever recorded (filtered out client-side afterward). This scan cost grows linearly with total historical days across all streams, unlike the doc comment's claim of reading only "small per-stream metadata objects." Since this backs freshness reporting (status/readiness checks), it will get progressively slower for long-lived buckets. Consider tracking the stream set explicitly (e.g. reusing the EVENT_STREAMS registry already maintained in sync.rs) instead of deriving it from a full prefix listing.

🤖 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 `@src/event_partitions.rs` around lines 265 - 285, Update bucket_newest_event
to avoid scanning the entire event-partitions prefix; iterate the existing
EVENT_STREAMS registry from sync.rs and load each stream’s metadata object
directly. Preserve the current newest timestamp comparison and missing-index
handling while eliminating client-side filtering of historical day/object-index
keys.
🤖 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.

Inline comments:
In `@src/event_partitions.rs`:
- Around line 22-42: The EventTimeRange::record comparisons and related
newest-event selection compare variable-width AutoSi timestamp strings, which
can misorder whole-second and sub-second instants. Parse timestamps into
comparable DateTime values before updating min_ts/max_ts and selecting the
newest event, while preserving the stored timestamp representation and existing
invalid-value behavior. Add a scenario test covering events with both
whole-second and sub-second timestamps.

In `@src/mcp_http.rs`:
- Around line 436-440: Update the health response construction around
bucket_freshness_error so unauthenticated /health and /ready endpoints expose
only a stable generic error indicator instead of freshness.error.to_string().
Keep detailed bucket/provider diagnostics restricted to protected logging, while
preserving the existing freshness fields and response behavior.

In `@src/mcp.rs`:
- Around line 444-459: Update refresh_bucket_freshness to create a metrics::Run
for the freshness refresh operation, recording the outcome, elapsed time,
whether a read-model pointer format is present, and whether raw events are
available; ensure the metrics block is emitted via emit() before returning the
result.
- Around line 450-457: Update the BucketFreshness refresh flow around
bucket_newest_event so a raw-index scanning error does not discard already
parsed current.json pointer metadata. Preserve published_read_model and
read_model_format, record the raw-index failure in the freshness error/partial
metadata, and keep /ready compatible when a valid remote read model exists. Add
a test covering a malformed partition and verifying the preserved metadata and
readiness behavior.

In `@src/sync.rs`:
- Around line 670-706: Bound the per-pull iteration over index.physical_days()
in pull_events_from so historical partitions are not repeatedly listed forever,
while preserving retrieval of late-arriving data through a sealing/pruning
mechanism or equivalent bounded compatibility path. Keep the existing
partition_cursors behavior for active/unsealed days and retain the global
cursors compatibility scan only as needed for older writers.

In `@src/trace_athena.rs`:
- Line 318: Update the caching logic around self.cached = Some(store) so stores
loaded by filtered list operations or without session expansion cannot satisfy
later show/compare lookups. Cache only fully unfiltered, expanded stores, or
mark partial stores and ensure those lookup paths skip them, matching the
existing partial-search safeguard.
- Around line 608-616: The legacy-stream branch in the selection logic currently
adds every physical object before the MAX_OBJECT_PATHS validation, causing
narrow windows to fail. Update the else branch to filter objects using
day_from_event_key against the requested window’s day span before extending
selected, while preserving the non-empty paths requirement and applying the
existing limit check afterward.
- Around line 523-542: The stream filtering logic around streams.retain must
preserve unrecognized source values in normalized lowercase form instead of
discarding them, and normalize stream and requested/scope sources identically so
explicit unknown filters and all-unknown ReadScope entries fail closed. Update
src/trace_athena.rs lines 523-542 accordingly; extend
stream_pruning_uses_exact_machine_and_canonical_source_suffixes at lines
1157-1192 with unrecognized source and scope.sources cases asserting no streams
are returned.
- Around line 566-611: Update the stream-selection logic around
`event_partitions::load` and `bucket.list` so indexed streams derive candidate
days first, then list only `events/{stream}/chunks/track.{day}/` for those days.
Keep the broad stream-prefix listing only when no partition index exists, and
eliminate the per-day `physical.iter().filter(...)` scan by using each day’s
targeted listing results directly. Preserve selection of indexed candidates and
physically present objects missing from the object index.

In `@src/view.rs`:
- Around line 845-862: Add a scenario-style unit test covering a bucket-backed
Status with populated freshness fields. Assert both Markdown and JSON output
include the raw-event time, publication time, read-model format, check time, and
freshness error state, covering the rendering paths around the bucket freshness
output.

---

Outside diff comments:
In `@README.md`:
- Around line 215-218: Update the README description of the MCP-only workload to
name both the raw-events table and the versioned trace_events_v1 Parquet table,
and state that the MCP role has read-only access to both. Clarify that
deploy/aws/athena-trace.yaml creates the external tables and managed-results
workgroup without write or crawl operations.

In `@src/readmodel.rs`:
- Around line 83-90: Add a scenario-style unit test for repoint that uses a
temporary model directory, invokes repoint, reads and deserializes current.json,
and verifies published_at is non-empty and parses as an RFC3339 timestamp. Keep
the test focused on the persisted publication time and follow existing test
helpers and setup conventions.

---

Nitpick comments:
In `@src/event_partitions.rs`:
- Around line 265-285: Update bucket_newest_event to avoid scanning the entire
event-partitions prefix; iterate the existing EVENT_STREAMS registry from
sync.rs and load each stream’s metadata object directly. Preserve the current
newest timestamp comparison and missing-index handling while eliminating
client-side filtering of historical day/object-index keys.

In `@src/trace_athena.rs`:
- Around line 483-499: The empty-selection branch in the query method should
emit a metrics::Run with outcome=empty before returning zero rows. Update the
branch guarded by selection.paths.is_empty() while preserving the existing empty
QueryRows result and normal query execution for non-empty selections.
- Around line 550-565: The selected_objects method embeds test-only synthetic
path generation through self.days; move this injection seam behind #[cfg(test)]
or replace it with a test-stubbable selection abstraction. Keep production
selection free of the days field and test.jsonl fabrication while preserving the
existing test behavior through the chosen seam.
- Around line 138-180: Update the polling loop around get_query_execution so
every early error exit, including polling failures and query/status extraction
errors, first attempts to stop the Athena execution through the existing
stop_query_execution call. Preserve the current timeout cancellation and error
context, and ensure cancellation is also attempted before propagating any
failure from the polling path.
- Around line 1157-1192: The test
stream_pruning_uses_exact_machine_and_canonical_source_suffixes only covers
recognized sources; add a scenario with an unrecognized source and matching
scope.sources to verify selected_streams does not fail open by returning every
stream. Assert the expected user-facing result for the unknown source, while
preserving the existing recognized-source assertions.
- Around line 851-860: Decouple query_outcome from matching arbitrary error
prose by introducing stable typed error categories or shared constants for
timeout and limit conditions, and use those identifiers both when constructing
errors and when classifying outcomes. Update query_outcome and the relevant
ensure!/bail! call sites in this module while preserving the existing timeout,
limit, and error outcome values.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 350b97f4-8702-4710-8f2f-de92f8e5b3ee

📥 Commits

Reviewing files that changed from the base of the PR and between 0c4b944 and 0515cc6.

📒 Files selected for processing (13)
  • README.md
  • deploy/aws/mcp-reader.yaml
  • docs/design.md
  • src/event_partitions.rs
  • src/main.rs
  • src/mcp.rs
  • src/mcp_http.rs
  • src/readmodel.rs
  • src/sync.rs
  • src/trace_athena.rs
  • src/track.rs
  • src/tui.rs
  • src/view.rs
💤 Files with no reviewable changes (1)
  • deploy/aws/mcp-reader.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/design.md

Comment thread src/event_partitions.rs
Comment thread src/mcp_http.rs Outdated
Comment thread src/mcp.rs
Comment thread src/mcp.rs Outdated
Comment thread src/sync.rs Outdated
Comment thread src/trace_athena.rs Outdated
Comment thread src/trace_athena.rs
Comment thread src/trace_athena.rs
Comment thread src/trace_athena.rs Outdated
Comment thread src/view.rs
Fail closed on unknown source scopes, compare event times as parsed instants, preserve compatible pointer readiness on partial freshness failures, and sanitize unauthenticated health diagnostics.

Use exact per-day object watermarks to eliminate unchanged historical LIST calls while preserving late older-day discovery. Bound legacy Athena selection to requested physical days and cancel failed polling paths.

Validated 299 default, 278 no-default, and 317 full-feature tests plus MCP HTTP smoke, Helm rendering, and the shipped release build.
@huronat

huronat commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Resolved the remaining outside-diff and nitpick review items in e770fa8 as well:

  • added a temporary-directory publication scenario that parses persisted published_at as RFC3339;
  • changed bucket freshness discovery to list the bounded event-streams registry and load stream metadata directly;
  • emit an athena_trace outcome=empty run for an empty object selection;
  • moved the synthetic test-object selection branch behind cfg(test);
  • cancel the Athena execution before propagating polling, query extraction, or status extraction failures;
  • replaced prose-based outcome matching with typed timeout and limit errors, including contextual classification coverage;
  • kept unknown-source fail-closed coverage in the stream-pruning scenario.

The old README suggestion to document two Glue tables is obsolete: this PR intentionally removed the Parquet table, parameter, IAM grant, and documentation. The deployment now exposes only synty.raw_events.

Validation: 299 default tests, 278 no-default tests, 317 S3/GCS/MCP/Athena tests, MCP HTTP smoke, Helm lint and default/optional rendering, release build, and git diff --check all pass. The AWS templates are unchanged in this commit; local YAML parsing passed, while a redundant live validation retry was unavailable because the local sie SSO session had expired.

@huronat
huronat dismissed coderabbitai[bot]’s stale review July 28, 2026 14:20

Superseded by e770fa8. All ten inline findings were fixed and CodeRabbit explicitly replied to every thread that the reported issue is addressed. The outside-diff publication-time test and six nitpicks were also implemented; the Parquet README suggestion is obsolete because the Parquet table and grant were removed. Rust and deploy CI are green.

coderabbitai[bot]
coderabbitai Bot previously requested changes Jul 28, 2026

@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.

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@src/event_partitions.rs`:
- Around line 119-125: Add a scenario-style unit test in the existing
#[cfg(test)] block for EventPartitionIndex::record_object, verifying that
recording a key advances the per-day object_cursors watermark and that a later
lexicographically smaller key leaves the cursor unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3b22f0ea-ca87-4b12-a0d5-f755c5c00bf4

📥 Commits

Reviewing files that changed from the base of the PR and between 0515cc6 and e770fa8.

📒 Files selected for processing (9)
  • README.md
  • docs/design.md
  • src/event_partitions.rs
  • src/mcp.rs
  • src/mcp_http.rs
  • src/readmodel.rs
  • src/sync.rs
  • src/trace_athena.rs
  • src/view.rs
🚧 Files skipped from review as they are similar to previous changes (7)
  • src/mcp_http.rs
  • docs/design.md
  • src/view.rs
  • README.md
  • src/mcp.rs
  • src/sync.rs
  • src/trace_athena.rs

Comment thread src/event_partitions.rs
Add a direct scenario proving that per-day object cursors advance independently and never regress when a late lexicographically smaller key appears. The full s3,gcs,mcp-http,athena matrix passes all 318 tests.
@huronat
huronat dismissed coderabbitai[bot]’s stale review July 28, 2026 14:28

CodeRabbit confirmed the only requested change was addressed in 6042581; dismissing the stale review state while the new-head check completes.

@huronat
huronat merged commit 55f7b9a into main Jul 28, 2026
3 checks passed
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