Skip to content

Provision a record's declared prerequisites automatically in worktrees, unattended runs and CI #16683

Description

@kyle-sexton

Problem

After #16646 a record declares what each command needs, and a check whose prerequisite is missing reads not run. Nothing installs those prerequisites: an agent or a person does it by hand each time a worktree is created or a host is new, and an unattended run can only report and stop.

Seen on 2026-11-16: the worktree skill's create script already runs npm ci on its own when it makes a worktree (reported by three workers; not yet read in the script by the filing session), which is an install outside any declared list.

Decision

Owner, 2026-11-16, typed in the GitHub Work session, verbatim: "I think being upfront with what the requirements are makes it easy for the agent to know: 'Okay, do I have the capability to install this stuff?' It should advocate and say, 'Hey, if it's something that repeatedly has to be installed, if it's in worktrees, there has to be some automated process.' Whether it's caching or something that just repeats or eliminates repeated friction, whether it's local or in unattended runs, CI workflows, making sure that we're caching things, all of that." He then accepted the recommendation that provisioning be its own issue, outside #16646. Posted by an agent session.

Open design (the owner's, by interview before any build)

Done when

  • The owner's answers to the design questions are recorded here.
  • A declared prerequisite missing in a fresh worktree is installed by the provisioning step with no manual command, and an unattended run that cannot install still reports the not-run cell.
  • Toolchain's not-run report points at this mechanism by name.

Related

Refs: #16646, #15703.

session: GitHub Work

Activity

  1. added
    needs-triage
    on Nov 17, 2026
  2. github-actions commented on Nov 17, 2026

    @github-actions
    Contributor

    Size: Medium
    Complexity: Medium
    Uncertainty: Known
    Flags: none
    Blocked by: none
    Blast radius: the ecosystem-commands contract schema, README and changelog, the provisioning step and its tests, .claude/ecosystems/typescript.yaml, the source-control worktree-create.sh and its create.md, and Toolchain's not-run report. Everyone who creates worktrees or runs the checks sees the change.
    Reversible: yes; revert the change. Worktrees would then get root node_modules from the old npm ci call again.
    Open questions: none

    Decision recorded. Owner, 2026-11-22, chosen in the GitHub Work session (verbatim): "Fallback with end date (Recommended)".
    #16683 (comment)

    The newest recorded decision settles the last open design question: an undeclared root lockfile still installs with scripts off and a printed notice, until the contract's next major version. The earlier decision amendments stand, so I found no open question left. The work is to add the install object to the schema, add the provisioning step, fold the worktree script's npm ci into it, declare the TypeScript record's lockfile, and make the not-run report name the step. The change needs a path the issue lane could not push, so it is already on the host-run route.

    Automated triage. A maintainer reviews it.

  3. added
    needs-owner-decision
    on Nov 17, 2026
  4. melodic-automation-lanes commented on Nov 17, 2026

    @melodic-automation-lanes
    Contributor

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

  5. melodic-automation-lanes commented on Nov 17, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane: it carries host-run. Admission takes the issue once each of those is met, when intake triages it again (.github/actions/resolve-config/admission-rules.json).

  6. melodic-automation-lanes commented on Nov 17, 2026

    @melodic-automation-lanes
    Contributor

    Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.

    Intended outcome: A declared provisioning step, run at worktree creation and in CI setup, installs only what records' requires entries name from a lockfile, with caching, outside the check itself, and the worktree create script's npm ci folds into it.

    Dependencies

    • #​16646 (open): records' requires declarations and the not-run cell must exist first

    Related work

    Open questions

    1. Where does provisioning run (worktree creation, a lane's setup, CI), and what may it install: only what records' requires entries name, from a lockfile, with install scripts off?
      RECOMMENDED: A separate declared step at worktree creation and in CI setup, installing only requires-named items from a lockfile with install scripts off. Basis: judgment
    2. How does it square with 'unattended lanes install nothing' (#​15703 AC5)?
      RECOMMENDED: Provisioning is a separate declared step outside the check, so the check installs nothing; a lane that cannot run the step still reports the not-run cell. Basis: judgment
    3. What is cached, where, and for how long?
      RECOMMENDED: The package manager's download cache, keyed on the lockfile hash, in CI cache storage and the local user cache, with default expiry. Basis: judgment
    4. What happens to the worktree create script's existing npm ci?
      RECOMMENDED: Fold it into the provisioning step so there is one install path. Today it runs npm ci non-fatally when package-lock.json exists. Basis: plugins/source-control/skills/worktree/context/create.md:55
    5. How does the ci-workflows TypeScript test run once its record no longer installs its package, and who removes the subpackage's node_modules afterwards?
      RECOMMENDED: The provisioning step installs it and the same step cleans up, keeping the check read-only. Basis: judgment

    Sources read

    • plugins/source-control/skills/worktree/context/create.md:55: worktree create runs npm ci when package-lock.json exists, non-fatal on failure
    • plugins/source-control/skills/worktree/context/create.md:175: Node row says the helper already ran npm ci for a package-lock.json, otherwise the project's package manager install

    To answer, post a comment that starts with this line:

    **Decision recorded.** <answer>
    

    Automated refinement by the lanes App. Answer with a comment whose first line is **Decision recorded.**.

  7. kyle-sexton commented on Nov 17, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded. The owner chose that a separate provisioning step installs declared prerequisites from the lockfile with install scripts off, while the check itself still installs nothing.

    Question as put to the owner (Q51): provision a record's prerequisites automatically.

    • A (recommended, chosen): a separate step installs from the lockfile with install scripts off; the check itself still installs nothing.
    • B: let the check install.
    • C: defer.

    Owner's answer, 2026-11-17, typed in an agent session, verbatim: "Go with recommendations."

    This records the owner's answer to the open design, so the done-when's first item ("The owner's answers to the design questions are recorded here") is met by this comment. Option A is the package of triage's five RECOMMENDED answers:

    1. Provisioning is a separate, declared step at worktree creation and in CI setup, installing only what records' requires entries name, from a lockfile, with install scripts off.
    2. It runs outside the check, so the check still installs nothing (Resolve ecosystem specifics from the consumer repository and align the enforcement ladder with the talk's pyramid #15703 AC5 holds); a run that cannot run the step still reports the not-run cell.
    3. The cache is the package manager's download cache, keyed on the lockfile hash, in CI cache storage and the local user cache, with the default expiry.
    4. The worktree create script's existing npm ci folds into the provisioning step, so there is one install path.
    5. The provisioning step installs the ci-workflows TypeScript test's package, and the same step cleans up the subpackage's node_modules.

    This stays host work: the CI-setup part needs a step in .github/workflows/, a path the issue lane refuses (.github/scripts/apply-patch/deny-rules.mjs, the github-workflows rule /.github/workflows/**).

    Acceptance criteria

    • A declared provisioning step exists, run at worktree creation and in CI setup, that installs only the items records' requires entries name, from the lockfile, with install scripts off.
    • The worktree create helper's npm ci is folded into that step, and plugins/source-control/skills/worktree/context/create.md describes the one install path.
    • CI caches the package manager's download cache keyed on the lockfile hash, with the default expiry.
    • The check itself still installs nothing, and an unattended run that cannot run the step still reports the not-run cell.
    • The provisioning step installs the ci-workflows TypeScript test's package and removes the subpackage's node_modules afterwards.
    • A declared prerequisite missing in a fresh worktree is installed by the provisioning step with no manual command.
    • Toolchain's not-run report points at this mechanism by name.

    Posted by an agent session.

  8. added
    host-run
    on Nov 17, 2026
  9. removed
    needs-owner-decision
    on Nov 17, 2026
  10. 27 remaining items

  11. added
    host-run
    on Nov 21, 2026
  12. melodic-automation-lanes commented on Nov 21, 2026

    @melodic-automation-lanes
    Contributor

    The work-resolve-issue lane stopped on this issue (patch-protected-path): the change needs a path the issue lane may not push, which a maintainer session builds by hand.
    It added host-run and set Work status to confirmed: an agent run on a host builds it, and it waits on no decision from a person.

    In the run's words:

    The run stopped early (patch-protected-path): its change needs a path the issue lane may not push, which a person changes instead. In the run's words: patch-protected-path: .claude/ecosystems/typescript.yaml. The issue's done-when (the 2026-11-21 amendment, item 3) and the recorded decision's amendment (2) need this file to declare the root package-lock.json as a requires entry with an install object, in the same change that removes the worktree-create.sh npm ci call. Otherwise new worktrees stop getting root node_modules. This lane cannot push a change to a file under a .claude/ directory, so the work cannot ship as one change from here.

    What the run says it did not do:

    • The whole implementation. It needs .claude/ecosystems/typescript.yaml, a protected path this lane cannot push. No files were changed.
    • Repository checks (check-changelog-fragments, check-changed-skills, check-affected) were not run because the working tree has no changes

    Run: https://github.com/melodic-software/claude-code-plugins/actions/runs/44944963587

    To hand it back to the lane, remove host-run and set Work status to agent-ready again.

  13. added 6 commits that reference this issue on Nov 22, 2026
    0b19c44
    fa6e76e
    069b445
    9cf4b56
    d5db99e
    27cbde8
  14. kyle-sexton commented on Nov 22, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded. Owner, 2026-11-22, chosen in the GitHub Work session (verbatim): "Fallback with end date (Recommended)".

    Question: the provisioning step folds the worktree helper's npm ci into one install path that installs only lockfiles an ecosystem record declares. A repository whose records declare no lockfile would stop getting root node_modules in new worktrees. Should an undeclared root lockfile still install, and for how long?

    Option chosen: "An undeclared root package-lock.json still installs (scripts off), with a printed notice telling the repo to declare it in its record. It's removed at the same contract major as 18187's legacy read, once the cross-repo sweep has given each repo a record."

    This replaces the 2026-11-21 amendment's reading that an undeclared lockfile is never installed. The rest of that amendment, and decision amendments (2) and (3), stand.

    Basis

    • Parallel Change, also called expand and contract (Danilo Sato, martinfowler.com bliki, 2014-05-13, read 2026-11-22): "In the expand phase you augment the interface to support both the old and the new versions"; "Once all usages have been migrated to the new version, you perform the contract phase to remove the old version". The fallback is the expand phase for repositories that have no record yet; the end date is the contract phase. The same page warns: "If the contract phase is not executed you might end up in a worse state than you started", which is why the fallback carries a fixed end and a notice on every run. https://martinfowler.com/bliki/ParallelChange.html
    • feat(ecosystems): move ecosystem records to docs/conventions/ecosystems #18187 (open) records the legacy .claude/ecosystems/ read as ending "in the next major version of this contract, released once that sweep is complete" (docs/contracts/ecosystem-commands/README.md, "Legacy location", in that PR). Tying the fallback to the same major gives repositories one migration and one end date. feat(ecosystems): move ecosystem records to docs/conventions/ecosystems #18187
    • The fallback keeps install scripts off: it runs the same npm ci --ignore-scripts --no-audit --no-fund the declared path runs, so the 2026-11-17 decision "install scripts off" holds for it too.
    • It turns off when any record declares any install entry, a skipped or unreadable one included, so a repository that has started declaring gets only what it declares.

    Done when

    • docs/contracts/ecosystem-commands/ecosystem.schema.json defines an optional install object on a prerequisite, with manager limited to npm and a required repo-relative lockfile, and a schema test rejects an install object holding any other key.
    • The provisioning step runs npm ci --ignore-scripts --no-audit --no-fund in the directory of each install entry's lockfile and runs nothing for an entry without install, shown by a test with one entry of each kind.
    • When no record in the repository declares any install entry and a root npm-shrinkwrap.json or package-lock.json exists, the provisioning step installs it with the same command and prints one stderr notice naming the lockfile and how to declare it under requires; when any record declares an install entry, no undeclared lockfile is installed and no notice is printed; shown by tests of both cases.
    • docs/contracts/ecosystem-commands/README.md ("Provisioning") and the contract changelog state that this fallback ends in the contract's next major version, together with the legacy-location read.
    • .claude/ecosystems/typescript.yaml declares the root package-lock.json as a requires entry with an install object.
    • plugins/source-control/scripts/worktree-create.sh holds no npm ci call of its own and calls the provisioning step, and plugins/source-control/skills/worktree/context/create.md describes that one install path with scripts off and the root-lockfile fallback.
    • A test runs the provisioning step in a fixture worktree whose declared prerequisite is missing and shows it installed with no manual command.
    • The check itself installs nothing, and a run where the provisioning step cannot install still reports the not-run cell, shown by a test.
    • Toolchain's not-run report names the provisioning step.

    Posted by an agent session.

  15. removed
    host-run
    on Nov 22, 2026
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

    No labels
    No labels

    Fields

    Work status

    confirmed

    Priority

    medium

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions