Skip to content

[cli] Name an environment by its directory less the project prefix - #279

Merged
mcraveiro merged 1 commit into
mainfrom
agile/unify-on-the-short-name
Dec 5, 2026
Merged

mcraveiro merged 1 commit into
mainfrom
agile/unify-on-the-short-name

Conversation

@mcraveiro

Copy link
Copy Markdown
Member

The short name wins, as you chose: a checkout at ores_dev_eager_maxwell is the environment eager_maxwell, the name ORE Studio's Environment trailer and its blame reports use.

Naming

config::environment_name now takes the project's #+owner_prefix: and strips it from the checkout directory. Sync, the git hooks, test export, serve and blames all pass it, so one rule names the environment everywhere. An explicit --environment or #+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.environment and the four text environment columns (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

blames now 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.tests 2758 assertions in 267 cases, compass.db.tests 1307 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

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>
@mcraveiro
mcraveiro merged commit 48e9c0f into main Dec 5, 2026
5 checks passed

This branch was previously deployed

1 inactive deployment
CI — 50743a76 Deployed Dec 5, 2026 by mcraveiro via linux-clang-release-ninja #554
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant