feat: add @-mention file reference expansion to .goosehints (#3873)

Summary
Adds support for @filename references in .goosehints files, enabling dynamic inclusion of documentation files with security safeguards.

Changes
Add file reference parsing with regex pattern matching (@README.md, @docs/api.md, etc.)
Implement secure recursive file expansion with path traversal protection
Add ReDoS protection (128KB limit) and circular reference detection
Integrate with existing .gooseignore pattern system
Add comprehensive test suite covering security, functionality, and edge cases
Merge with latest upstream improvements (151 commits ahead)
This commit is contained in:
Kat Hawthorne
2025-08-11 16:07:22 -07:00
committed by GitHub
parent 615d1fca04
commit c2859fd49b
2 changed files with 542 additions and 27 deletions
+8 -3
View File
@@ -156,15 +156,20 @@ async fn run_truncate_test(
}
println!("Responses: {responses:?}\n");
assert_eq!(responses.len(), 1);
// Ollama and OpenRouter truncate by default even when the context window is exceeded
// We don't have control over the truncation behavior in these providers
// We don't have control over the truncation behavior in these providers.
// Skip the strict assertions for these providers.
if provider_type == ProviderType::Ollama || provider_type == ProviderType::OpenRouter {
println!("WARNING: Skipping test for {:?} because it truncates by default when the context window is exceeded", provider_type);
println!(
"WARNING: Skipping test for {:?} because it truncates by default when the context window is exceeded",
provider_type
);
return Ok(());
}
assert_eq!(responses.len(), 1);
assert_eq!(responses[0].content.len(), 1);
match responses[0].content[0] {