Skip to content

feat: A/B testing, FALSE Protocol, and architectural improvements#26

Merged
yairfalse merged 7 commits into
mainfrom
feature/update-sykli
Feb 20, 2026
Merged

feat: A/B testing, FALSE Protocol, and architectural improvements#26
yairfalse merged 7 commits into
mainfrom
feature/update-sykli

Conversation

@yairfalse
Copy link
Copy Markdown
Collaborator

@yairfalse yairfalse commented Feb 17, 2026

Summary

  • A/B testing strategy with Z-test statistical significance analysis, variant ReplicaSets, traffic headers, and experiment lifecycle management
  • FALSE Protocol occurrences for AI-native observability — strategy-aware event types (canary.rollout.*, bluegreen.rollout.*, etc.) with Error/Reasoning/History blocks
  • Clock abstraction + trait-based dependency injection replacing #[cfg(test)] coupling with EventSink, MetricsQuerier, and Clock traits
  • Split rollout.rs (2137 lines) into 5 focused modules: reconcile, replicaset, status, traffic, validation
  • Review fixes: ABVariant enum replacing stringly-typed winners, consolidated ReplicaSet builders (~180 lines saved), proper Prometheus error handling

Test plan

  • 268 tests passing (cargo test)
  • cargo clippy -- -D warnings clean
  • cargo fmt clean
  • No .unwrap() in production code
  • No println! in production code
  • CRD YAML regenerated with new schema

🤖 Generated with Claude Code

yairfalse and others added 6 commits February 17, 2026 02:18
Replace pinned v0.1.3 binary with install.sh for always-latest.
Simplify workflow: let sykli auto-detect sykli.rs instead of
manual cargo build + --emit pipe. Drop develop branch trigger.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement full A/B testing deployment strategy:
- ABStrategy with reconcile_replicasets, reconcile_traffic, compute_next_status
- Z-test for proportions in prometheus_ab.rs (statistical significance)
- CRD types: ABStrategy, ABExperimentStatus, ABMetricResult, ABVariant enum
- Configurable port, traffic headers, confidence level, experiment duration
- 50+ new tests covering strategy, CRD, and statistical analysis

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace #[cfg(test)] coupling with proper trait abstractions:
- Clock trait with SystemClock (production) and MockClock (test)
- EventSink trait replacing CDEventsSink's #[cfg(test)] fields
- MetricsQuerier trait replacing PrometheusClient's #[cfg(test)] fields
- Update Context to hold Arc<dyn Trait> for all dependencies
- Wire SystemClock and production implementations in main.rs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add AI-native observability via FALSE Protocol:
- Occurrence struct with Error, Reasoning, History blocks
- Strategy-aware types (canary.rollout.*, bluegreen.rollout.*, etc.)
- Configurable output dir via KULTA_OCCURRENCE_DIR env var
- 10MB file size cap with truncation
- Graceful handling of missing metadata, non-fatal write failures
- 10 tests covering serialization, phase mapping, edge cases

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Break the reconciliation god file into a module directory:
- reconcile.rs: main reconcile loop, Context, A/B experiment evaluation
- replicaset.rs: RS building (consolidated into build_replicaset_core), hashing
- status.rs: phase state machine, status computation, requeue intervals
- traffic.rs: Gateway API HTTPRoute weight management
- validation.rs: rollout spec validation, duration parsing
- rollout.rs becomes thin re-export preserving the public API

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update canary, blue_green, simple strategies for Clock + trait injection
- Add A/B ReplicaSet creation tests, occurrence edge case tests
- Update integration and stress tests for new Context construction
- Fix Prometheus error handling (replace unwrap_or with proper warn + return)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@yairfalse yairfalse changed the title chore(ci): update sykli to latest via install.sh feat: A/B testing, FALSE Protocol, and architectural improvements Feb 20, 2026
@yairfalse yairfalse requested a review from Copilot February 20, 2026 10:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 introduces A/B testing strategy with statistical significance analysis, FALSE Protocol observability, and significant architectural improvements including trait-based dependency injection replacing #[cfg(test)] coupling.

Changes:

  • A/B testing strategy with Z-test statistical analysis, header/cookie-based routing, and experiment lifecycle management
  • FALSE Protocol occurrences for AI-native observability with strategy-aware event types
  • Clock/EventSink/MetricsQuerier trait abstractions replacing conditional compilation
  • Rollout module split from 2137 lines into 5 focused modules (reconcile, replicaset, status, traffic, validation)
  • Consolidated ReplicaSet builders and proper error handling

Reviewed changes

Copilot reviewed 28 out of 29 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/crd/rollout.rs Added A/B testing strategy types, new phases (Experimenting/Concluded), ABExperimentStatus
src/controller/strategies/ab_testing.rs Complete A/B testing strategy implementation with HTTPRoute rules and ReplicaSet management
src/controller/prometheus_ab.rs Z-test statistical analysis for A/B experiment evaluation
src/controller/rollout/reconcile.rs Main reconcile logic extracted to focused module with A/B experiment evaluation
src/controller/rollout/replicaset.rs ReplicaSet building logic extracted and consolidated
src/controller/rollout/status.rs Status computation logic with clock dependency
src/controller/rollout/traffic.rs Traffic routing logic extraction
src/controller/rollout/validation.rs Validation logic extraction
src/controller/occurrence.rs FALSE Protocol occurrence emission
src/controller/clock.rs Clock trait abstraction for testable time
src/controller/prometheus.rs MetricsQuerier trait with Http/Mock implementations
src/controller/cdevents.rs EventSink trait with Http/Mock implementations
src/main.rs Updated to use new trait-based types
deploy/crd.yaml CRD schema updated with A/B testing fields
tests/* Test fixtures updated with ab_testing: None and port: None fields

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

kube 2.0.1 requires Rust edition 2024 which is only available in
Cargo 1.85+. The CI was using rust:1.83.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@yairfalse yairfalse merged commit 6278b56 into main Feb 20, 2026
0 of 2 checks passed
@yairfalse yairfalse deleted the feature/update-sykli branch February 20, 2026 22: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