Skip to content

fix(hosted): stop defaulting regression names to refund_limit_regression (#36) - #166

Open
RupeshMaster wants to merge 1 commit into
CodewithJha:mainfrom
RupeshMaster:fix/generic-regression-name
Open

RupeshMaster wants to merge 1 commit into
CodewithJha:mainfrom
RupeshMaster:fix/generic-regression-name

Conversation

@RupeshMaster

Copy link
Copy Markdown

Summary

Closes #36. Hosted named every saved regression refund_limit_regression, whatever rule was violated.

  • API: RegressionSaveRequest.name defaults to discovered_violation. No schema change beyond the default string.
  • UI: new defaultRegressionName(candidate) in apps/web/src/lib/api.ts returns <rule id>_regression for the candidate's first violated rule, falling back to discovered_violation.
    • The campaign page's "Save regression" uses it.
    • The exploit page pre-fills its editable name field with it and falls back to it when the field is left blank.
  • docs/PRODUCTION_READINESS.md P3-2 rows updated; the ingest test fixture no longer uses the old name.

The issue is assigned to @CodewithJha with no activity since September, so I went ahead; if you already have work in progress on it, feel free to close this.

Type of change

Checklist

  • I read CONTRIBUTING.md (where to ask, how reviews work, how to run tests)
  • Linked related issue (Fixes #N) or Discussion when applicable
  • Core stays free of framework SDK imports (adapters own glue)
  • Tests added or updated when behavior changes (uv run pytest tests/unit -q)
  • Docs / README claims match reality (no PyPI / multi-adapter claims unless shipped)
  • One concern per PR when possible
  • Authorized testing only — no open-internet attack-proxy behavior

Test plan

  • Python lint: uv run --locked ruff check → all checks passed
  • Backend tests: uv run pytest tests/unit tests/integration tests/reliability -q → 848 passed. Run locally on Python 3.12 only (macOS, OPENAI_API_KEY unset); 3.11 is left for CI.
  • CLI smoke: from a copy of examples/openai_support_agent, mutiny --help, mutiny init, mutiny run with MUTINY_SAMPLE_OFFLINE=1 and empty OPENAI_API_KEY / FEATHERLESS_API_KEY → violation found, regression saved.
  • Web: npm ci, npm run lint, npx tsc --noEmit, npm test (3 passed, one new) and npm run build. Run on Node 26, not CI's Node 20.
  • Package build + isolated artifact gate: tests/unit/test_package_release.py passed as part of the unit run; ./scripts/verify_release_artifacts.sh not run.

Extra, in headless Chromium against a local API and next dev with a demo campaign:

  • the exploit page's name field shows refund_limit_regression (derived from the violated rule), and saving with the field blanked still stores that name;
  • "Save regression" on the campaign page stores refund_limit_regression;
  • POST /api/candidates/{id}/regression with {} stores discovered_violation.

The demo only violates refund_limit, so the browser run cannot show a different rule; the new web test covers that (delete_requires_confirm_regression).

Notes

  • AI assistance: this change was written with an AI coding agent. The checks above were run locally before opening the PR.

Hosted named every saved regression after the refund demo, whatever rule
was violated.

- API: RegressionSaveRequest.name defaults to discovered_violation.
- UI: the campaign and exploit pages suggest <rule id>_regression for the
  candidate's first violated rule; the exploit page's name field stays
  editable and falls back to the suggestion when left blank.

Closes CodewithJha#36
@vercel

vercel Bot commented Nov 27, 2026

Copy link
Copy Markdown

@RupeshMaster is attempting to deploy a commit to the priyanshu's projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

api/ui: replace default regression name refund_limit_regression

1 participant