Add missing development tool definitions - #166
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request expands Brief’s knowledge base and detection engine to recognize additional development tools (via new tool definitions + fixtures), including GitOps tools that require content-aware YAML matching, and adds regression tests to keep those signals stable.
Changes:
- Add knowledge definitions + fixtures for Babashka, OpenTofu, Stack, Chef, BitBake, Buck, Devbox, Jsonnet Bundler, Puppet, Mint, Meteor, Helmfile, Argo CD, and Flux.
- Allow
detect.file_containsto use extension-scoped YAML globs (**/*.yaml/**/*.yml) and bound glob-content reads to 1 MiB per file. - Add focused signal/fixture regression tests and regenerate the README tool inventory.
Reviewed changes
Copilot reviewed 41 out of 42 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| testdata/stack-project/stack.yaml | Fixture for Stack detection. |
| testdata/puppet-project/Puppetfile | Fixture for Puppet detection. |
| testdata/opentofu-project/main.tofu | Fixture for OpenTofu detection. |
| testdata/mint-project/Mintfile | Fixture for Mint detection. |
| testdata/meteor-project/versions.json | Fixture for Meteor detection. |
| testdata/meteor-project/package.js | Fixture for Meteor detection. |
| testdata/meteor-project/.meteor/versions | Fixture for Meteor detection. |
| testdata/jsonnet-bundler-project/jsonnetfile.lock.json | Fixture for Jsonnet Bundler detection. |
| testdata/jsonnet-bundler-project/jsonnetfile.json | Fixture for Jsonnet Bundler detection. |
| testdata/helmfile-project/helmfile.yaml | Fixture for Helmfile detection. |
| testdata/flux-project/gotk-sync.yaml | Fixture for Flux content-aware YAML detection. |
| testdata/devbox-project/devbox.lock | Fixture for Devbox detection. |
| testdata/devbox-project/devbox.json | Fixture for Devbox detection. |
| testdata/chef-project/metadata.rb | Fixture for Chef detection. |
| testdata/chef-project/metadata.json | Fixture for Chef detection. |
| testdata/chef-project/Berksfile | Fixture for Chef detection. |
| testdata/buck-project/METADATA.bzl | Fixture for Buck detection. |
| testdata/buck-project/BUCK | Fixture for Buck detection. |
| testdata/bitbake-project/example_1.0.bbappend | Fixture for BitBake detection. |
| testdata/bitbake-project/example_1.0.bb | Fixture for BitBake detection. |
| testdata/babashka-project/bb.edn | Fixture for Babashka detection. |
| testdata/argocd-project/application.yaml | Fixture for Argo CD content-aware YAML detection. |
| README.md | Regenerated tool inventory list reflecting new tools. |
| knowledge/swift/mint.toml | Add Mint tool definition. |
| knowledge/node/meteor.toml | Add Meteor tool definition. |
| knowledge/haskell/stack.toml | Add Stack tool definition. |
| knowledge/clojure/babashka.toml | Add Babashka tool definition. |
| knowledge/_shared/puppet.toml | Add Puppet tool definition. |
| knowledge/_shared/opentofu.toml | Add OpenTofu tool definition. |
| knowledge/_shared/jsonnet-bundler.toml | Add Jsonnet Bundler tool definition. |
| knowledge/_shared/helmfile.toml | Add Helmfile tool definition. |
| knowledge/_shared/flux.toml | Add Flux tool definition using YAML content globs. |
| knowledge/_shared/devbox.toml | Add Devbox tool definition. |
| knowledge/_shared/chef.toml | Add Chef tool definition. |
| knowledge/_shared/buck.toml | Add Buck tool definition. |
| knowledge/_shared/bitbake.toml | Add BitBake tool definition. |
| knowledge/_shared/argocd.toml | Add Argo CD tool definition using YAML content globs. |
| kb/kb.go | Relax validation to allow YAML extension globs for file-contains patterns. |
| kb/kb_test.go | Add validation tests for YAML-vs-non-YAML content globs. |
| detect/development_tools_test.go | Add regression tests covering new tool signals + fixtures. |
| detect/detect.go | Add bounded reads for glob content inspection; refactor safeReadFile to support limits. |
| detect/detect_test.go | Add regression test asserting glob content reads are bounded. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
andrew
left a comment
There was a problem hiding this comment.
knowledge/_shared/argocd.toml: The file_contains markers are independent substring matches, so unrelated CRDs using kind: Application are reported as Argo CD. I reproduced this with a KubeVela manifest using apiVersion: core.oam.dev/v1beta1; Brief reported Argo CD with high confidence. Please require the argoproj.io API group and an Argo CD resource kind within the same manifest, then add the KubeVela case as a negative regression test.
|
Thanks, Fixed. I added structured YAML resource detection so the API group and kind must match within the same YAML document. Argo CD and Flux now use it, with negative regressions for KubeVela, Argo Workflows and markers split across documents. |
andrew
left a comment
There was a problem hiding this comment.
Please address these before merge:
-
detect/filter.go:295 checks only lowercase .yaml and .yml, while the scanner lowercases extensions. A full scan detects Argo CD in manifest.YAML, but brief diff returns no tools. Normalize the extension and add a CLI-level regression test.
-
kb/kb.go:456 now scores 37 for cognitive complexity, above the configured limit of 30. Extract the YAML resource validation into a focused helper and add cases for blank group and kind values.
|
Fixed both issues. Changed-file extensions are now normalized, with a CLI regression covering |
Closes #145
Summary
Testing
go build ./...go test -race ./...golangci-lint run ./...git diff --check