Skip to content

feat(rules): resolve accepted per-model rules for launchers - #1

Merged
Ghost-LZW merged 1 commit into
mainfrom
feat/rules-resolver
Nov 26, 2026
Merged

Ghost-LZW merged 1 commit into
mainfrom
feat/rules-resolver

Conversation

@Ghost-LZW

Copy link
Copy Markdown
Owner

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.md would hand it to every model in the repository (unmeasured there), and isolated git worktree runs 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 evaluated append_prompt.

Details

  • Match: a local path inside target.repo wins; a path on another machine matches by a directory component equal to the repository name (match_repos in target.json, default the repo basename), deepest component first.
  • Only policies naming exactly the harness (claude = claude-code) and the model (a [1m]-style suffix and case ignored) match; an overlay bound to another policy_model is ignored.
  • --json adds provenance: target, policy, overlay path, rev (sha256 prefix of the text), bytes, and active ledger problems with an accepted attempt on that overlay.
  • Overlays over --max-bytes (4096) are skipped with a note on stderr.

Tests

python3 -W error -m unittest discover -s tests: 20/20 (5 new in tests/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

`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>
@Ghost-LZW
Ghost-LZW merged commit 83cd8cd into main Nov 26, 2026
3 checks passed
@Ghost-LZW
Ghost-LZW deleted the feat/rules-resolver branch November 26, 2026 17:48
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.

1 participant