Skip to content

feat(assess): emit sequant run when a global install is present, not always npx sequant run #740

Closed

Description

@admarble

Problem

/assess hardcodes npx sequant run … in every Commands block, the Chain: line, and all SKILL.md examples (.claude/skills/assess/SKILL.md:236, :244, :337-340, etc.). But npx sequant is the invocation most prone to version skew: with a dual node prefix (npx resolving from one prefix, the global binary from another) plus npx cache reuse, npx sequant can silently run a stale version while a directly-installed sequant on PATH is current. The user then copy-pastes an assess-generated command that may execute an outdated binary.

This is mitigated but not fixed today by src/commands/run.ts:32 (checkVersionCached → getVersionWarning), which warns about staleness — but only after the stale version has already launched. The emitted command string is the actual lever, and assess controls it.

Related prior art: #539 (stray $HOME/node_modules/sequant warning), #534/version-check home-stray footgun. None of those change what assess emits.

Proposed approach

Make assess choose the command prefix to match the user's environment, probed once in Step 1 (assess already shells out — it runs npx sequant locks check-batch):

  • If command -v sequant resolves a global/PATH install → emit sequant run …
  • Otherwise → keep npx sequant run … (the zero-install path must remain the default for users without a global install)

Acceptance Criteria

  • AC-1 — assess probes once for a resolvable sequant on PATH and selects the command prefix accordingly (global → sequant run, else npx sequant run).
  • AC-2 — npx sequant run remains the fallback when no global install is found; zero behavior change for npx-only users.
  • AC-3 — The Commands block, the Chain: line, and the worked examples all use the same chosen prefix consistently within a single assessment.
  • AC-4 — Change applied across all three skill-mirror roots (.claude/skills/, templates/skills/, skills/) and passes check-skill-sync.ts.

Notes / open questions

  • Scope is assess's emitted commands only — no runtime behavior change.
  • Worth weighing against simply trusting run's existing outdated-warning: the failure mode is "stale version runs, then warns," not silent corruption. Reasonable to close as wontfix if the warning is deemed sufficient — flagging this so a human triages the cost/benefit rather than assuming the feature is wanted.
  • assess's own npx sequant locks check-batch invocation has the same skew exposure, but that's a separate concern from the emitted run commands.
  • This is skill-prose / LLM-driven emission, not a code path — the fix lives in the SKILL.md instruction + 3-dir sync, so it pairs naturally with the reconciliation in chore: reconcile skill-mirror divergences (8 diverged, 10 missing across the 3 roots) #738.

Activity

  1. added
    enhancement
    cli
    on Jun 22, 2026
  2. admarble commented on Jun 22, 2026

    @admarble
    ContributorAuthor

    Complexity: Standard (4 ACs, 1 logical file × 3 skill-mirror roots)

    AC Quality Check

    ACs are well-formed and measurable. One note: the ac-parser did not extract these because the issue uses **AC-1** — (em-dash, no colon); the parser expects **AC-1:**. Cosmetic only — analyzed inline. AC-1/AC-3 are clearly testable; AC-2 ("zero behavior change for npx-only users") is a negative assertion best verified by inspection + a dry-run in an npx-only env.


    Scope Assessment

    Non-Goals (from issue): assess's emitted commands only — no runtime behavior change; assess's own npx sequant locks check-batch invocation is explicitly out of scope.

    Metric Value Status
    Feature count 1 (prefix selection) ✅
    AC items 4 ✅
    Directory spread 1 file × 3 mirror roots ✅

    Verdict: ✅ SCOPE_OK — single skill-prose change, mechanically mirrored.


    Acceptance Criteria

    AC-1 — Probe once for resolvable sequant, select prefix accordingly

    Verification: Integration Test (skill-prose behavior; verify via dry-run assessment in both environments)
    Scenario: Given a global sequant on PATH → When /assess runs Step 1 → Then it emits sequant run … (not npx sequant run …).
    Assumptions: command -v sequant >/dev/null 2>&1 is a sufficient probe; if sequant resolves on PATH it is the current/global install (per the dual-prefix skew note — npx sequant is the stale one).

    AC-2 — npx sequant run remains the fallback (zero change for npx-only)

    Verification: Manual Test
    Scenario: Given no sequant on PATH → When /assess runs → Then output is byte-identical to today's npx sequant run ….

    AC-3 — Commands block, Chain: line, and worked examples use the same chosen prefix within one assessment

    Verification: Manual Test (inspect a single generated assessment for prefix consistency)
    Scenario: Given the chosen prefix is sequant run → When the dashboard renders → Then Commands block + Chain: line all use sequant run, none use npx sequant run.

    AC-4 — Applied across all 3 mirror roots; passes check-skill-sync.ts

    Verification: Integration Test
    Scenario: Given edits to .claude/skills/assess/SKILL.md → When npx tsx scripts/check-skill-sync.ts runs → Then exit 0 (.claude/skills/, templates/skills/, skills/ identical).


    Implementation Plan

    Phase 1: Define the probe + prefix selection (source of truth: .claude/skills/assess/SKILL.md)

    1. In Step 1: Context Gathering (~line 65, beside the existing locks check-batch shell-out), add a one-line probe and a CMD_PREFIX definition:
      command -v sequant >/dev/null 2>&1 && CMD_PREFIX="sequant run" || CMD_PREFIX="npx sequant run"
      with prose: "Resolve CMD_PREFIX once here; reuse it for every emitted run command below."
    2. Add Commands Block Rule Add setup wizard for missing dependencies #9 (after the existing 8 rules, ~line 288): "Use the Step-1 CMD_PREFIX for every command in the Commands block and the Chain: line. Never mix prefixes within one assessment (AC-3)."
    3. Update the Chain: annotation format (lines 185, 244, 306) and the Commands block template (lines 236-237) to reference <CMD_PREFIX> run / the chosen prefix rather than hardcoded npx sequant run.

    Phase 2: Worked examples

    1. The static few-shot examples (lines 337-340, 380-388, 410, 441-443, 516, 539, 620) are teaching illustrations of the npx-only default. Leave them concrete as npx sequant run … but add a one-line note under the first example block: "Examples show the npx sequant default; with a global install the prefix is sequant run (see Step 1)." This keeps few-shot readability while making the runtime rule authoritative (see Open Question 1).

    Phase 3: Mirror + verify

    1. Apply identical edits to all 3 roots (edit .claude/skills/, then npx tsx scripts/check-skill-sync.ts --fix, or edit each).
    2. Run npx tsx scripts/check-skill-sync.ts → expect exit 0 (AC-4).

    Rule Touchpoints

    The behavior-rule detector does not trigger on these ACs (no ≥2 keywords from default/always/never/rule/behavior/skip), and the issue confirms this is skill-prose / LLM-driven emission, not a code path. The only touchpoint is assess/SKILL.md ×3 mirrors — there is no runtime TypeScript duplicating this rule, so the usual "edit lands at one site, the other goes stale" risk does not apply here. ✅


    Design Review

    1. Where does this logic belong? Step 1 of the assess skill, where assess already shells out (locks check-batch) — the cheapest place to probe once.
    2. What's the simplest correct approach? A single command -v sequant probe setting one CMD_PREFIX token, threaded by one new Commands-Block rule. No new files, no runtime code.
    3. What existing pattern does this follow? The existing Step-1 shell-out + "reuse this value below" pattern; mirrors the 3-root skill-sync discipline (check-skill-sync.ts).
    4. What would a senior reviewer challenge? (a) "Is command -v sequant enough, or could it resolve a local node_modules shim?" — command -v checks PATH, not local installs; npx-only users have no PATH entry, so it's correct. (b) "Why not just trust run's existing outdated-warning?" — see issue's own wontfix note; flagged for human triage (Open Question 2).

    Open Questions

    1. Worked examples: annotate vs. tokenize? — Recommendation: keep examples concrete (npx sequant run, the default) + one clarifying note, rather than replacing all literals with a <CMD_PREFIX> placeholder. Impact if wrong: placeholder tokens reduce few-shot readability; the note approach keeps examples copy-pasteable for the common npx case.
    2. Wontfix cost/benefit — The issue itself flags this as reasonable-to-close-as-wontfix (failure mode is "stale runs, then warns," not corruption). Recommendation: proceed — the change is ~10 lines of prose and removes the footgun at the source. Impact if wrong: minor churn for low-frequency benefit.
    3. Sibling sites (scope expansion) — test, fullsolve, qa, loop, merger, improve, exec SKILL.md files also emit npx sequant run. Most are internal chain instructions, not user copy-paste dashboards, so the skew exposure is lower. Recommendation: do not widen this issue — file a follow-up if the global-prefix convention proves valuable. assess's own locks check-batch invocation (same skew) is already noted out-of-scope by the issue.

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: disabled
    Reasoning: Small, localized skill-prose change with one mechanically-verifiable AC (check-skill-sync.ts). No runtime code path → no testgen; no UI → no test; not security-sensitive. /spec is complete (this comment). A post-exec check-skill-sync.ts run + a dry-run /assess in an npx-only env covers AC-1–AC-4.


    Label Review

    Current: enhancement, cli
    Recommended: enhancement, cli (+ consider docs or skill if such a label exists, since the change is skill-prose)
    Reason: Labels are accurate. Quality Loop will not auto-enable (SCOPE_OK, single file).

  3. added
    planned
    on Jun 22, 2026
  4. added 2 commits that reference this issue on Jun 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

    clienhancementplanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions