Skip to content

feat(kinesis): implement all remaining operations for 100% conformance#305

Merged
vieiralucas merged 2 commits intomainfrom
worktree-kinesis-conformance-100
Apr 12, 2026
Merged

feat(kinesis): implement all remaining operations for 100% conformance#305
vieiralucas merged 2 commits intomainfrom
worktree-kinesis-conformance-100

Conversation

@vieiralucas
Copy link
Copy Markdown
Member

@vieiralucas vieiralucas commented Apr 12, 2026

Summary

  • Implement all 25 remaining Kinesis operations, bringing conformance from 38.2% to 100%
  • 39/39 operations handled, 39/39 fully passing, 1611/1611 variants pass
  • Tags v2 (TagResource, UntagResource, ListTagsForResource) + Resource Policy (Get/Put/Delete)
  • Encryption (StartStreamEncryption, StopStreamEncryption) + Enhanced Monitoring (Enable/Disable)
  • Account settings (DescribeAccountSettings, UpdateAccountSettings, DescribeLimits)
  • Stream config (UpdateStreamMode, UpdateStreamWarmThroughput, UpdateMaxRecordSize)
  • Consumer management (Register, Deregister, Describe, ListStreamConsumers)
  • Shard management (ListShards, MergeShards, SplitShard, UpdateShardCount)
  • SubscribeToShard (input validation; HTTP/2 event-stream not supported)
  • Extended KinesisShard with real hash key ranges, parent tracking, open/closed state
  • Added KinesisConsumer state, resource policies, account-level settings
  • Write routing respects open/closed shard state after resharding
  • Stream deletion cleans up associated consumers

Test plan

  • cargo test -p fakecloud-kinesis — all 8 unit tests pass
  • cargo clippy -p fakecloud-kinesis -- -D warnings — clean
  • cargo test -p fakecloud-conformance --test kinesis — all 5 handwritten tests pass
  • Conformance probes: 1611/1611 variants pass (100.0%)

Summary by cubic

Implements all remaining 25 Kinesis operations to reach 100% conformance (39/39 ops, 1611/1611 variants), with full tagging, resource policies, encryption, monitoring, consumers, and shard management. Adds pagination and safety checks from review feedback.

  • New Features

    • Tags v2 and resource policies: TagResource, UntagResource, ListTagsForResource; Get/Put/DeleteResourcePolicy.
    • Encryption and monitoring: Start/StopStreamEncryption (KMS), Enable/DisableEnhancedMonitoring.
    • Account and limits: DescribeAccountSettings/UpdateAccountSettings; DescribeLimits.
    • Stream config: UpdateStreamMode, UpdateStreamWarmThroughput, UpdateMaxRecordSize.
    • Consumers: Register/Deregister/Describe/ListStreamConsumers (pagination).
    • Shards: ListShards (with NextToken), MergeShards, SplitShard, UpdateShardCount with hash-range validation.
    • SubscribeToShard: input validation only; returns ResourceNotFound (event-stream not supported).
  • Refactors

    • KinesisShard now has real hash key ranges, parent links, open/closed state; writes target open shards; next shard index tracked; adjacency checks use checked_add to avoid overflow.
    • Added KinesisConsumer state, resource policies, and account-level settings; consumers cleaned up on stream deletion; UpdateShardCount enforces TargetShardCount <= 10000.

Written for commit 49ea9d2. Summary will update on new commits.

…ance

Implement all missing Kinesis operations to achieve 100% conformance
(1611/1611 variants, 39/39 operations):

Tags v2 & Resource Policy:
- TagResource, UntagResource, ListTagsForResource (ARN-based v2 APIs)
- GetResourcePolicy, PutResourcePolicy, DeleteResourcePolicy

Encryption & Enhanced Monitoring:
- StartStreamEncryption, StopStreamEncryption (KMS encryption)
- EnableEnhancedMonitoring, DisableEnhancedMonitoring (shard-level metrics)

Account Settings & Stream Config:
- DescribeAccountSettings, UpdateAccountSettings (billing commitment)
- DescribeLimits (shard limits, on-demand counts)
- UpdateStreamMode (PROVISIONED/ON_DEMAND)
- UpdateStreamWarmThroughput, UpdateMaxRecordSize

Consumer Management:
- RegisterStreamConsumer, DeregisterStreamConsumer
- DescribeStreamConsumer, ListStreamConsumers (with pagination)

Shard Management:
- ListShards (with pagination and ExclusiveStartShardId)
- MergeShards (adjacent shard validation, hash range merge)
- SplitShard (hash key boundary split)
- UpdateShardCount (UNIFORM_SCALING resharding)

Streaming:
- SubscribeToShard (input validation, returns ResourceNotFoundException
  since HTTP/2 event-stream protocol unsupported over JSON)

State changes:
- Extended KinesisShard with hash key ranges, parent tracking, open/closed
- Added KinesisConsumer struct and consumers HashMap
- Added resource_policies, account-level settings
- Added key_id, enhanced_metrics, warm_throughput, max_record_size to streams
- Route writes only to open shards after resharding
- Clean up consumers on stream deletion
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

3 issues found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="crates/fakecloud-kinesis/src/service.rs">

<violation number="1" location="crates/fakecloud-kinesis/src/service.rs:1197">
P2: `ListShards` truncates by `MaxResults` but never returns/consumes `NextToken`, breaking pagination.</violation>

<violation number="2" location="crates/fakecloud-kinesis/src/service.rs:1257">
P1: Avoid `u128` overflow in shard adjacency validation by using checked addition.</violation>

<violation number="3" location="crates/fakecloud-kinesis/src/service.rs:1374">
P1: Validate `TargetShardCount` upper bound before looping/casting to prevent overflow and state corruption.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread crates/fakecloud-kinesis/src/service.rs Outdated
Comment thread crates/fakecloud-kinesis/src/service.rs Outdated
Comment thread crates/fakecloud-kinesis/src/service.rs Outdated
- Use checked_add for u128 shard adjacency validation to prevent overflow
- Validate TargetShardCount upper bound (max 10000) in UpdateShardCount
- Add NextToken pagination support to ListShards
@vieiralucas vieiralucas merged commit c7a8344 into main Apr 12, 2026
22 checks passed
@vieiralucas vieiralucas deleted the worktree-kinesis-conformance-100 branch April 12, 2026 17:16
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