Skip to content

[Feature] Add npm-first update notices and safe update command #42

@mbe24

Description

@mbe24

Design

Add a lightweight, non-disruptive update system:

  1. startup notice from cached update metadata,
  2. explicit 99problems update status command,
  3. optional 99problems update --apply for npm installs.

Use npm registry metadata as version source. Keep checks configurable via .99problems under [system] and ensure network failures never break normal command flow.

Scope

  • Add update subcommand and --apply behavior.
  • Add install-channel detection via NINETY_NINE_PROBLEMS_INSTALL_CHANNEL.
  • Add cache-backed notice metadata under OS cache dir.
  • Add [system] settings: update_enabled, update_interval_days.
  • Add env override: NINETY_NINE_PROBLEMS_DISABLE_UPDATE_CHECK=1.
  • Trigger background refresh during get only; startup remains cache-only.
  • Update README and regenerate man pages.

Boundary

  • No auto-apply during normal command runs.
  • No package-manager abstraction beyond npm for apply in v1.
  • No fallback auto-apply via cargo or release binaries.
  • No telemetry upload or analytics for update checks.

Acceptance Criteria

  • Startup can print cached update notice without blocking on network.
  • get performs best-effort background refresh when cache is stale.
  • 99problems update performs check and prints status/guidance only.
  • 99problems update --apply:
    • succeeds only for npm channel,
    • fails clearly for non-npm/unknown channel,
    • fails clearly when npm is unavailable on PATH.
  • Cached update notice is cleared only when:
    • a check confirms current version is up to date, or
    • update --apply succeeds.
  • Offline/timeouts never fail user command flow.
  • .99problems [system] settings and env override behave as documented.

Context

This improves operability for both direct users and agent-driven usage, while keeping startup latency low.

Manual update avenues remain available:

  • npm global reinstall (npm install -g @mbe24/99problems)
  • cargo reinstall (cargo install problems99 --force)
  • release binary download path (when published)

References:

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requestpriorityImportant work that should be tackled soon

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions