Skip to content

chore(test): live opt-in + rag-gate label gate + CI guards (pass 2 L4)#26

Merged
silversurfer562 merged 1 commit into
mainfrom
test/pass-2-llm-discipline
May 13, 2026
Merged

chore(test): live opt-in + rag-gate label gate + CI guards (pass 2 L4)#26
silversurfer562 merged 1 commit into
mainfrom
test/pass-2-llm-discipline

Conversation

@silversurfer562
Copy link
Copy Markdown
Member

Summary

Layer 4 of test-strategy pass 2 — heaviest layer because attune-author owns the real-API CI surface.

  • pyproject.tomladdopts now -ra -m 'not live' (live marker was already registered in pass 1)
  • tests.yml + cross-repo-compat.yml — CI guard step asserting ANTHROPIC_API_KEY is unset for default suite
  • rag-gate.yml — three meaningful changes:
    1. Add pull_request: types: [labeled] trigger with if: github.event.label.name == 'live-eval' — opt-in PR gate so contributors can validate eval-affecting changes before merge without paying for every push
    2. Switch ANTHROPIC_API_KEY source to secrets.ATTUNE_CI_EVAL_KEY || secrets.ANTHROPIC_API_KEY so the rotation works in either order
    3. Add ::notice::Estimated cost: $0.10–0.30 log line for spend telemetry (v1 = fixed range; v2 will use actual token counts)
  • tests/README.md — shrink the LLM-mocking section to a pointer; keep the reference-implementation call-out so future contributors know attune-author's conftest IS the family pattern

Prerequisite

Depends on Smart-AI-Memory/attune#4 (workspace testing-conventions.md).

Procedural follow-ups (outside this PR — your action)

These are tracked in specs/test-strategy-pass-2/tasks.md Procedural section:

  1. Create new Anthropic API key attune-ci-eval in the console
  2. Configure $5 soft / $20 hard monthly caps on the new key
  3. Add ATTUNE_CI_EVAL_KEY repository secret (Settings → Secrets → Actions)
  4. After merge, run rag-gate.yml manually with reason: pass-2 verification to confirm the new key path works

The fallback to secrets.ANTHROPIC_API_KEY means this PR can land before the new secret is provisioned without breaking the workflow.

Test plan

  • pytest --cov locally — 791 passing, 31 skipped (2 env-specific local failures pass cleanly in CI per Tests workflow status on main)
  • ruff check clean (no source touched)
  • CI matrix passes on ubuntu/macos/windows × py3.10–3.13
  • cross-repo-compat.yml still green on its weekly run
  • Manual rag-gate.yml dispatch succeeds with the new key path
  • Label-gated PR run: apply live-eval label to a test PR, confirm gate fires

🤖 Generated with Claude Code

Layer 4 of test-strategy pass 2 — the heaviest because attune-author
owns the real-API CI surface.

- pyproject.toml: update addopts to deselect `live` by default
  (`-ra -m 'not live'`). The `live` marker was already registered
  (pass 1 inheritance).
- tests.yml: add CI guard step that fails fast if ANTHROPIC_API_KEY
  is set in the default test environment.
- cross-repo-compat.yml: add the same CI guard step (this workflow
  also runs the default suite).
- rag-gate.yml: three changes
  - Add `pull_request: types: [labeled]` trigger with a job-level
    `if:` filter so the gate runs only when the `live-eval` label is
    applied (in addition to the existing weekly schedule + manual).
    Per spend caps in the Anthropic console, the worst case is bounded.
  - Switch ANTHROPIC_API_KEY source to
    `secrets.ATTUNE_CI_EVAL_KEY || secrets.ANTHROPIC_API_KEY` so the
    rotation can happen before/after the new key is provisioned without
    breaking either side.
  - Add a `::notice::` cost-estimate log line at end of each run for
    spend telemetry. v1 emits a fixed range; v2 will compute from
    actual token counts once smoke_eval.py exposes them.
- tests/README.md: shrink the LLM-mocking section to a pointer at the
  workspace `testing-conventions.md`; keep the reference-implementation
  call-out so future contributors know this layer's conftest IS the
  pattern.

Verified locally: 791 passing + 31 skipped (the 2 local failures are
environment-specific — they require the user's attune-help install
layout and pass cleanly in CI per Tests workflow status on main).

Spec: /Users/patrickroebuck/attune/specs/test-strategy-pass-2/

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@silversurfer562 silversurfer562 merged commit d9b9f09 into main May 13, 2026
12 checks passed
@silversurfer562 silversurfer562 deleted the test/pass-2-llm-discipline branch May 13, 2026 21:51
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