Repository navigation
feat(rules): resolve accepted per-model rules for launchers - #1
Merged
Merged
Conversation
`sim rules --harness H --model M --cwd D` prints the overlay SIM accepted for exactly this harness and model in the matching target, wrapped in a <sim-rules rev=...> block, or nothing. Launchers that know the run's model (an orchestrator, a personal assistant) put it before the task prompt, the same place SIM evaluated it. Per-model overlays stay out of files every model reads: another model would get an unmeasured rule, and isolated worktrees do not carry untracked files. A run directory on another machine matches by repository name (match_repos, default the repo basename); --json adds provenance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
sim rules --harness H --model M --cwd D [--repo NAME] [--json]prints the overlay SIM accepted for exactly this harness and model in the best-matching target, wrapped in<sim-rules target=… model=… rev=…>, or nothing at all.Why
A per-model overlay is validated on one model. Writing it into
CLAUDE.md/CLAUDE.local.mdwould hand it to every model in the repository (unmeasured there), and isolatedgit worktreeruns never see untracked files. The program that starts a run knows its model, so it asks at start time and puts the block before the task prompt, which is where SIM's adapters evaluatedappend_prompt.Details
target.repowins; a path on another machine matches by a directory component equal to the repository name (match_reposintarget.json, default the repo basename), deepest component first.claude=claude-code) and the model (a[1m]-style suffix and case ignored) match; an overlay bound to anotherpolicy_modelis ignored.--jsonadds provenance: target, policy, overlay path,rev(sha256 prefix of the text), bytes, and active ledger problems with an accepted attempt on that overlay.--max-bytes(4096) are skipped with a note on stderr.Tests
python3 -W error -m unittest discover -s tests: 20/20 (5 new intests/test_rules.py); plugin tests 3/3. Also run read-only against real private targets: the validated model gets its block, another model gets empty output, ~70 ms per call.🤖 Generated with Claude Code