Skip to content

feat(simulate): fail CI only on new baseline regressions - #954

Open
u9g wants to merge 3 commits into
mainfrom
jason/simulate-ci-baseline
Open

feat(simulate): fail CI only on new baseline regressions#954
u9g wants to merge 3 commits into
mainfrom
jason/simulate-ci-baseline

Conversation

@u9g

@u9g u9g commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add lk agent simulate --baseline <run-id> so CI fails only for scenarios that did not fail in the baseline
  • keep systemic run failures, unavailable baselines, and unfinished baselines as hard failures
  • match repeated scenarios by label, falling back to instructions for generated scenarios
  • add --run-id-file <path> so CI can persist the newly created run ID even when the simulation later fails
  • document how to bootstrap and advance the stored baseline safely

CI usage

Store the latest accepted main-branch run ID in a CI variable or artifact, then run:

lk agent simulate \
  --scenarios scenarios.yaml \
  --baseline "$SIMULATION_BASELINE_RUN_ID" \
  --run-id-file "$RUNNER_TEMP/simulation-run-id"

Only a successful main-branch run should replace the stored baseline with the ID from --run-id-file. Pull requests and failed main runs must leave it unchanged. For the first run, omit --baseline, inspect and accept the result, then store the emitted ID.

Test plan

  • go test ./cmd/lk
  • go vet ./cmd/lk
  • git diff --check

u9g added 3 commits August 31, 2026 13:29
lk agent simulate --baseline <run-id> fetches that finished run and diffs
failed scenarios (matched by label, or instructions when unlabeled): failures
the baseline already had are reported but no longer fail the exit code, so CI
only breaks on regressions. Systemic run failures and unfetchable baselines
still fail loudly.
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