Repository navigation
Conversation
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]>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
There was a problem hiding this comment.
🟢 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
inheritingAgentTypesis 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 Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Promotes
developtomain. It carries these changes:inheritingAgentTypes.modelsraises aTypeErrorthe existingtrycatches, and a deep-nestingRecursionErroris outside the hook's stated scope. The hook runs standalone and cannot importis_str_list. Empty or duplicate names do no harm in the hook.Closes #4291
Closes #4285
🤖 Generated with Claude Code