Repository navigation
[cli] Name an environment by its directory less the project prefix - #279
Merged
Merged
Conversation
The short name wins: a checkout at ores_dev_eager_maxwell is the environment eager_maxwell, the name ORE Studio's trailer and blame reports use. Every caller computes it the same way, and a sync carries an environment already recorded under the long name to the short one in its transaction, moving the activity, scenario and session rows with it. A migration could not: it cannot read a project's prefix. Ownership in blames is a whole-name match now. Co-Authored-By: Claude Code <noreply@anthropic.com>
This branch was previously deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The short name wins, as you chose: a checkout at
ores_dev_eager_maxwellis the environmenteager_maxwell, the name ORE Studio'sEnvironmenttrailer and its blame reports use.Naming
config::environment_namenow takes the project's#+owner_prefix:and strips it from the checkout directory. Sync, the git hooks, test export, serve andblamesall pass it, so one rule names the environment everywhere. An explicit--environmentor#+environment:is taken as given.The rename
A checkout already recorded under the long name is renamed on its next sync, in the sync's own transaction:
corpus.environmentand the four textenvironmentcolumns (activity.campaign,activity.action,test.scenario,agent.agent_session) move together. It is not a migration because the schema does not change and SQL cannot read a project's prefix; the sync knows both the root and the computed name. A deliberately different name for the same checkout is left alone.Ownership
blamesnow treats a report as the environment's only when its owner names it whole; the prefix no longer bridges the two. A stale long name owns nothing.Tests
compass.cli.tests2758 assertions in 267 cases,compass.db.tests1307 in 175. New: the naming rule and its edge cases, the rename across all four tables, and the whole-name ownership.🤖 Generated with Claude Code