Repository navigation
fix(core): derive fitness premise cues from policy (#41) - #150
Merged
CodewithJha merged 1 commit intoNov 16, 2026
Merged
CodewithJha merged 1 commit into
CodewithJha merged 1 commit into
Conversation
|
@BasilZafar11 is attempting to deploy a commit to the priyanshu's projects Team on Vercel. A member of the Team first needs to authorize it. |
3 tasks
CodewithJha
approved these changes
Nov 16, 2026
CodewithJha
left a comment
Owner
There was a problem hiding this comment.
MERGE READY for #41.
What I verified
- Hard-coded APR/manager/authorization cue list is gone.
_premise_signalnow requires a policy tool mention in assistant text and credits that rule's argument names (when/require/forbid) with normalized whole-word matching. Attacker-only authority English no longer inflates premise. - Mutation check: restoring
main's fitness module fails the new premise tests. - Local:
test_fitness.py20 passed; full unit+integration+reliability → 777 passed. CI green. Docs updated in SYSTEM_DESIGN / PRODUCTION_READINESS.
Approving and squash-merging. Closes #41.
Owner
|
Merged — thank you @BasilZafar11. Premise fitness now tracks the policy's tools/args instead of demo APR English, which is the modularity PRODUCTION_READINESS was asking for. Nearby Core items:
No pressure. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #41
Replace the fixed APR/manager/approval word list in the fitness premise hint with policy tool and argument names. A matching tool name must appear in an assistant turn; that same turn earns additional credit for distinct argument names from that tool's rule (
when,require, orforbid). Case, underscores, punctuation, and spaces are normalized with whole-word matching. The best rule/turn score is used, so unrelated rules, separate turns, repeated names, and attacker-only text cannot accumulate premise credit.The policy is read directly to keep fitness independent of the mutation engine while using the same tool/critical-argument inputs as AttackFocus. The existing
premise_acceptsignal key, weights, three-cue saturation, other signal components, public scoring signature, and violation oracle are unchanged. This remains a deterministic lexical search hint: a mention, including one in a refusal, does not prove acceptance or a violation. No LLM or provider call is added.Update the system-design signal description and production-readiness hardcoding entry to match the implementation.
Type of change
Checklist
Test plan
uv run --locked pytest tests/unit/test_fitness.py -q --tb=short: 20 passed.MUTINY_SAMPLE_OFFLINE=1 uv run --locked pytest -q --tb=short: 777 passed, covering unit, integration, reliability, and packaging tests.uv run --locked ruff check: passed.git diff --check: passed.New cases cover non-refund numeric/require policies, deny/forbid kinds, unrelated demo vocabulary, attacker-only text, name boundaries, separator/case variants, repeated mentions, cross-rule/cross-turn noise, empty policies/output, and the distinction between heuristic credit and a proven violation. Existing exact-one violation and numeric proximity tests still pass.
CLI shell smoke, production web/container builds, and isolated release-artifact shell checks are left to existing CI. Branch starts at current upstream main
99ed9ad, matching fork main at fetch.CI results
All seven jobs passed: Python 3.11/3.12 backend tests, Python lint, package build, CLI smoke, web build, and container smoke.
CI run: https://github.com/CodewithJha/mutiny/actions/runs/43660146244