Skip to content

Move a repository from the pre-.ai layout to the layer

See what a migration would move, move it with a backup, and prove the result is a layer the tool reads.

described Getting started and adoptionbasicmaintainerwrites state

Situation

A repository installed Majordomus before the .ai/ layer existed and keeps its policy under .majordomus/. Every command refuses to read it, and the maintainer wants to know what will move before anything does.

Scenario

setup: legacy-layout
given:
  - 'project data under .majordomus/, the pre-.ai layout, and no manifest'
steps:
  - id: plan-it
    run: ['migrate', '--dry-run']
    note: 'every move named, nothing written'
    expect:
      exit: 0
      stdout_contains: ['^migrate: \.majordomus/ \(pre-\.ai layout\) -> \.ai/', 'move  \.majordomus/policy\.yaml -> \.ai/repo/policy\.yaml']
  - id: do-it
    run: ['migrate']
    note: 'the files move, the old directory is backed up, the manifest is written'
    expect:
      exit: 0
      stdout_contains: ['^migrated: \.ai/ is the layout']
  - id: nothing-left
    run: ['migrate']
    note: 'a second migration says the layer is already there and moves nothing'
    expect:
      exit: 0
      stdout_contains: ['^already migrated: \.ai/manifest\.yaml is present']
then:
  - 'the migration is explicit, dry-runnable and backed up'
  - 'afterwards every command reads the layer and refuses the old path by name'

Outcome

migrate --dry-run lists every move; migrate performs it with a backup and writes the manifest; a second run says there is nothing to migrate, and doctor proves the layer is real.

No scenario yet

This use case is described, not proved: it names its commands and rules, and nothing executes it. It cannot be more than described until a scenario is added.

Why the tool knows this

The chain from this page to the code: the use case names commands, rules and claims; each rule is dispatched from the registry and each claim names the test that proves it; the scenario above executed the commands. Nothing in this chain is prose about intent.

The rules that make it hold

Guarantees exercised

Related use cases

Computed from what they share: claims, rules, commands, category, applications. Nobody maintains this list.