Skip to content

I1108 — The desired integration is a value, and the plan is a diff

Compute what a repository's Majordomus integration should look like as a typed value, diff it against what the repository actually holds, and make the apply the smallest mutation that closes the gap.

BLOCKED wave 3 · p0 · deep-work profile · parallel safe

Part of two-folder-integration — A repository that adopts Majordomus gains two directories and two lines, and can give them back.

Blocked. This issue cannot start until I1106 is done. The status is derived from that, not declared.

Objective

Compute what a repository's Majordomus integration should look like as a typed value, diff it against what the repository actually holds, and make the apply the smallest mutation that closes the gap.

Why

`init` that writes what it was written to write cannot be run twice, cannot be previewed, and cannot be undone. A desired state that is a value can be compared, shown before it is applied, and reversed.

Current state

Initialisation writes a skeleton. Nothing computes what is missing, nothing reports what would change, and running it again is not a defined operation.

Desired state

One function produces the desired integration from the repository model, one produces the difference, and the apply consumes the difference — so a dry run is the same computation without the last step.

Scope

  • apps/majordomus-cli/src/commands/init.rs
  • apps/majordomus-cli/src/integration

Out of scope

  • Applying anything the dry run did not show
  • A desired state that depends on a configuration file rather than on the model

Dependencies

What waits on this

Acceptance criteria

  • The desired integration is derived from the repository model, and a repository that already conforms produces an empty difference
  • The difference is a typed value that names every path it would create, modify or remove, and why
  • A dry run performs the same computation as an apply and mutates nothing
  • The apply performs exactly the difference and nothing else, proved by comparing the tree before and after against the plan
  • A mutation the plan did not name is a bug, and a test proves the apply cannot make one

Validation

  • majordomus init --dry-run
  • cargo test --workspace --all-features

Evidence required

  • desired_state_typed
  • plan_is_diff
  • dry_run_mutates_nothing

Evidence

None recorded. Every token above needs a command or an artifact behind it before this issue can be completed; narrative is refused.

Risk

A reconciler that computes what a repository should look like will eventually be wrong about one. Everything it would do outside the two namespaces must be visible before it is done.

Timeline

started
verified
completed

Those three fields, the evidence above and the state of the dependencies are all the status is made of. There is no status field to disagree with them.

Canonical record: .ai/repo/project/issues/I1108.yaml. Read it back with majordomus plan show I1108.