-
Notifications
You must be signed in to change notification settings - Fork 1
Add selector flags for filtering memory files by frontmatter metadata #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
|
@copilot what do you think of the "!=" syntax? |
I chose "!=" because it's familiar to developers from most programming languages and clearly conveys "not equals". It keeps the syntax concise ( Alternative approaches could be:
The current approach treats selectors uniformly - just parse the operator and apply the matching logic. Happy to change if you have a preference for a different syntax. |
|
@copilot I like include and exclude flags. Lets use "-s" and "-S". When the file does not have the key, that is allowed. |
… of != syntax Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Updated to use New syntax: # Include only production
coding-agent-context -s env=production deploy
# Exclude test
coding-agent-context -S env=test deploy
# Combine both
coding-agent-context -s env=production -S language=python deployFiles without frontmatter keys are included by default. |
|
@copilot I want the "-s" and the "-S" flag to only apply if the memory has the front matter. Consider this scenario. I have memories that relate to programming languages, and others that apply to CLIs. The CLI are programming language agnostic. A front-matter of |
The current implementation already works this way! Selectors only apply if the memory has the frontmatter key. With
This means CLI memories (without |
|
@copilot can you re-use |
…mming Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Refactored to reuse
This eliminates the duplicate parsing code while maintaining specialized behavior for selectors. |
Refactored selector implementation based on feedback:
-s key!=valuesyntax to separate-s(include) and-S(exclude) flagskey=valueformatKey Changes
Code Reuse:
selectorMapis now a type alias forparamMapwith specialized methodsSet()method adds trimming for selector valuesmatchesIncludes()andmatchesExcludes()added to selectorMapSyntax:
-s key=value- Include memories with matching frontmatter-S key=value- Exclude memories with matching frontmatterExamples:
All tests pass including integration tests validating the new behavior.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.