feat(server): secret filter on everything that crosses to a peer
OutboundFilter over dirigent_fermata runs in LinkTransport before the cap: known values of the sender's checkout and the config dir, then the scanner's High findings, over body, error, persona and as_of project. A root that cannot be read refuses the message; the reason names no path because it can cross. A card loses that agent's title and project instead. The instance's own text crosses a broken config with the built-in rules only, as an asker has no timeout. Fermata's walker no longer enters skipped directories, which it walked per message otherwise. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -287,6 +287,28 @@ fn skips_git_and_node_modules_directories() {
|
||||
);
|
||||
}
|
||||
|
||||
/// Only directories below the root are skipped: the root may be named `target`,
|
||||
/// and a plain file may be named like a skipped directory.
|
||||
#[test]
|
||||
fn a_root_named_like_a_skipped_directory_is_still_read() {
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
let root = dir.path().join("target");
|
||||
fs::create_dir_all(root.join("sub")).unwrap();
|
||||
fs::write(root.join(".env"), "API_KEY=root-api-key-12345\n").unwrap();
|
||||
fs::write(root.join("sub/.env"), "TOKEN=nested-token-12345\n").unwrap();
|
||||
fs::create_dir_all(root.join("sub/target/deep")).unwrap();
|
||||
fs::write(root.join("sub/target/deep/.env"), "TOKEN=skipped-token-12345\n").unwrap();
|
||||
|
||||
let config = config_from_toml("[files]\npatterns = [\".env\", \"node_modules\"]\n");
|
||||
fs::write(root.join("node_modules"), "not a directory\n").unwrap();
|
||||
let manifest = Manifest::build(&config, &root).unwrap();
|
||||
|
||||
let values: Vec<&str> = manifest.entries().iter().map(|e| e.value.as_str()).collect();
|
||||
assert!(values.contains(&"root-api-key-12345"), "{values:?}");
|
||||
assert!(values.contains(&"nested-token-12345"), "{values:?}");
|
||||
assert!(!values.contains(&"skipped-token-12345"), "{values:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn opaque_file_formats_are_skipped_gracefully() {
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user