Skip to content

feat(lib): let the shared setup writer converge by detected state (init, migrate, configure) #9862

Description

@kyle-sexton

Refs #6594. Slice 3 of 4. Blocked by #9809 (slice 2; migrate must carry provenance).

Problem

docs/plugin-philosophy.md:629-631 calls apply state-assessing, but the shared writer lib/setup-apply.mjs only creates or updates <home>/<plugin>.yaml from key=value arguments. It does not detect which of three states a repository is in and act on it (#6594 Setup actions):

  • no conventions: init;
  • config at an old location declared in the plugin's retirements.yaml (docs/conventions/retired-conventions/README.md): migrate;
  • existing config: configure.

So every plugin's setup skill re-describes this in prose, and a migration can drop a value silently.

Fix

Add state detection to lib/setup-apply.mjs (and its generated copies):

  • A --state flag prints exactly one of init, migrate, configure, with the evidence path, and writes nothing.
  • In the migrate state, --yes moves every value from the retired location named by the plugin's retirements.yaml record into <home>/<plugin>.yaml, carrying its provenance (slice 2); a value it cannot carry is printed and the old file is left in place. When both locations exist, the new one wins and the run warns, naming both paths.
  • A second run with no changed inputs writes nothing.
  • Document the three states in docs/conventions/setup-lifecycle/README.md.

Out of scope: moving any real plugin's surface (#5906 carries those).

Done when

  • bash lib/setup-apply.test.sh exits 0, with new cases for: --state printing init, migrate and configure on three fixtures; a migrate that carries every value and its provenance entry; a value that cannot be carried leaving the old file in place; both locations present (new wins, warning names both); a second run producing no diff (git status --porcelain empty in the fixture)
  • bash scripts/sync-shared-copies.sh --check exits 0
  • ci-status is green on the PR head

Activity

  1. added
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Oct 24, 2026
  2. github-actions commented on Oct 24, 2026

    @github-actions
    Contributor

    Proposed work class: work-class: scoped
    Basis: automated intake triage; the lanes App applied this class.

    Size: Medium
    Complexity: Medium
    Uncertainty: Known
    Flags: none
    Blocked by: #9809

    Understood: add state detection (init, migrate, configure) to the shared setup writer. That means a read-only --state flag, a --yes migrate that carries values and provenance from the retired location, a rule that the new location wins when both exist, idempotent reruns, and docs for the three states. The done-when checks are concrete. The issue says it is blocked by #9809 (provenance in the writer), which is still open. Related parent: #6594.

    Automated triage, applied by the lanes App.

  3. added
    priority: mediumReal value, no hard deadline; normal backlog flow.
    and removed
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Oct 24, 2026
  4. added
    status: readyTriaged, unblocked, and fully specified; eligible to pick up.
    work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.
    status: needs-decisionAwaiting a human or maintainer judgment call.
    on Oct 24, 2026
  5. melodic-automation-lanes commented on Oct 24, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane: a Feature needs an open parent issue a listed human filed that awaits no decision. Admission takes the issue once each of those is met, when intake triages it again (.github/actions/resolve-config/admission-rules.json).

  6. kyle-sexton commented on Oct 26, 2026

    @kyle-sexton
    MemberAuthor

    Released for re-triage under the owner's 2026-10-26 rule: a person is involved only for "1. A change in original intent/vision 2. Something comes up during implementation ... that alters intent/vision or the primary design 3. If there is a HIGH/CRITICAL security issue". None applies here, so the hold label came off and intake triage runs again now.

    To hold this issue again, add needs-human (or status: needs-decision) and name which of the three applies.

  7. added
    status: readyTriaged, unblocked, and fully specified; eligible to pick up.
    status: confirmedA maintainer confirmed the item is real and in scope; ready to be worked.
    and removed
    status: readyTriaged, unblocked, and fully specified; eligible to pick up.
    on Oct 26, 2026
  8. melodic-automation-lanes commented on Oct 26, 2026

    @melodic-automation-lanes
    Contributor

    The latest triage verdict holds nothing: admission moved the issue to status: confirmed; its comment says why.

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

    priority: mediumReal value, no hard deadline; normal backlog flow.status: confirmedA maintainer confirmed the item is real and in scope; ready to be worked.work-class: scopedA briefed fix or small feature; blast radius bounded by the brief, tests exist.

    Fields

    No fields configured for Feature.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions