Skip to content

Match the Guard's Model Alias Boundaries Regardless of Case - #3525

Merged
ptr727 merged 2 commits into
developfrom
promotion-3521-model-boundary
Oct 27, 2026
Merged

ptr727 merged 2 commits into
developfrom
promotion-3521-model-boundary

Conversation

@ptr727

@ptr727 ptr727 commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Summary

This answers a fourth-round review finding on the promotion pull request #3521. The model-tier guard's names_model() matched the blocked alias inside a workflow script's model value ignoring case, but its boundaries excluded only lowercase letters. So fableX or Xfable matched fable, and a workflow naming either was denied. Both boundaries now exclude any ASCII letter or digit.

The tests now deny a mixed-case claude-Fable-5-1, which holds the case-insensitive half of the match. They also allow fableX, Xfable, and FABLEX, each of which the old boundary denied.

🤖 Generated with Claude Code

ptr727 and others added 2 commits October 27, 2026 12:36
The alias inside a workflow script's model value was matched ignoring case while its boundaries excluded only lowercase letters, so a value such as `fableX` or `Xfable` matched `fable` and was denied. Both boundaries now exclude any ASCII letter or digit, and a test covers the uppercase-adjacent values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 27, 2026 19:38
@ptr727

ptr727 commented Oct 27, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 9925cdcb963ef260068e24b26568a924b140a538, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No unresolved review issues remain, and the changes have complete regression coverage.

No open issues 🎉

What changed in this PR

This pull request fixes case-insensitive model-alias boundary matching in the Claude Code model-tier guard, preventing aliases from matching within longer ASCII alphanumeric model names.

Changes:

  • Expands alias boundaries to exclude uppercase and lowercase letters, plus digits.
  • Adds regression tests for mixed-case blocked model IDs.
  • Adds coverage for valid names containing the alias as part of a longer value.
File Description
host-setup/​agent-safety/​claude/​test_model_tier_guard.py Adds tests for mixed-case denial and alphanumeric containment boundaries.
host-setup/​agent-safety/​claude/​model-tier-guard.py Updates model-alias boundary matching to exclude all ASCII letters and digits.

Review effort: Lite

@codecov

codecov Bot commented Oct 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.56%. Comparing base (fee6f1b) to head (9925cdc).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3525   +/-   ##
========================================
  Coverage    81.56%   81.56%           
========================================
  Files           26       26           
  Lines         8970     8970           
========================================
  Hits          7316     7316           
  Misses        1654     1654           
Flag Coverage Δ
python-3.13 81.56% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727
ptr727 merged commit 97997b2 into develop Oct 27, 2026
14 checks passed
@ptr727
ptr727 deleted the promotion-3521-model-boundary branch October 27, 2026 19:48
ptr727 added a commit that referenced this pull request Oct 27, 2026
…ain (#3521)

## Summary

This promotes three changes to `main`:

- [#3516](#3516) maps
model tiers in one config, `spec/model-tiers.json`, carries the "Model
Tiers" rule into the skills that dispatch, and adds a guard that refuses
a highest-tier dispatch the maintainer did not allow.
- [#3518](#3518) has the
agent-safety installer's hooks share one registration helper.
- [#3520](#3520) has those
hooks share one registration-check loop.

It also carries the fixes for this promotion's own review findings, each
landed on `develop` first:

- [#3522](#3522) requires
a non-empty model name per tier and names both edits a model release
makes.
- [#3523](#3523) states
what the highest-tier allowance covers and where the guard stops.
- [#3524](#3524) rejects a
tier sharing the maintainer-only model and states the allowance as
conduct.
- [#3525](#3525) matches
the guard's alias boundaries regardless of case.
- [#3526](#3526) mirrors
the guard's CI self-tests in the local runbook.
- [#3527](#3527) rejects a
repeated tier name and names every hook the installer registers.

Closes #3517
Closes #3519

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

2 participants