Skip to content

Promote Develop to Main: Fail Closed on a Malformed inheritingAgentTypes and Close Further Retired-Path Edges - #4296

Merged
ptr727 merged 2 commits into
mainfrom
develop
Nov 19, 2026
Merged

ptr727 merged 2 commits into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Summary

Promotes develop to main. It carries these changes:

  • #4293 makes the tier guard fail closed on a malformed inheritingAgentTypes.
    • Declined points. A list-valued models raises a TypeError the existing try catches, and a deep-nesting RecursionError is outside the hook's stated scope. The hook runs standalone and cannot import is_str_list. Empty or duplicate names do no harm in the hook.
  • #4295 closes further latent edges in the retired-path checks. Its body lists 7 declined edges with evidence under "Declined edges", and Close Remaining Latent Edges Found Closing 4285 #4294 tracks the two leftover edges.

Closes #4291
Closes #4285

🤖 Generated with Claude Code

ptr727 and others added 2 commits November 19, 2026 12:35
Closes #4285

Fixes two of the nine latent edges and declines seven with evidence.

## Fixed

- `render_report` no longer reads a disposition row with an empty
`repos` list as resolved. Test:
`test_a_disposition_row_with_no_repos_is_not_read_as_resolved`.
- The no-ledger fixture strips the git location variables a hook sets,
via `spec/git_env.without_git_location`. Test:
`test_the_drop_check_runs_where_the_ledger_is_absent`, which now builds
its scratch repository with the stripped environment.

## Declined edges

- **Tree-source-only path called required.** The shipped `lib/sh` to
`lib/fleet/sh` tree has differing ends, but the refusal is protective:
lifting it (tried, reverted after the local pass) lets a retire row
through on a tracked source path, and `spec/audit.py` (the `kind ==
"retire" and path in hub_tracked(None)` branch) then tells repos to
delete it as hub-hosted with no `matches_hub_history` check. No shipped
row or pin sits under `lib/sh`. Rewording needs a new condition.
Recorded in #4294.
- **Pin under a repo-owned root loops two remedies.** The only shipped
owned root is `tests`, and `CARRIED_PATH_PINS` holds no path under it,
so no input reaches it. A fix adds a third remedy branch.
- **Failed `git ls-files` skips the whole check.** Reachable only for a
tree outside git. The gate still fails, so nothing passes wrongly, and
the shipped gate always runs in a git tree. A fix splits the function
into tracked-set and non-tracked-set halves.
- **Fleet-wide `accepted` row on a still-declared target.**
`spec/divergences.json` holds no gap row on `.github/skills` or
`lib/fleet/sh`. A fix adds a condition to `dropped_tree_errors`.
- **Source equals target tree dropped.** Needs the maintainer to drop
the `.github/skills` declaration, which no shipped input does. A fix
needs a per-file settlement mechanism.
- **Tree failing validation left out of the declared set.** Both shipped
trees validate, and the gate is clean on them. A fix reads the raw tree
list, a new condition.
- **Target moved to an enclosing path.** The shipped targets are
unchanged, and a move is a manifest edit nobody has made. A fix adds a
path-prefix comparison.

## Review

Local strict review passes: 1 finding (edge, on my own fix, which was
deleted), 3 findings (2 real fixed or declined, 1 edge filed in #4294),
0 findings. Declined pass finding: the comment over the disposition
filter, since an empty list is a malformed row and `well-formed entries`
covers it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
)

## Summary

`load_tiers` in the tier guard lower-cased each `inheritingAgentTypes`
entry outside its `try`. A non-string entry raised `AttributeError`. The
hook exited non-zero, and Claude Code treats a hook error as allow, so
the dispatch went through. A bare string or a mapping never raised, but
it iterated silently into a set of characters or keys.

The value must now be a list of strings. Anything else is read as an
unreadable mapping. That is the hook's existing fail-closed state: every
dispatch naming a model is refused, and one naming none is allowed, as
the module docstring states for a missing config. The docstring now
names this case too.

No current input reaches this. `spec/validate.py` checks the key's
shape, and the deployed mapping is a copy of the validated file. It
takes a hand-edited or partially deployed mapping.

## Verification

- New test `test_a_malformed_inheriting_list_is_treated_as_missing`
covers a non-string entry, a `null` entry, a bare string, a mapping and
a number. Against the previous hook all five subtests fail. With the fix
the whole suite passes, 26 tests, and `--selftest` passes.
- `ruff check`, `ruff format --check`, mypy and the prose gate pass in
the pre-commit hook.
- A `local-strict-review` pass at the `frontier` tier is recorded
against `develop` with no findings.

The maintainer reads this diff before it merges, since it changes
`host-setup/agent-safety/`.

Closes #4291

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* Malformed model-tier configuration is now rejected, preventing named
models from being allowed based on invalid settings.
* **Tests**
* Added coverage for malformed configuration values and their resulting
access decisions.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings November 19, 2026 20:54
@coderabbitai

coderabbitai Bot commented Nov 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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

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 active review issues are identified, and the changes include regression coverage for the hardened configuration and retired-path validation behaviors.

No open issues 🎉

What changed in this PR

This pull request promotes develop to main while hardening model-tier configuration and retired-path validation so malformed inputs fail safely.

Changes:

  • Fail closed when inheritingAgentTypes is not a list of strings.
  • Prevent empty-repository disposition rows from being treated as resolved.
  • Isolate temporary Git validation tests from inherited repository-location variables.
  • Add regression coverage for these behaviors.
File Description
tests/​test_spec_validate.py Runs temporary repository validation with inherited Git location variables removed.
tests/​test_fidelity_honesty.py Verifies that disposition rows with empty repository lists remain untriaged.
spec/​fidelity_honesty.py Excludes disposition rows without repositories from resolution checks.
host-setup/​agent-safety/​claude/​test_model_tier_guard.py Tests fail-closed behavior for malformed inheriting-agent configuration.
host-setup/​agent-safety/​claude/​model-tier-guard.py Rejects non-list or non-string inheritingAgentTypes values as malformed configuration.

Review effort: Lite

@codecov

codecov Bot commented Nov 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.02%. Comparing base (8a1441e) to head (b352fb9).
⚠️ Report is 513 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4296      +/-   ##
==========================================
+ Coverage   78.95%   79.02%   +0.07%     
==========================================
  Files          42       42              
  Lines       15625    15625              
==========================================
+ Hits        12337    12348      +11     
+ Misses       3288     3277      -11     
Flag Coverage Δ
python-3.13 79.02% <ø> (+0.07%) ⬆️

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 7248333 into main Nov 19, 2026
14 checks passed
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.

Fail Closed on a Malformed inheritingAgentTypes in the Tier Guard Close Further Latent Edges in the Retired-Path Checks

2 participants