Skip to content

[Feature]: Complete adoption recovery and idempotency coverage #40

Description

@Baziar

Problem statement

Adoption writes project metadata, workspace binding, registry/contract state,
Model/Graph evidence, and agent outputs. Transactional rollback now protects
many writes, but the complete multi-surface transition matrix is not yet one
explicit release gate.

Proposed solution

Current foundation

  • linked adoption without moving/copying source;
  • managed output ownership and lifecycle transaction rollback;
  • re-adoption detection refresh and generated-agent collision protection;
  • project-local entry, workspace binding, canonical aggregation, and freshness sealing;
  • isolated real-repository qualification;
  • parent-plus-nested adoption coverage where an unrelated stale Goal cannot
    roll back a valid project binding.

Remaining work

Test adoption as a state machine:

unmanaged -> linked -> synchronized -> intelligence-current
          -> no-op re-adopt | changed re-adopt | unavailable -> relinked

Acceptance criteria

  • Default-workspace and explicitly selected workspace adoption are covered.
  • Repeating an unchanged adoption is an observable no-op.
  • Runtime/manifest changes invalidate only required downstream evidence.
  • Same-basename projects retain distinct identity.
  • Interruptions before/after project-local commit preserve a recoverable state.
  • Missing or moved linked source reports an exact relink/recovery action.
  • Registry, contract, Model, Graph, Doctor, and agent index agree after every transition.
  • A stale or invalid Goal blocks only the project scope it applies to.
  • Native Linux, macOS, and Windows transition fixtures pass.

Completion evidence

Publish a transition table with expected writes, rollback points, JSON verdict,
and recovery command for each scenario. No transition may leave split-brain
membership while reporting success.

Alternatives considered

The following alternatives or adjacent concerns are intentionally outside this issue:

  • unadopt, detach, or project removal commands; they are not part of the
    current product and require a separate product/safety decision;
  • deleting user source;
  • unrelated workspace archive/delete behavior.

Expected impact

Adoption becomes safely repeatable and recoverable without split-brain registry,
workspace, intelligence, or agent state.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: adoptionAdoption, registry, binding, or recoveryneeds-triageScope, owner, or scheduling is not confirmed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions