Skip to content

fix(stacks): uv ciInstall is a bare uv pip install -q — use uv sync --frozen with uv.lock, else requirements or skip #1217

Closed

Description

@admarble

Epic: field-2026-09-28 (downstream non-Node adoption) Tier: mechanical Graph: tracker #1203

Problem. #1196 (PR #1212) fixed pip's bare install in resolvePackageManagerConfig (src/lib/stacks.ts:537-559). pip now installs from its requirements*.txt or is skipped with CI_INSTALL_SKIP. uv still has the same bare-install shape: PM_CONFIG.uv.ciInstall = "uv pip install -q" (src/lib/stacks.ts:175) names nothing to install, so a worktree install, dependency reinstall or merge-check in a uv repo runs a failing no-op. uv is detected from uv.lock (src/lib/stacks.ts:197), which gives the right lockfile-faithful command: uv sync --frozen. #1196's QA notes flagged this as a follow-up candidate, and #1196's AC-2 covered pip only, so that issue was not grown for it.

Not previously filed (searched "uv" in issues: only #94, closed, unrelated).

AC

  • AC-1: When uv.lock exists in root, resolvePackageManagerConfig("uv", root).ciInstall is uv sync --frozen. Evidence: npx vitest run src/lib/stacks.test.ts
  • AC-2: With no uv.lock, uv falls back like pip: uv pip install -q -r <requirements file> when a requirements*.txt exists, else CI_INSTALL_SKIP. It never runs the bare uv pip install -q. Evidence: npx vitest run src/lib/stacks.test.ts
  • AC-3: The CI_INSTALL_SKIP doc comment no longer says pip is the only manager that resolves to it. Evidence: npx vitest run src/lib/stacks.test.ts

Graph metadata

May touch

  • src/lib/stacks.ts
  • src/lib/stacks.test.ts

Activity

  1. added
    bug
    on Sep 29, 2026
  2. admarble commented on Sep 30, 2026

    @admarble
    ContributorAuthor

    Context for the run (re-checked against main @ 7b36d9b4, 2026-09-29)

    Line refs in the body still hold: PM_CONFIG.uv.ciInstall at src/lib/stacks.ts:175, uv.lock detection at :197, the CI_INSTALL_SKIP JSDoc at :301–310, and resolvePackageManagerConfig at :537–559. The pip branch from #1196 is at :541–554.

    Shape of the fix

    Standard block

    • No full npm test in exec or in qa. This applies to the qa phase as well as exec. Run the targeted suite in the foreground with a timeout: timeout 600 npx vitest run src/lib/stacks.test.ts. Global setup runs npm run build first, so the run isn't instant.
    • Commit WIP early, and always before any mutation.
    • A mutation marker's failedTest starts with the test file path.
    • PR body: Closes #1217. Use Refs only for the tracker, tracker(graph): field report 2026-09-28 — downstream non-Node adoption gaps (10 nodes) #1203.
    • Skill snippets that read .sequant/settings.json must handle JSONC (not expected to apply here).
  3. admarble commented on Sep 30, 2026

    @admarble
    ContributorAuthor

    /spec plan — #1217

    Complexity: Standard (3 ACs, 1 directory) · Scope: ✅ SCOPE_OK

    Non-Goals (not in issue body — proposing explicitly): no change to poetry's ciInstall (it already honors poetry.lock unconditionally, unlike pip/uv's bare-install shape), no new PM types, no change to the hasManifestForPackageManager gate (uv is already covered there since #1196).

    In-flight check: a worktree for feature/1217-... already exists at the main tip (clean, no ahead commits) — no conflicting overlap detected with other active worktrees.

    AC checklist

    • AC-1 — uv.lock present → resolvePackageManagerConfig("uv", root).ciInstall === "uv sync --frozen". Fix: add a pm === "uv" branch in resolvePackageManagerConfig (stacks.ts:537-559), checking existsSync(join(root, "uv.lock")) first. Evidence: npx vitest run src/lib/stacks.test.ts
    • AC-2 — No uv.lock → falls back like pip (uv pip install -q -r <file> via the existing findRequirementsFile, or CI_INSTALL_SKIP when nothing matches); never the bare uv pip install -q. Fix: same branch, reusing findRequirementsFile(root) — no new helper. Note: requires dropping "uv" from the it("leaves every non-yarn, non-pip package manager untouched", ...) loop (stacks.test.ts:1249-1260) — that test currently asserts uv's config is untouched by identity, which this AC changes; give uv its own describe block mirroring the existing pip (#1196 AC-2) one. Evidence: npx vitest run src/lib/stacks.test.ts
    • AC-3 (gate) — The CI_INSTALL_SKIP JSDoc (stacks.ts:301-310) no longer implies pip is the only manager resolving to the sentinel. Test must scope its assertion to that doc-comment block specifically (not the whole file) and be mutation-verified: revert the comment text, confirm exactly that test fails, restore, and record it with a Mutation-verified: AC-3 — ... marker whose failedTest starts with src/lib/stacks.test.ts. Evidence: npx vitest run src/lib/stacks.test.ts

    Design notes

    Open questions

    1. Should the new uv tests also assert uv.lock wins over a present requirements.txt in the same directory (priority ordering)? Not stated in the AC text. Recommend adding it anyway — cheap addition to the same test block, and it pins the branch order the implementation already needs (uv.lock checked before findRequirementsFile). Low impact if skipped: AC-1/AC-2 stay individually correct, just untested against each other.

    Recommended workflow

    Phases: exec → qa · Quality Loop: disabled
    Reasoning: bug-labeled, mechanical-tier, SCOPE_OK, single pre-named target test file, and the issue's own follow-up comment already prescribes the exact branch/test shape — targeted vitest run additions during /exec beat stub generation. Mirrors #1196's own spec resolution for the sibling pip fix this issue completes.

  4. added
    planned
    on Sep 30, 2026
  5. admarble commented on Sep 30, 2026

    @admarble
    ContributorAuthor

    QA Verdict: NEEDS_VERIFICATION

    AC coverage: 3/3 met

    Gaps:

    • Required CI checks still pending
    • User-facing fix lacks a CHANGELOG entry
    • Sibling comments are stale now that uv also resolves to CI_INSTALL_SKIP
  6. added a commit that references this issue on Sep 30, 2026
  7. admarble commented on Sep 30, 2026

    @admarble
    ContributorAuthor

    QA Verdict: NEEDS_VERIFICATION

    AC coverage: 3/3 met

    Gaps:

    • Required CI check had not completed when QA finished
  8. admarble commented on Sep 30, 2026

    @admarble
    ContributorAuthor

    Runner verification — PR #1224 (QA verdict NEEDS_VERIFICATION, 3/3 ACs)

    Discharged by hand. Full detail is in the PR's "Runner verification" section.

    • AC-1: with a real uv 0.7.13 project (pyproject.toml + uv lock), uv sync --frozen exits 0 and creates .venv.
    • AC-2: with a requirements.txt and no lock, uv pip install -q -r requirements.txt exits 0. With no manifest it resolves to CI_INSTALL_SKIP (unit-tested).
    • AC-3: re-ran the mutation myself. Restoring the pip-only JSDoc makes exactly the AC-3 test fail.
    • stacks.test.ts and both worktree-manager suites pass (168 tests). tsc and lint are clean, and CI is green on eb66deb4.
    • Folded in two QA findings: a CHANGELOG entry, and two stale worktree-manager.ts comments that said only pip reaches CI_INSTALL_SKIP. These are comment-only changes, outside this issue's "May touch" list.

    Design point for the owner: the no-lock fallback uv pip install -q -r <file> runs without a project venv. It installs into whatever environment uv finds (an active VIRTUAL_ENV or conda env; conda base in the test here), and it fails if uv finds none. AC-2 specifies this command, and #1196's pip fallback behaves the same way, so this PR doesn't change it. It's a follow-up candidate.

  9. added a commit that references this issue on Sep 30, 2026
  10. admarble commented on Sep 30, 2026

    @admarble
    ContributorAuthor

    End-to-end check after the merge: through the real installWorktreeDeps (built dist/), a uv project set up by sequant init --manifest-only (manifest packageManager: "uv") runs uv sync --frozen, and six imports from the project's .venv. Without a declared packageManager, the sync detector falls back to npm and the install is skipped, so this fix is never reached. Filed as #1231.

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

    bugplanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions