Skip to content

feat: AI advisor integration and architecture improvements#30

Merged
yairfalse merged 5 commits into
mainfrom
feature/update-sykli
Feb 28, 2026
Merged

feat: AI advisor integration and architecture improvements#30
yairfalse merged 5 commits into
mainfrom
feature/update-sykli

Conversation

@yairfalse
Copy link
Copy Markdown
Collaborator

@yairfalse yairfalse commented Feb 25, 2026

Summary

  • AI advisor integration: Progressive 4-level adoption ladder (Off → Context → Advised → Planned → Driven) for AI-assisted rollout decisions. Level 0 preserves current behavior. Level 1 enriches FALSE Protocol events. Level 2 consults an external advisory service while thresholds still decide.
  • A/B testing strategy: Full A/B testing support with header/cookie-based routing, statistical significance evaluation, and experiment lifecycle management
  • FALSE Protocol occurrences: Rich AI-native events with step/weight/traffic context, possible causes, and suggested fixes
  • Architecture cleanup: Extracted reconcile loop into focused modules (replicaset, status, traffic, validation), added clock abstraction, Prometheus A/B metrics
  • Documentation: Rewritten CLAUDE.md and README to match current architecture

Test plan

  • 301 unit tests pass (cargo test)
  • Zero compiler warnings
  • CRD schema regenerated and test passes
  • cargo fmt clean
  • Manual: apply a Rollout with advisor.level: Context and verify enriched occurrences
  • Manual: apply a Rollout with advisor.level: Advised and verify advisor consultation logs

🤖 Generated with Claude Code

yairfalse and others added 2 commits February 21, 2026 01:39
- Remove stale code examples that duplicated source
- Fix RolloutStrategy trait signature (now takes DateTime<Utc>)
- Update Context struct with trait-based DI fields
- Document mock constructors and test helpers
- Cut from 360 to ~105 lines, keeping all actionable info

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace ~140 lines of hand-rolled occurrence structs with the canonical
false-protocol crate, gaining spec compliance (entities under context,
DateTime<Utc> timestamps, protocol_version field) and a single source
of truth. Adapt build_occurrence() to use the crate's builder API and
return Option<Occurrence> for graceful fallback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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 refactors the FALSE Protocol occurrence handling in KULTA by replacing ~140 lines of hand-rolled structs with the canonical false-protocol crate, bringing spec compliance and a single source of truth. The changes also include documentation updates to CLAUDE.md and minor code formatting improvements across test files.

Changes:

  • Replaced inline FALSE Protocol type definitions with false-protocol crate dependency
  • Refactored build_occurrence() to use the crate's builder pattern and constructors
  • Updated CLAUDE.md to be more concise and reflect current architecture
  • Applied cargo fmt formatting across test files (rollout_test.rs, prometheus_ab.rs, cdevents_test.rs)

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Cargo.toml Added false-protocol crate as a path dependency, removed ulid direct dependency
Cargo.lock Added false-protocol package entry with its transitive dependencies
src/controller/occurrence.rs Major refactor: removed ~110 lines of struct definitions, updated to use false-protocol types and builder methods
src/controller/rollout_test.rs Formatting improvements: reformatted long function calls to fit line length conventions
src/controller/prometheus_ab.rs Formatting improvements: reformatted function calls for readability
src/controller/cdevents_test.rs Formatting improvements: reformatted assertion chains
CLAUDE.md Rewrote from verbose learning guide to concise reference documentation

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

Comment thread Cargo.toml
# FALSE Protocol (ULID generation for occurrence IDs)
ulid = "1"
# FALSE Protocol occurrence types
false-protocol = { path = "../false-protocol/rust" }
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

The false-protocol dependency uses a relative path (../false-protocol/rust), which makes the project unbuildable unless the false-protocol crate is available at that specific relative location. This creates tight coupling and makes it difficult for others to build, test, or contribute to this project.

Consider one of these alternatives:

  1. Publish the false-protocol crate to crates.io and reference it by version
  2. Use a git dependency with a repository URL if the crate is in a separate repo
  3. Move the false-protocol code into a workspace if both crates are meant to be maintained together
  4. Document the repository structure requirements clearly in the README if the relative path is intentional for development

Copilot uses AI. Check for mistakes.
yairfalse and others added 2 commits February 26, 2026 01:12
Address review comment about path dependency by documenting the
required repository layout in the getting started instructions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Introduce a 4-level AI adoption ladder (Off → Context → Advised →
Planned → Driven) that lets operators progressively opt into AI-assisted
rollout decisions. Level 0 preserves current behavior. Level 1 enriches
FALSE Protocol events with step/weight/traffic context. Level 2 consults
an external advisor service but lets thresholds decide.

- Add AdvisorLevel, AdvisorConfig, Recommendation, DecisionSource types
- Create AnalysisAdvisor trait (NoOpAdvisor, HttpAdvisor, MockAdvisor)
- Wire advisor into reconcile Context and analysis step
- Enrich failure occurrences with rich what_failed/possible_causes
- Add advisor.recommendation occurrence type for Level 2+
- Regenerate CRD schema with advisor fields

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@yairfalse yairfalse changed the title refactor: use false-protocol crate for FALSE Protocol types feat: AI advisor integration and architecture improvements Feb 28, 2026
@yairfalse yairfalse merged commit 7f33666 into main Feb 28, 2026
0 of 2 checks passed
@yairfalse yairfalse deleted the feature/update-sykli branch February 28, 2026 23:58
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