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-triage
    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: none

    Understood: add state detection to lib/setup-apply.mjs and its generated copies. --state prints init, migrate or configure with the evidence path and writes nothing. --yes in the migrate state carries every value and its provenance from the retired location. An uncarriable value leaves the old file in place. When both locations exist, the new one wins and the run warns. A second run writes nothing. The three states are documented in the setup-lifecycle convention.

    The done-when items are exact, so nothing is missing. #9809 (slice 2) is not in the open-issues list, so I listed no blocker. No duplicate found.

    Automated triage, applied by the lanes App.

  3. added and removed
    needs-triage
    on Oct 24, 2026
  4. added
    status: ready
    needs-owner-decision
    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. removed
    status: ready
    on Oct 24, 2026
  7. removed
    needs-owner-decision
    on Oct 26, 2026
  8. 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.

  9. added
    status: ready
    on Oct 26, 2026
  10. 1 remaining item

  11. removed
    status: ready
    on Oct 26, 2026
  12. melodic-automation-lanes commented on Oct 26, 2026

    @melodic-automation-lanes
    Contributor

    The latest triage verdict holds nothing: the issue is at status: ready.

  13. removed
    status: confirmed
    on Nov 1, 2026
  14. added
    needs-triage
    and removed
    needs-triage
    on Nov 1, 2026
  15. added
    status: ready
    admission-deferred
    agent-ready
    and removed
    admission-deferred
    on Nov 1, 2026
  16. melodic-automation-lanes commented on Nov 1, 2026

    @melodic-automation-lanes
    Contributor

    This records a re-fire of an earlier refusal, not a new refusal. The lanes kill switch stopped run 41256376386, the work-resolve-issue run that agent-ready started, before it did any work; that run ended at 2026-11-01T00:22:53Z. work-unblock has now removed and added agent-ready back to start a fresh run. A kill-switch refusal is no fault in this issue or the lanes, so it never counts against later re-fires; after limits.limit-stops-per-issue of them since a person last added agent-ready or a run last reported, work-unblock waits longer before each one, up to 24 hours.

  17. added
    agent-ready
    and removed
    agent-ready
    on Nov 1, 2026
  18. github-actions commented on Nov 1, 2026

    @github-actions
    Contributor
    No description provided.
  19. github-actions commented on Nov 1, 2026

    @github-actions
    Contributor
    No description provided.
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

    agent-readystatus: ready

    Fields

    No fields configured for Feature.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions