Skip to content

fix(onboarding): first-run papercuts from a stranger smoke test — doctor contradicts the README install, init omits the commit step, warning count and phase timer are off #1387

Closed

Description

@admarble

Epic: graph-2026-10-freeze Tier: mechanical Execution: sequant_run

Context

A stranger smoke test on 2026-10-09 followed the README's headless path on a repo that had never seen Sequant: npm install [email protected], npx sequant init --yes, npx sequant doctor, commit, then npx sequant run 21. The run passed end to end in 16 minutes. These are the first-run papercuts it hit, in the order a newcomer meets them. The --base PR bug from the same test is filed separately.

Findings

  1. doctor (and every command) contradicts the README's install path. The README's "Headless / CI" path says npm install sequant then npx sequant init. Every subsequent command then prints ! Running sequant from local node_modules / For latest version: npx sequant@latest / To remove local: npm uninstall sequant (bin/cli.ts:172). A newcomer is told to undo the install the README just gave them.
  2. init's "Next steps" leave out the step sequant run needs. They list /spec 123, /exec 123, /qa 123 and the constitution, but not "commit .claude/skills/" or sequant run. doctor then warns that .claude/skills/{spec,exec,qa} are not committed and that phase worktrees won't see them.
  3. doctor's summary undercounts warnings. It printed two ! lines (Skills Committed, and the Claude Code #43869 note), but the summary said Warnings: 1 and Passed: 19/20.
  4. The progress timer labels the issue's elapsed time as the phase's. At 02:48:52, one minute into exec (started 02:47:45), the log read still running: #21 exec (12m 11s): the time since the issue started, not since exec started.
  5. run --help says --no-rebase skips the rebase "onto origin/main", but the rebase uses the --base branch (rebaseBeforePR(…, baseBranch), batch-executor.ts:2586).

Observed but not filed as defects: init adds 66 files and about 23,000 lines to commit, 20,686 of them in .claude/skills (an adoption-cost question, related to #1209). On a trivial three-AC issue, spec took 9m43s of the 16-minute run on Opus.

Acceptance Criteria

  • AC-1: The local-install warning no longer tells a user who followed the README to uninstall: either the README's headless path and the warning agree, or the warning is suppressed when the project's package.json declares sequant as a dependency. Evidence: a test on the warning predicate with a project whose package.json lists sequant, plus the README diff if the path changes.
  • AC-2: init's "Next steps" include committing .claude/skills/ (and the other generated files) before the first sequant run, and name sequant run <issue> as a next step. Evidence: a test on the next-steps output.
  • AC-3: doctor's Warnings: count equals the number of ! lines it printed, including the upstream-issue notes, or those notes are excluded from both. Evidence: a test on the summary with two warnings.
  • AC-4: The still running line shows time since the current phase started. Evidence: a test on the progress formatter with a phase that started after the issue.
  • AC-5: run --help describes --no-rebase as skipping the rebase onto the base branch. Evidence: the help-text diff.

Decision for AC-1 (graph doc D-6)

Keep the README's headless install path. Suppress the local-install warning when the project's package.json declares sequant as a dependency; keep it for a stray install the project doesn't declare.

Prior fixes / producers

  • The local-install warning dates from feat: Warn when running from local node_modules #87 (2026-01-17) and has not changed since; the README's headless path was written later. The other four are isolated papercuts, each with one producer. Deliberately local.

May touch

bin/cli.ts, src/commands/init.ts, src/commands/doctor.ts (summary, about line 1121), src/lib/cli-ui/run-renderer.ts (the still running line, about line 454), README.md, their tests.

Non-Goals

Activity

  1. added
    bug
    graph-2026-10-freeze
    on Oct 9, 2026
  2. added a commit that references this issue on Oct 10, 2026
  3. admarble commented on Oct 10, 2026

    @admarble
    ContributorAuthor

    Runner context for the phase agents (graph-2026-10-freeze, wave 1). This applies to the exec phase and the qa phase by name.

    • No full npm test in the worktree, in exec or in qa. Three phases run in parallel in this wave, and a full-suite run (10–13 min) under that load crosses the 30-minute phase wall and kills the phase. Run only the test files you touch or add (npx vitest run <file>…), in the foreground, with a timeout, after a WIP commit. The runner session runs the full suite on the PR branch after the PR opens.
    • Plugin freeze (graph doc I-1): the diff must not touch plugin/, .claude/skills/ or templates/skills/. The runner checks this before any merge.
    • CHANGELOG.md [Unreleased]: add your line; conflicts with sibling PRs are expected and the runner resolves them.
    • Gate-test ACs need the mutation record in the PR body (see CLAUDE.md, Testing). The failedTest field starts with the test file path.
  4. admarble commented on Oct 10, 2026

    @admarble
    ContributorAuthor

    Complexity: Standard (5 ACs, 4 directories)

    AC Quality Check

    All five ACs are single-line, carry an Evidence: clause, and are measurable. Notes:

    • AC-5 Evidence "the help-text diff" is a diff, not a command that fails today. Tighten to a test that reads the registered --no-rebase option description from the commander program and asserts it names the base branch and not origin/main. That fails on current code.
    • AC-1..AC-4 Evidence is "a test on X". Each X is currently inline (no seam), so the tests need small extractions (below). Each test must fail on unchanged code.

    Scope Assessment

    Non-Goals: present (init output size is #1388; no edits under plugin/, .claude/skills/, templates/skills/).

    Metric Value Status
    Feature count 5 isolated papercuts ✅
    AC items 5 ✅
    Directory spread 4 (bin/, src/commands/, src/lib/, README.md) ✅

    Verdict: ✅ SCOPE_OK

    Acceptance Criteria

    AC-1: local-install warning suppressed when package.json declares sequant

    Verification: Unit Test
    Scenario: Given install at <proj>/node_modules/sequant and <proj>/package.json listing sequant in dependencies/devDependencies/optionalDependencies → When the warning predicate runs → Then no warning; with sequant undeclared → warning kept.
    Assumptions: The project root is derived from the install path (the directory that contains node_modules/sequant), not process.cwd(), so a run from a subdirectory behaves the same. Unreadable or invalid package.json is treated as undeclared (warn).

    AC-2: init next steps name the commit step and sequant run

    Verification: Unit Test
    Scenario: Given init completes → When next-steps content is built → Then it includes a commit step naming .claude/skills/ and the other generated files, before sequant run <issue>.
    Assumptions: Use resolveCliInvocation()-style npx sequant run <issue> wording consistent with the README.

    AC-3: Warnings: equals printed ! lines

    Verification: Unit Test
    Scenario: Given one failing-to-warn check plus the upstream #43869 notice → When the summary is built → Then Warnings: 2.
    Assumptions: --quiet suppresses the notice, so it must not be counted then.

    AC-4: still running shows time since the current phase started

    Verification: Unit Test
    Scenario: Given issue started at T0, exec started at T0+11m, now = T0+12m → When heartbeat ticks → Then line reads #21 exec (1m 0s).

    AC-5: --no-rebase help names the base branch

    Verification: Unit Test (reads option description)
    Scenario: Given the run command registered → When --no-rebase description is read → Then it says "onto the base branch" (mentions --base), not origin/main.

    Implementation Plan

    Phase 1: Code (4 independent edits)

    1. AC-1 src/lib/version-check.ts: add isDeclaredDependency(installPath = __dirname) (walk up to the dir above node_modules/sequant, read package.json, check the three dependency maps). In bin/cli.ts:166 the branch becomes isLocalNodeModulesInstall() && !isDeclaredDependency(). Keep the home-stray branch as is. Extract the predicate as shouldWarnLocalInstall(installPath) so the test targets it directly.
    2. AC-2 src/commands/init.ts:1310: extract buildNextSteps() (exported); add "Commit generated files (git add .claude/ .sequant/ … && git commit)" and "npx sequant run <issue>" steps.
    3. AC-3 src/commands/doctor.ts: make emitUpstreamWarning return boolean (true when it printed); add that to warnCount and totalChecks before the summary. Extract summary-building into a pure buildDoctorSummary({pass,warn,fail}) for the test.
    4. AC-4 src/lib/cli-ui/run-renderer.ts:439: use the running phase's startedAt (s.phases.find(p => p.name === s.currentPhase)), falling back to s.startedAt.
    5. AC-5 bin/cli.ts:399: description → "Skip pre-PR rebase onto the base branch (--base, default main) …". Check whether docs/ or README repeat the old wording (whole-repo grep for rebase onto origin/main), update every location except frozen dirs.

    Phase 2: Tests and housekeeping

    1. One test file per touched module (version-check.test.ts, init, doctor, run-renderer, and a CLI-help test). Run only those files.
    2. CHANGELOG.md [Unreleased] line. README unchanged under D-6 (headless path stays).

    Design Review

    1. Where does this belong? Warning predicate in version-check.ts beside isLocalNodeModulesInstall; the others where the text is produced.
    2. Simplest approach? Suppress at the call site using the project's own package.json. Rejected: changing the README to npx sequant@latest (decided against in D-6); rejected: deleting the warning (a stray undeclared install is the case it exists for).
    3. Existing pattern / re-patch count? The warning dates from feat: Warn when running from local node_modules #87 and has had no fix since. The other four are single-producer. git log -S found no prior fix issues in the sites, so under the ≥2 rule this is not a stop; deliberately local, as the issue records.
    4. Reviewer challenge? "Why not read process.cwd()/package.json?" The install root is exact and survives subdirectory runs. "Why does Passed: x/y change?" y now includes the notice, so the counts stay consistent with the printed lines.
    5. Producers and consumers. Warning text: one producer (bin/cli.ts); isLocalNodeModulesInstall has other consumers (version-check.ts:161,410,435,466) that must stay unchanged. emitUpstreamWarning: one call site (doctor.ts) plus its tests. still running: one producer. Next steps: one producer. Help text: one producer in bin/cli.ts, possibly mirrored in docs.

    Feature Quality Planning

    All standard checks pass. Notable items:

    • Derived AC (Medium): AC-3 should hold under --quiet (notice suppressed, not counted).
    • Existing tests asserting Passed: N/N or the old next steps will need updating; grep before editing.
    • Run-renderer waiting path (⏸) is untouched; keep it so.

    Open Questions

    1. Should the doctor "total" include the upstream notice? Recommendation: yes (consistent denominators). Impact if no: Passed: 19/20, Warnings: 2 reads oddly.

    Recommended Workflow

    Phases: testgen → exec → qa
    Quality Loop: disabled
    Reasoning: All five ACs declare unit-test evidence, so testgen stubs help; small, isolated bug fixes. No UI, no security surface. Per the runner comment: no full npm test in exec or qa.

    Label Review

    Current: bug, graph-2026-10-freeze
    Recommended: add planned
    Quality Loop: Won't auto-enable (SCOPE_OK).

  5. added
    planned
    on Oct 10, 2026
  6. admarble commented on Oct 10, 2026

    @admarble
    ContributorAuthor

    Test Stubs Generated

    AC Verification Happy Path Failure Paths
    AC-1 Unit Test 3 tests (one per dependency field) 2 error cases + 2 assumption validators
    AC-2 Unit Test 1 test 2 cases
    AC-3 Unit Test 1 test 2 cases (incl. --quiet)
    AC-4 Unit Test 1 test 2 cases
    AC-5 Unit Test 1 test 1 case

    Unit Test Stubs

    • src/lib/version-check.declared-dependency-1387.test.ts
    • src/commands/init.next-steps-1387.test.ts
    • src/commands/doctor.summary-count-1387.test.ts
    • src/lib/cli-ui/run-renderer.phase-elapsed-1387.test.ts
    • src/commands/run-help-no-rebase-1387.test.ts

    Each stub is throw new Error(...) until implemented. They depend on the seams named in /spec (shouldWarnLocalInstall, buildNextSteps, buildDoctorSummary, per-phase startedAt, registered --no-rebase option).

    Next steps:

    1. /exec 1387 — implement the fixes and fill in the stubs
    2. Run only the touched files (npx vitest run <file>), not the full suite
    3. Gate tests need a mutation record in the PR body (CLAUDE.md, Testing)

    Generated with Claude Code

  7. admarble commented on Oct 10, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_NOT_MET

    AC coverage: 4/5 met

    Gaps:

    • init's next-steps commit command names the gitignored .sequant/ dir, fails fatally when AGENTS.md was not generated, and omits the modified .gitignore
    • No test asserts that the printed git add command is valid for files init actually writes
    • Required CI checks test and canary still pending
    • pnpm projects that declare sequant still get the local-install warning — ⚠️ unresolved
  8. added 3 commits that reference this issue on Oct 10, 2026
  9. admarble commented on Oct 10, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    AC coverage: 5/5 met

    Gaps:

    • When the installed version is outdated, doctor prints two warning lines for one counted warning, so the AC-3 count still diverges in that case
    • A hoisted workspace install declared only in a workspace package still gets the local-install warning
  10. added a commit that references this issue on Oct 10, 2026
  11. admarble commented on Oct 10, 2026

    @admarble
    ContributorAuthor

    Runner decision on QA round 2's document finding (a hoisted workspace install declared only in a workspace package's package.json still gets the local-install warning): deliberately not handled in #1393. isDeclaredDependency reads the package.json next to the install (above the pnpm store for pnpm). Walking up to find workspace members is beyond a papercut fix, and the cost is a warning that shouldn't print, not wrong behaviour. Reopen as its own issue if a workspace user reports it.

  12. added a commit that references this issue on Oct 10, 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

    buggraph-2026-10-freezeplanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions