README Source History Refs Reviews Compare Notes Search Review guide Point CI research at Luci 7c24441eede225dc4855373d11c70a30780fe0f1
Oliver Jan Krylow <oliver@bugabinga.net > · 4 Aug 2026
SSH signature · not checked
Browse files Compare with HEAD
The forge migration removes pull-request and hosted-workflow assumptions; CI guidance now reflects the public Luci dashboard while leaving unproven runner semantics unspecified.
The updated surface is `docs/research/CI-PATTERNS-RESEARCH.md` §1–12.
Changed files (1) Diff layout Auto Unified Split
docs/research/CI-PATTERNS-RESEARCH.md Modified +32 / −149 text lines
3 3 **Date:** 2026-05-21**Date:** 2026-05-214 4 **Status:** Research — CI patterns and gating strategies**Status:** Research — CI patterns and gating strategies6 - This document captures CI/CD patterns, test gating strategies, and agent-gating workflows for smith. It does not prescribe a specific CI technology (GitHub Actions, GitLab CI, Buildkite, etc.) but defines goals independent of platform.6 + This document captures test-gating strategy for smith and its deployment on Luci at `ci.bugabinga.net`.10 10 ## 1. CI Tier Philosophy ## 1. CI Tier Philosophy 12 - The goal is **fast feedback on commit, thorough validation on merge , exhaustive testing on release**.12 + The goal is **fast feedback on commit, thorough validation before trunk integration , exhaustive testing on release**.14 14 Coding agents (including smith itself when used for self-improvement) must be gated by the right tests at the right time. Agents should not waste time on slow tests for trivial changes, nor should they skip critical validation for risky changes.Coding agents (including smith itself when used for self-improvement) must be gated by the right tests at the right time. Agents should not waste time on slow tests for trivial changes, nor should they skip critical validation for risky changes.18 18 | Tier | Trigger | Duration | Tests | Gate || Tier | Trigger | Duration | Tests | Gate |19 19 |------|---------|----------|-------|------||------|---------|----------|-------|------|20 20 | **Fast** | Every commit (local + push) | < 2 min | Unit, property, snapshot, doc | Block push if fail || **Fast** | Every commit (local + push) | < 2 min | Unit, property, snapshot, doc | Block push if fail |21 - | **Medium** | Every PR | < 10 min | Fast + integration (CLI, TUI, session) | Block merge if fail |21 + | **Medium** | Before trunk integration | < 10 min | Fast + integration (CLI, TUI, session) | Block integration if fail |22 22 | **Slow** | Nightly + release candidates | < 2 hours | Medium + mutation + benchmarks + full matrix | Block release if fail || **Slow** | Nightly + release candidates | < 2 hours | Medium + mutation + benchmarks + full matrix | Block release if fail |24 24 ### Why tiers matter for agents ### Why tiers matter for agents 26 26 Agents generate code quickly. Running the full test suite on every agent iteration is wasteful. But skipping integration tests before merging agent-generated code is dangerous.Agents generate code quickly. Running the full test suite on every agent iteration is wasteful. But skipping integration tests before merging agent-generated code is dangerous.28 - **Rule:** Agents run fast tier on every iteration. Medium tier on "ready to merge". Slow tier is CI's responsibility, not the agent's.28 + **Rule:** Agents run fast tier on every iteration and medium tier before integration. Luci owns the slow tier.80 - ## 3. Medium Tier: Every PR 80 + ## 3. Medium Tier: Before Trunk Integration 82 82 ### What runs ### What runs 117 117 ### Coverage gate ### Coverage gate 119 119 - **Target:** 85% overall, 100% on `smith/` (types crate)- **Target:** 85% overall, 100% on `smith/` (types crate)120 - - **Advisory on PR** — coverage drop > 2% triggers warning comment121 - - **Block on < 80%** — PR cannot merge if coverage falls below threshold120 + - **Advisory:** coverage drop > 2% is reported in the run121 + - **Block on < 80%:** trunk integration stops below the threshold123 123 ### Agent behavior ### Agent behavior 125 125 - Agent runs medium tier before declaring "ready for review"- Agent runs medium tier before declaring "ready for review"126 126 - If medium tier fails, agent fixes and re-runs- If medium tier fails, agent fixes and re-runs127 - - Coverage drop > 2% requires agent justification in PR description127 + - Coverage drop > 2% requires an explicit justification before integration140 140 cargo mutants --test-tool=nextestcargo mutants --test-tool=nextest142 142 # Benchmarks with regression detection # Benchmarks with regression detection 143 - cargo bench -- --baseline main 143 + cargo bench -- --baseline trunk 145 145 # Full platform matrix (if multi-platform CI) # Full platform matrix (if multi-platform CI) 146 146 # - Linux x86_64 # - Linux x86_64 184 184 ### Mutation gate ### Mutation gate 186 186 - **Target:** > 80% mutants caught- **Target:** > 80% mutants caught187 - - **Advisory on nightly** — report posted to issue/PR187 + - **Advisory on nightly:** report retained with the Luci run188 188 - **Block release** — release cannot proceed if < 80%- **Block release** — release cannot proceed if < 80%190 190 ### Benchmark gate ### Benchmark gate 192 192 - **Regression threshold:** ±5% for most benchmarks, ±10% for agent loop- **Regression threshold:** ±5% for most benchmarks, ±10% for agent loop193 193 - **Block release** — any benchmark regressing > threshold blocks release- **Block release** — any benchmark regressing > threshold blocks release194 - - **Advisory on PR** — benchmark comparison comment posted to PR194 + - **Advisory before integration:** benchmark comparison retained with the run196 196 ### Agent behavior ### Agent behavior 239 239 ## 6. Agent Gating Strategy ## 6. Agent Gating Strategy 241 - ### Agent types that will use smith 243 - 1. **Self-hosted agent** — smith improving its own codebase244 - 2. **User agent** — user runs smith on their own projects245 - 3. **CI agent** — automated agent in CI pipeline247 - ### Gating per agent type 249 - | Agent Type | Fast Tier | Medium Tier | Slow Tier | Release |250 - |------------|-----------|-------------|-----------|---------|251 - | Self-hosted | Every iteration | Before self-PR | Nightly CI | Blocked by slow tier |252 - | User | On request | On request | Never | N/A |253 - | CI | Every commit | Every PR | Scheduled | Blocked by slow tier |255 - ### Agent-specific tests 257 - When an agent modifies smith's own code:259 - 1. **Run agent on test fixture** — does the agent produce valid output for a known task?260 - 2. **Regression test** — replay a recorded session with the new code, verify identical output261 - 3. **Self-test** — agent runs `cargo test` on its own changes263 - ### Agent safety rules 265 - 1. **Never auto-merge** — agent opens PR, human reviews266 - 2. **Never skip tests** — agent runs full tier before PR267 - 3. **Never modify CI config** — agent cannot change `.github/workflows/`, `.config/nextest.toml`, etc.268 - 4. **Never modify tests to make them pass** — agent cannot change test assertions to match buggy code241 + When an agent modifies smith, it runs the fast tier after each iteration and242 + the medium tier before requesting trunk integration. Luci owns scheduled slow243 + runs. Agents never weaken CI configuration or tests to obtain a passing result.272 247 ## 7. Artifact Management ## 7. Artifact Management 274 - ### What artifacts to keep 276 - | Artifact | Retention | Purpose |277 - |----------|-----------|---------|278 - | Test logs | 30 days | Debug failures |279 - | Coverage reports (HTML) | 30 days | Review coverage |280 - | Coverage reports (LCOV) | 30 days | codecov.io upload |281 - | Benchmark results | 90 days | Regression analysis |282 - | Mutation reports | 90 days | Test quality tracking |283 - | Snapshot diffs | 7 days | Review pending snapshots |285 - ### Benchmark baselines 287 - Store benchmark baselines as CI artifacts, keyed by branch:292 - │ ├── trunk/ # Baseline for trunk branch293 - │ ├── release-0.1/ # Baseline for release branch294 - │ └── pr-123/ # Baseline for PR (optional)297 - ### Snapshot artifacts 299 - Pending snapshots (`.snap.new` files) are CI artifacts for review:249 + Luci retains logs, coverage, benchmark results, mutation reports, and snapshot250 + diffs only as long as they remain useful for diagnosis. Benchmark baselines are251 + keyed by `trunk` or release tag; generated artifacts never enter git.310 - ## 8. Notification Strategy 312 - ### Who gets notified when 314 - | Event | Channel | Recipient |315 - |-------|---------|-----------|316 - | Fast tier fail | PR comment | Agent + author |317 - | Medium tier fail | PR comment + email | Agent + author + reviewers |318 - | Coverage drop > 2% | PR comment | Agent + author |319 - | Mutation score < 80% | Issue + Slack | Team |320 - | Benchmark regression | Issue + PR comment | Agent + author + team |321 - | Nightly fail | Email + Slack | Team |323 - ### Agent notifications 325 - Agents consume notifications via:326 - - PR comments (structured: `<!-- smith-bot: status=fail tier=fast reason=compilation -->`)327 - - CI status API (GitHub Checks, GitLab Pipeline Status)328 - - Webhook (for self-hosted agents)257 + `https://ci.bugabinga.net` is the canonical public run dashboard. Failed gates258 + remain failed until a later run passes; forge comments, issue mutation, and259 + email delivery are outside the CI contract.363 - ## 10. CI Platform Agnosticism 294 + ## 10. Luci Deployment 365 - These notes describe goals, not implementation. Any CI platform can implement the three-tier model.296 + Smith's CI is Luci at `https://ci.bugabinga.net`. Luci discovers `.ci/*.kdl`297 + job definitions from the public `smith` repository on Soft Serve. The KDL is298 + orchestration only: every product check delegates to Cargo or xtask, and no299 + check logic is duplicated in CI configuration.369 - | Concept | GitHub Actions | GitLab CI | Buildkite |370 - |---------|---------------|-----------|-----------|371 - | Fast tier | `push` trigger + job | `script` in stage | Step in pipeline |372 - | Medium tier | `pull_request` trigger + job | `merge_requests` pipeline | PR pipeline |373 - | Slow tier | `schedule` (cron) + job | `schedule` pipeline | Scheduled build |374 - | Artifacts | `actions/upload-artifact` | `artifacts:` | `artifact_paths` |375 - | Caching | `actions/cache` | `cache:` | Built-in |376 - | Notifications | Checks API | Pipeline Status | Webhooks |378 - ### Recommended GitHub Actions structure 381 - # .github/workflows/ci.yml391 - runs-on: ubuntu-latest393 - - uses: actions/checkout@v4394 - - uses: dtolnay/rust-toolchain@stable395 - - uses: taiki-e/install-action@nextest396 - - run: cargo fmt --check397 - - run: cargo clippy --workspace --all-targets --all-features -- -D warnings398 - - run: cargo nextest run --profile fast402 - runs-on: ubuntu-latest404 - - uses: actions/checkout@v4405 - - uses: dtolnay/rust-toolchain@stable406 - - uses: taiki-e/install-action@nextest407 - - run: cargo nextest run --profile default408 - - run: cargo nextest run --profile integration409 - - run: cargo tarpaulin --out Lcov410 - - uses: codecov/codecov-action@v3414 - if: github.event_name == 'schedule' || startsWith(github.ref, 'refs/tags/')415 - runs-on: ubuntu-latest417 - - uses: actions/checkout@v4418 - - uses: dtolnay/rust-toolchain@stable419 - - run: cargo mutants --test-tool=nextest420 - - run: cargo bench -- --baseline main301 + The public dashboard currently exposes repository, job, status, and run time.302 + Exact trigger, cache, artifact, and retention semantics remain unproven until303 + smith's first Luci job runs; the repository must not encode assumptions about304 + them before that proof.448 331 | Goal | Metric | Tier || Goal | Metric | Tier |449 332 |------|--------|------||------|--------|------|450 333 | Fast feedback | < 2 min from push to result | Fast || Fast feedback | < 2 min from push to result | Fast |451 - | Merge safety | < 10 min from PR open to green | Medium |334 + | Integration safety | < 10 min from request to green | Medium |452 335 | Release confidence | < 2 hours from tag to validated release | Slow || Release confidence | < 2 hours from tag to validated release | Slow |453 336 | Coverage | ≥ 85% overall | Medium || Coverage | ≥ 85% overall | Medium |454 337 | Mutation score | ≥ 80% caught | Slow || Mutation score | ≥ 80% caught | Slow |455 338 | Benchmark regression | ±5% threshold | Slow || Benchmark regression | ±5% threshold | Slow |456 339 | Flaky tests | 0 tolerated | All tiers || Flaky tests | 0 tolerated | All tiers |457 - | Agent gating | Fast on every iteration, medium before merge , slow on release | All |340 + | Agent gating | Fast on every iteration, medium before integration , slow on release | All |