Skip to content

test: isolate persisted violation traces from committed examples - #85

Merged
CodewithJha merged 1 commit into
CodewithJha:mainfrom
fatihcvs:test/isolate-persisted-trace
Sep 24, 2026
Merged

CodewithJha merged 1 commit into
CodewithJha:mainfrom
fatihcvs:test/isolate-persisted-trace

Conversation

@fatihcvs

Copy link
Copy Markdown
Contributor

Summary

Fixes #72. Persist the M4 violation artifact under pytest's tmp_path instead of overwriting the tracked example on every run. Keep the existing tool-call assertion and verify the complete JSON round trip plus the violated refund rule.

The committed example and its annotated documentation remain unchanged. I reproduced the random seed-ID change while running the previous unit suite; after this change the full unit suite leaves examples/traces/ clean.

Type of change

  • Tests

Checklist

  • Read CONTRIBUTING.md
  • Linked related issue
  • Core stays free of framework SDK imports
  • Tests updated and full unit suite run
  • Documentation claims remain accurate
  • One concern per PR
  • Authorized offline testing only

Test plan

  • pytest tests/unit -q --tb=short: 376 passed on Python 3.12.14, with MUTINY_SAMPLE_OFFLINE=1 and PYTHONUTF8=1.
  • git diff --exit-code -- examples/traces: clean after the suite.
  • git diff --check: passed.

Based independently on main; does not include #83.

@vercel

vercel Bot commented Sep 24, 2026

Copy link
Copy Markdown

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

A member of the Team first needs to authorize it.

@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.

Thanks @fatihcvs — this hits #72 / MUT-024 cleanly: persistence is asserted under pytest tmp_path, so unit runs no longer rewrite examples/traces/m4_refund_limit_violation.json. The committed example and annotated docs stay the hand-maintained fixture. GitHub Actions green on 3.11/3.12; ignoring Vercel auth.

@CodewithJha
CodewithJha merged commit a884c1e into CodewithJha:main Sep 24, 2026
5 of 6 checks passed
@CodewithJha

Copy link
Copy Markdown
Owner

Merged — thank you @fatihcvs. Exactly the kind of tests-hygiene lock Mutiny needs: the M4 persistence assertion still holds, and pytest no longer rewrites a tracked example trace.

If you'd like to continue working on Mutiny, these would be good related areas to look at:

  • #75 — CLI / loader / reliability tests still miss several product paths
  • #57 — mutiny run error-path coverage (adapter/config failures should not traceback)
  • #69 — in-process second project load can reuse the first agent module; a tests-shaped isolation bug

No pressure — only if you want another one.

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.

[TEST] MUT-024: Unit test rewrites a tracked example trace

2 participants