镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

test(rules): an inherited operator allowlist keeps its default deny - #104

Merged
senamakel merged 1 commit into
mainfrom
operator-layers-default-deny-test
Nov 3, 2026
Merged

senamakel merged 1 commit into
mainfrom
operator-layers-default-deny-test

Conversation

@senamakel

Copy link
Copy Markdown
Member

Follow-up to #103, which merged before this commit landed. Adds inherit_operator_layers_keeps_a_default_deny_allowlist, which checks that a config layer with default: deny and one allow rule still admits only the listed tool after inherit_operator_layers. This was CodeRabbit's suggestion on #103.

Public API: none. Test only.

Validation: cargo fmt --all -- --check ok; cargo clippy -p tinytools --all-targets --all-features -- -D warnings ok; cargo test -p tinytools inherit_operator: 2 passed.

Add a test verifying that inheriting operator layers preserves a config layer whose default is deny with an explicit allow rule, so allowlisted tools stay callable while others remain blocked.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@tinysweeper

tinysweeper Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Reviewed head: d759b1f1f7cffed351ca1dda0ad2f2941bb6d925

Verdict: Ready for maintainer review · Priority: none
Coverage: Reviewed 1 of 1 files.
Pull request purpose (title): test(rules): an inhe…

Diagnostics and supporting details

Full summary

Pull request purpose (title): test(rules): an inherited operator allowlist keeps its default deny. This pull-request is a test-only follow-up to #103, adding `inherit_operator_layers_keeps_a_default_deny_allowlist` to confirm that `inherit_operator_layers` preserves a `config` layer carrying `default: deny` plus a single allow rule, so the inherited set admits the listed tool and refuses others. No production code and no public API change are involved. Validation results are reported only as stated in the pull-request description.

Review snapshot

Change surface Files Review signal Count
Production 0 Active findings 0
Tests 1 Noted findings 0
Documentation 0 Resolved findings 0
Configuration 0 Pending checks/questions 0

Completeness: Complete
Test assessment: No supported feature-to-test mapping was available; this does not mean tests are absent or passed.

What changed

A single test is added to `crates/tinytools/src/rules/mod_tests.rs`. It constructs a rule set with a `config` layer set to `default: deny` and one allow rule matching `file_read`, calls `inherit_operator_layers`, then asserts the inherited set evaluates `file_read` as callable and `shell` as not callable on `Surface::Call`. No production code is modified; the change pins inheritance behavior that preserves non-permissive layers and their allowlists. The review lanes found the test consistent with the implementation and with existing helpers in the file.

Features

  • Added — Regression test for inherited deny-by-default allowlists: Pins that an operator-inherited `config` layer with `default: deny` and one allow rule survives inheritance with its allowlist intact, so only the listed tool is callable and unlisted tools such as `shell` remain refused. Test-only; no runtime behavior or public API changes. (crates/tinytools/src/rules/mod_tests.rs fn inherit_operator_layers_keeps_only_config_and_named_config_layers() {, crates/tinytools/src/rules/mod_tests.rs)

Tests

No supported feature-to-test mapping was produced. Test execution is not inferred.

Findings

No active actionable findings.

Before merge

None.

Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The answered critique lane found the assertions match the implementation: `inherit_operator_layers` retains layers named `config`/`config:*` via `push`, and the deny-by-default layer with a rule is not permissive, so its allowlist still refuses `shell`. No defect found.
  • Lane summary: I checked the new test against the code it exercises. `inherit_operator_layers` keeps layers named `config`/`config:*` by cloning them and pushing them via `push`; a layer with `default: deny` and at least one rule is not permissive, so it survives the push and its allowlist still refuses `shell`. The test's assertions (`file_read` callable, `shell` not callable) match the implementation, and the helper `layer`/`ctx`/`ToolSubject::named`/`Surface::Call` usage is consistent with the rest of the file. No defect found.

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The answered security lane found the test matches the implementation (`push` only skips permissive layers; `evaluate` intersects the copied layer), the file already has a module-level doc comment, and the test name is behavioral. No security or correctness defect found.
  • Lane summary: The diff adds a single test pinning `inherit_operator_layers` behaviour: it builds a `config` layer with `default: "deny"` and an allow rule for `file_read`, then asserts the inherited set admits `file_read` and refuses `shell` on the call surface. That matches the implementation (`push` only skips permissive layers, and `evaluate` intersects the copied layer), the file already opens with a module-level `//!` doc, and the test name is behavioural. No security or correctness defect found.

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: The diff adds one test to `crates/tinytools/src/rules/mod_tests.rs` and changes no production code, so there is no behaviour to regress and no test-coverage gap to report. The new test `inherit_operator_layers_keeps_a_default_deny_allowlist` is a real assertion: it pins that a `config` layer with `default: deny` and an allow rule for `file_read` survives `inherit_operator_layers` such that `file_read` is callable and `shell` is not — if inheritance dropped the layer or reset its default, the second assertion would fail. It complements the existing `inherit_operator_layers_keeps_only_config_and_named_config_layers` test, which only checks layer names and deny rules. No findings.

commits

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The answered commits lane reported no sensitive content in committed files.
  • Lane summary: No sensitive content in committed files.

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The answered description lane found the test-only description matches the diff exactly, uses helpers already present in the file, and follows repository naming and test rules with no reportable defect.
  • Lane summary: The change adds a single test, `inherit_operator_layers_keeps_a_default_deny_allowlist`, exercising a `config` layer with `default: deny` and one allow rule through `inherit_operator_layers`, and the description matches the diff exactly (test only, no public API). The test uses helpers (`layer`, `ctx`, `ToolSubject::named`, `Surface::Call`) already present in the file, follows the repository's sibling-file test and behavioural-name rules, and I found no reportable defect.
Evidence and run details
  • Models: ladder/vectors-oai3, deepseek-v4.1-flash
  • Spend: $0.001666
  • Tokens: 112861 input · 5401 output · 15872 cached · 79 embedding
  • Updated: 2026-11-03T15:40:47Z
Head State Pass summary
d759b1f1f7cf ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-11-03T15:40:47Z)

tinysweeper 0.1.2

@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 1 billable file and costs up to $0.25.

Or wait 50 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 37395358-9b57-4725-a233-a5122017cd54
Commits

Reviewing files that changed from the base of the PR and between 080459c and d759b1f.

Files selected for processing: 1
  • crates/tinytools/src/rules/mod_tests.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T15:41:01.851935Z d759b1f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

tinysweeper found nothing blocking. Approving.

Diagnostics

Total spend: $0.0017

@senamakel
senamakel merged commit 2905bb2 into main Nov 3, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant