-
Notifications
You must be signed in to change notification settings - Fork 192
Stop prefixing vector_search_endpoints names #5209
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a2abfd6
Remove name prefix for vector_search_endpoints
janniklasrose a3b9b3b
Add agent rule for name-prefix invariant
janniklasrose 0105c89
Rename TestAllNonUcResourcesAreRenamed → TestAppropriateResourcesAreR…
janniklasrose c75ca41
Update changelog re vector_search_endpoints prefix removal
janniklasrose a7724a7
Trim changelog entry for vector_search_endpoints prefix removal
janniklasrose 6d240dc
Drop .agent/rules/name-prefix.md
janniklasrose File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| --- | ||
| description: Rules for resource name prefixing in apply_presets | ||
| globs: | ||
| - "bundle/config/mutator/resourcemutator/apply_presets.go" | ||
| - "bundle/config/mutator/resourcemutator/apply_target_mode.go" | ||
| - "bundle/config/mutator/resourcemutator/apply_target_mode_test.go" | ||
| - "bundle/direct/dresources/*.go" | ||
| paths: | ||
| - "bundle/config/mutator/resourcemutator/apply_presets.go" | ||
| - "bundle/config/mutator/resourcemutator/apply_target_mode.go" | ||
| - "bundle/config/mutator/resourcemutator/apply_target_mode_test.go" | ||
| - "bundle/direct/dresources/*.go" | ||
| --- | ||
|
|
||
| # Rules for resource name prefixing | ||
|
|
||
| `presets.name_prefix` and dev-mode renaming live in `bundle/config/mutator/resourcemutator/apply_presets.go`. They prepend a string to a resource field so deployments from the same bundle don't collide across users or targets. | ||
|
|
||
| **RULE: Only prefix display-name fields. Never prefix a field the API treats as the primary key / object id.** Prefixing an identity-bearing field changes which remote resource the bundle addresses, not just how it's labeled. The user sees a different name in the UI; the deployment also points at a different object. | ||
|
|
||
| To check whether a field is identity-bearing, look at the matching `bundle/direct/dresources/<resource>.go`: | ||
|
|
||
| - If `DoCreate` returns the name as the deployment id (e.g. `id := config.Name`) and `DoRead`/`DoUpdate`/`DoDelete` look the resource up by that name, the name is the primary key — do not prefix it. | ||
| - If the name is purely cosmetic and the API addresses the resource by a separate id (numeric, UUID, etc.), prefixing is fine. | ||
|
|
||
| When you decide a resource's name must not be prefixed, also add the resource type to `notRenamedFields` in `bundle/config/mutator/resourcemutator/apply_target_mode_test.go`. `TestAppropriateResourcesAreRenamed` enforces the invariant for every resource and will fail loudly if a future change reintroduces prefixing. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../.agent/rules/name-prefix.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can shorten this without any loss of signal or even drop this.
The agents are going to read apply_presets.go anyway and should be able figure out from the comments and existing resources what to do for a new one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed and dropped in 6d240dc — checked with both Claude and Cursor (GPT) for a second opinion on whether a rule like this would actually change agent behavior, and both said they would read
apply_presets.goand the test first and that the in-code comment +notRenamedFieldslist with its primary-key rationale is sufficient evidence. The rule was a restatement that got in the way more than it helped.