Skip to content

fix: preserve Hosted minimization rules and source evidence - #123

Merged
CodewithJha merged 1 commit into
CodewithJha:mainfrom
Sonike:fix/hosted-minimize-lineage
Oct 16, 2026
Merged

CodewithJha merged 1 commit into
CodewithJha:mainfrom
Sonike:fix/hosted-minimize-lineage

Conversation

@Sonike

@Sonike Sonike commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #61 (MUT-008, MUT-019).

Posting {} to minimize a delete-rule finding currently checks refund_limit, and a successful minimization overwrites the original candidate's conversation and trace. Resolve targets from explicit non-empty rule ids, then violated hits, then the genome's targets. Return 400 target_rules_required before execution if none exist.

Persist a successful minimized genome as a child candidate using the existing parent_id relationship. Keep the original genome, trace and hits available; store the child's own trace and evaluated hits. The response and event retain the original candidate_id and expose minimized_candidate_id (null on non-reproduction). Repeated minimization starts from the original evidence and creates separate children. Document this API contract in the Hosted guide.

This uses existing tables without a migration. The trusted demo execution boundary, local CLI/Core behavior and regression-name default (#36) are unchanged.

Type of change

  • Bug fix
  • Tests
  • Hosted API / UI (secondary surface)

Checklist

  • Read CONTRIBUTING.md and SECURITY.md.
  • One issue; Core remains free of framework imports.
  • Added integration coverage with the real local demo adapter and policy evaluator.
  • Local mock tools and offline execution only.

Test plan

  • Regression reproduction before the fix: delete-rule requests check the wrong target, refund minimization overwrites the original, and no-target requests proceed to execution. The new suite passes 16 cases after the fix, covering both endpoints, empty/omitted targets, explicit-rule precedence, genome fallback, original preservation, repeated minimization, retrievable child evidence, child regression saves and no-target rejection.
  • On latest upstream ea35ad4: uv sync --locked --group dev; uv run --locked ruff check.
  • MUTINY_SAMPLE_OFFLINE=1 OPENAI_API_KEY='' FEATHERLESS_API_KEY='' uv run --locked pytest tests/unit tests/integration tests/reliability -q --tb=short — 692 passed on Python 3.12.
  • scripts/verify_release_artifacts.sh — builds, isolated wheel installation, offline CLI regression fail/fix/pass and database backup/restore passed on the updated base.
  • Workspace sample mutiny --help, mutiny init, mutiny run passed offline during initial validation on October 12.
  • Web npm ci, npx tsc --noEmit, npm run build passed during initial validation on October 12. The web source and lockfile are unchanged in the refreshed base; npm run lint also passes on October 15.
  • git diff --check.

All six jobs passed in GitHub CI at commit e17f5cd28110f8533dfe980e4813c3be0b4e7de0: Python lint, backend tests on Python 3.11 and 3.12, CLI smoke, web lint/typecheck/build, and package build. Vercel preview deployment separately requires upstream team authorization.

Created with Codex assistance.

@vercel

vercel Bot commented Oct 15, 2026

Copy link
Copy Markdown

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

A member of the Team first needs to authorize it.

@Sonike
Sonike marked this pull request as ready for review October 15, 2026 10:10
@Sonike
Sonike requested a review from CodewithJha as a code owner October 15, 2026 10:10

@CodewithJha CodewithJha left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

MERGE READY — clears the hardcoded refund_limit default (MUT-008) and preserves original evidence via a child candidate (MUT-019). Real demo-adapter integration suite (16) fails under mutation. Docs contract update is clear. Vercel fork auth ignored; GitHub Actions green.

@CodewithJha
CodewithJha merged commit 0efada0 into CodewithJha:main Oct 16, 2026
6 of 7 checks passed
@CodewithJha

Copy link
Copy Markdown
Owner

Merged — thank you @Sonike. Violated-hit defaults (no more hardcoded refund_limit), child-candidate lineage so the original conversation survives minimize, and a real demo-adapter integration suite that fails under mutation — this is the right Hosted fix for #61.

Related follow-ups that match this Hosted/API work:

  • #55 — Hosted UI token injection / public FastAPI docs surface
  • #60 — Policies page still calling retired 410 APIs
  • #63 — Compose/Railway root + install-at-boot + bind-mount hardening

CodewithJha pushed a commit that referenced this pull request Oct 16, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

[BUG] MUT-008, MUT-019: Hosted minimize defaults to refund_limit and overwrites original genome

2 participants