From 3e6f9a6a5f5cf42429bb93d5636e73d30b8f98f5 Mon Sep 17 00:00:00 2001 From: asepharyana Date: Tue, 14 Jul 2026 10:11:31 +0700 Subject: [PATCH] =?UTF-8?q?test(subagent):=20tambah=20pengujian=20invarian?= =?UTF-8?q?=20read=E2=8A=86write=E2=8A=86full=20pada=20tool=5Fscope?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5 --- src/app/subagent/division.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/app/subagent/division.rs b/src/app/subagent/division.rs index c2da0b9..5f39672 100644 --- a/src/app/subagent/division.rs +++ b/src/app/subagent/division.rs @@ -88,4 +88,14 @@ mod tests { assert!(!tools.contains(&"write".to_string())); assert!(!tools.contains(&"delete".to_string())); } + + #[test] + fn read_tier_is_subset_of_write_tier_and_write_is_subset_of_full() { + use std::collections::HashSet; + let read: HashSet<_> = tools_for(READ).into_iter().collect(); + let write: HashSet<_> = tools_for(WRITE).into_iter().collect(); + let full: HashSet<_> = tools_for(FULL).into_iter().collect(); + assert!(read.is_subset(&write), "read tier must be a subset of write tier"); + assert!(write.is_subset(&full), "write tier must be a subset of full tier"); + } }