Skip to content

feat(cli): init nudges when local CLI is behind npm latest (#358)#361

Merged
BaseInfinity merged 1 commit into
mainfrom
feat/358-init-stale-cli-nudge
May 26, 2026
Merged

feat(cli): init nudges when local CLI is behind npm latest (#358)#361
BaseInfinity merged 1 commit into
mainfrom
feat/358-init-stale-cli-nudge

Conversation

@BaseInfinity
Copy link
Copy Markdown
Owner

Summary

Bundled paperwork

Closes

Test plan

  • tests/test-cli.sh — 91/91 (3 new [feature] init should detect when npx cache serves stale CLI version (no @latest pin) #358 tests + 88 pre-existing)
  • tests/test-doc-consistency.sh — 40/40
  • tests/test-docs-usability.sh — 29/29 (release-accuracy check passes)
  • tests/test-update-skill-cli-version.sh — 8/8 (Step 1.5 pattern unchanged)
  • tests/test-hooks.sh — 156/156 (cache contract still compatible)
  • tests/test-setup-path.sh — 83/83 (init exercised across 7 fixture types)
  • tests/test-self-update.sh — 153/153 (version detection unchanged)
  • CI green on validate
  • Squash-merge

Why this is the right shape

  • Cache-first: up-to-date users pay zero extra latency (no npm hit when cache is fresh and not poisoned).
  • Offline-graceful: every external call (fs, require, execSync) is wrapped — the nudge never breaks init.
  • No new files: extends cli/init.js and tests/test-cli.sh; no new hooks, no new skills, no plugin manifest changes.
  • No breaking changes: behavior is purely additive; existing flags + flows unchanged.

@BaseInfinity BaseInfinity merged commit 70fc92f into main May 26, 2026
4 checks passed
@BaseInfinity BaseInfinity deleted the feat/358-init-stale-cli-nudge branch May 26, 2026 00:03
BaseInfinity added a commit that referenced this pull request May 26, 2026
The original #358 PR (#361) shipped with three tests (nudge-fires-when-stale,
silent-when-current, silent-when-cache-poisoned) but didn't explicitly cover
the silent-when-offline path. Fault-injects a fake `npm` that always exits 1
to catch regressions where someone removes the try/catch wrapping execSync.

Verified locally: test-cli.sh 92/92 (4 #358 tests, all green).
`npx agentic-sdlc-wizard init` (no @latest pin) silently serves whatever
version is cached on disk, sometimes months old. The /update Step 1.5
pattern already catches this — but only at /update time, after the user
has already installed stale templates.

This moves the same check to init time so the gap surfaces immediately:

- cli/init.js: new maybeEmitStaleCliNudge() called before planOperations.
  Reuses SDLC_WIZARD_CACHE_DIR/latest-version (24h TTL, #239 poison check),
  falls back to `npm view` with 5s timeout, silent on offline/error.
- README.md + CLAUDE_CODE_SDLC_WIZARD.md: install command recommends
  `npx -y agentic-sdlc-wizard@latest init` so first-time users skip the
  cache trap by default.
- tests/test-cli.sh: 3 quality tests covering nudge-fires-when-stale,
  silent-when-current, no-reverse-nudge-when-poisoned.

Bundled: ROADMAP #347 + #350 status flip from "Actionable now" to DONE
with PR citations (#351/#355/#354). Both shipped this week — paperwork
was stale.

Verified locally: test-cli.sh 91/91, test-doc-consistency 40/40,
test-docs-usability 29/29, test-update-skill-cli-version 8/8,
test-hooks 156/156, test-setup-path 83/83, test-self-update 153/153.
BaseInfinity added a commit that referenced this pull request May 26, 2026
 (#363)

PR #361 shipped 3 #358 tests where Test C was silent-when-cache-poisoned
rather than the goal-named silent-when-offline. The /goal Haiku evaluator
counted tests by file presence and approved completion. Caught only at
post-merge self-review, fixed in PR #362 (added the real offline test via
fake-npm PATH override).

Promoted to SDLC.md ## Lessons Learned → ### Testing so future sessions
inherit the rule: when a /goal condition enumerates test cases by name,
self-review must verify each named test exists by reading assertions, not
by counting matching `test_` functions.

This is the per-test-fidelity layer beneath PR #355's HIGH-95%-confidence
and DLC-binding gates — those work at the macro level, but enumerated-
condition fidelity is the author's responsibility.

Verified locally: test-doc-consistency 40/40, test-postmortem-lessons 7/7,
test-memory-audit-protocol 12/12.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] init should detect when npx cache serves stale CLI version (no @latest pin)

1 participant