Skip to content

feat(lib): record written_against and per-key provenance in the shared setup writer #9809

Description

@kyle-sexton

Refs #6594. Slice 2 of 4. Blocked by #9801 (slice 1, the owner doc). Runs in parallel with slice 4.

Problem

No shared setup writer can tell a team-chosen value from an inherited default, so when a plugin changes a recommended default, apply cannot know whether to update the stored value (#6594 Problem 5). lib/setup-apply.mjs on origin/main validates and writes <home>/<plugin>.yaml but records neither the plugin version the file was written against nor a per-value source. Only developer-experience records provenance, and only for its prose file (plugins/developer-experience/skills/setup/reference/conventions-file.md, written_against front matter and per-section source=chosen|default markers).

Fix

In lib/setup-apply.mjs (and the generated per-plugin copies through scripts/sync-shared-copies.sh):

  • Write a top-level written_against: <plugin>@<version> when the writer writes the file, read from the plugin's .claude-plugin/plugin.json.
  • Record per key whether the team chose it or it was inherited, in a separate top-level provenance: map (<key>: chosen for a value the operator set or confirmed, <key>: default for one filled at the plugin default). Values stay flat where they are today, so no existing reader (lib/config-cascade.mjs, lib/parse-concern-value.sh, scripts/check-convention-yaml.sh, the plugins' JSON Schemas) changes what it parses; allow the two new top-level keys where the writer validates. Keep reading a file without provenance (treat its values as chosen, report INFO once).
  • --check: list each default value whose plugin default changed since written_against (INFO), and each chosen value whose default changed, with the old and new default (WARN, never rewritten).
  • Writing with --yes: update default values to the new plugin default and print each change; never change a chosen value.
  • Document the shape in the ## Provenance section of docs/conventions/setup-lifecycle/README.md.

Prose files keep developer-experience's per-section markers; this slice does not change them.

Done when

  • bash lib/setup-apply.test.sh exits 0, with new cases for: written_against written on create; a default value updated after a default change; a chosen value kept and reported WARN with old and new defaults; a file without provenance read with one INFO line
  • bash scripts/sync-shared-copies.sh --check exits 0
  • bash lib/config-cascade.test.sh and bash lib/parse-concern-value.test.sh exit 0, with one new case each reading a file that carries written_against and provenance: and returning the same value as the file without them
  • grep -c 'written_against' docs/conventions/setup-lifecycle/README.md prints 1 or more
  • 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

    The triage sweep dispatched intake triage for this issue (attempt 2 of 2).

  3. 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

    Decision recorded.

    The parent, #6594, is open, filed by a listed human, and carries no hold label, so the Feature parent rule (.github/scripts/intake-triage/admit.mjs:1000-1007) no longer parks this issue, and its blocker #9801 is closed. lib/setup-apply.mjs on origin/main has neither written_against nor provenance. The lifecycle doc moved to docs/contracts/setup-lifecycle/README.md, so this record replaces the body's grep of docs/conventions/setup-lifecycle/README.md with the one below. Agents decided this on evidence under standing direction §1.

    Done when

    • bash lib/setup-apply.test.sh exits 0, with new cases for: written_against written on create; a default value updated after a default change; a chosen value kept and reported WARN with old and new defaults; a file without provenance read with one INFO line. Check: the PR's CI runs it.
    • bash scripts/sync-shared-copies.sh --check exits 0.
    • bash lib/config-cascade.test.sh and bash lib/parse-concern-value.test.sh exit 0, with one new case each reading a file that carries written_against and provenance: and returning the same value as the file without them. Check: the PR's CI runs it.
    • grep -c 'written_against' docs/contracts/setup-lifecycle/README.md prints 1 or more.

    #9809 (comment)

    The issue asks the shared setup writer to record written_against and per-key provenance. The recorded decision above settles the open questions, so nothing further is needed from you. Blocker #9801 is closed. No duplicates found.

    Automated triage, applied by the lanes App.

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

  7. removed
    needs-owner-decision
    on Oct 26, 2026
  8. 7 remaining items

  9. added
    status: ready
    status: confirmed
    and removed
    status: ready
    on Oct 27, 2026
  10. kyle-sexton commented on Oct 31, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded.

    The parent, #6594, is open, filed by a listed human, and carries no hold label, so the Feature parent rule (.github/scripts/intake-triage/admit.mjs:1000-1007) no longer parks this issue, and its blocker #9801 is closed. lib/setup-apply.mjs on origin/main has neither written_against nor provenance. The lifecycle doc moved to docs/contracts/setup-lifecycle/README.md, so this record replaces the body's grep of docs/conventions/setup-lifecycle/README.md with the one below. Agents decided this on evidence under standing direction §1.

    Done when

    • bash lib/setup-apply.test.sh exits 0, with new cases for: written_against written on create; a default value updated after a default change; a chosen value kept and reported WARN with old and new defaults; a file without provenance read with one INFO line. Check: the PR's CI runs it.
    • bash scripts/sync-shared-copies.sh --check exits 0.
    • bash lib/config-cascade.test.sh and bash lib/parse-concern-value.test.sh exit 0, with one new case each reading a file that carries written_against and provenance: and returning the same value as the file without them. Check: the PR's CI runs it.
    • grep -c 'written_against' docs/contracts/setup-lifecycle/README.md prints 1 or more.
  11. added
    needs-triage
    and removed
    status: confirmed
    needs-triage
    on Oct 31, 2026
  12. added
    status: ready
    admission-deferred
    agent-ready
    and removed
    admission-deferred
    on Oct 31, 2026
  13. github-actions commented on Oct 31, 2026

    @github-actions
    Contributor
    No description provided.
  14. github-actions commented on Oct 31, 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