Skip to content

Installer writes vestigial pai.algorithmVersion to settings.json — no consumer reads it since ALG sourcing moved to ALGORITHM/LATEST #1381

Description

@DAESA24

Summary

The installer seeds and force-writes pai.algorithmVersion into ~/.claude/settings.json, but no current code reads that field — the Algorithm version has been sourced from PAI/ALGORITHM/LATEST since v6.2.0. The written field is now vestigial and can silently drift from LATEST. This proposes the installer stop writing it.

Background

pai.algorithmVersion was originally written so the statusline's ALG field would populate (see #819 — "Statusline ALG field always shows dash — algorithmVersion never written to settings.json"). ALG-version sourcing was later moved to PAI/ALGORITHM/LATEST, and the codebase now documents the field as removed:

  • PAI/TOOLS/Banner.ts: // v6.2.0+: LATEST is the single source of truth. settings.pai.algorithmVersion was removed.
  • hooks/handlers/UpdateCounts.ts: // v6.2.0+: settings.pai.algorithmVersion was removed; LATEST is the single source
  • statusline-command.sh sources the ALG version from PAI/ALGORITHM/LATEST.

Every reader now uses LATEST — but the installer still writes the field.

Where it's written

  • PAI/PAI-Install/engine/config-gen.ts — seeds algorithmVersion: ALGORITHM_VERSION in the generated pai block.
  • PAI/PAI-Install/engine/actions.ts — force-overwrites existing.pai.algorithmVersion = ALGORITHM_VERSION on every install/upgrade.

Why it's worth fixing

Proposed fix

Stop writing the field; keep pai.version and the ALGORITHM_VERSION constant (still used to write the ALGORITHM/LATEST fallback in actions.ts):

# config-gen.ts — generated pai block
   pai: {
     repoUrl: "https://github.com/danielmiessler/PAI",
     version: PAI_VERSION,
-    algorithmVersion: ALGORITHM_VERSION,
   },
# config-gen.ts — import (ALGORITHM_VERSION now unused here)
-import { DEFAULT_VOICES, PAI_VERSION, ALGORITHM_VERSION } from "./types";
+import { DEFAULT_VOICES, PAI_VERSION } from "./types";
# actions.ts — force-overwrite block
     existing.pai.version = PAI_VERSION;
-    existing.pai.algorithmVersion = ALGORITHM_VERSION;

Keep actions.ts's ALGORITHM_VERSION import — it's still used to write the PAI/ALGORITHM/LATEST fallback. Verified locally: with these removed, the statusline ALG field and the banner still render correctly (both read LATEST), and a fresh install produces a valid settings.json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions