Make reminder() report dynamic install/skip counts; remove dead fj/rg fail() code #171
Labels
No labels
bug
chore
documentation
enhancement
feature
ready
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
david/pi-extensions-and-skills#171
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Replace
scripts/local-install.mjs's hardcoded post-install reminder text with a dynamic summary that reflects which extensions/skills actually installed vs. were skipped, based ontoolState. Also do a final cleanup pass confirming no deadfj/rghard-fail code paths remain.Background
scripts/local-install.mjs'sreminder()currently prints a fixed string regardless of what was actually installed:Since this change (across the earlier steps in this milestone group) can now skip
pr-comments,rg, and/or theforgejo-cliskill depending on detected tool availability, this hardcoded text is misleading whenever anything is skipped — telling the user to expect a full install when it wasn't.main()already threadstoolState({ rgOk, fjState }) through toreminder()from the preflight-refactor step (even before this step consumed it meaningfully).Depends on: #168 (Refactor preflight() to skip/warn for missing fj/rg instead of hard-failing) — provides
toolStateand themain()→reminder(toolState)call site.Implementation Details
Replace
reminder():Notes:
ALL_SKILLS_COUNTmust be verified against the actual current skill count at implementation time (ls skills | wc -l) rather than assumed — update the constant and its comment if the repo has gained/lost skills since this issue was drafted.ALL_EXTENSIONSmust be verified againstpackage.json'spi.extensionsarray length/contents at implementation time."skipped: rg", the computed skill/extension counts) rather than the entire string verbatim, so future copy tweaks don't require lockstep test rewrites — but the counts must be exactly correct.toolState.fjState === "unauthenticated"must NOT reduce the reported counts or add a skip note — only"absent"(for fj) and!rgOk(for rg) count as skips.Cleanup pass
Once this and the preceding milestones' steps are merged, do a final grep across
scripts/local-install.mjsfor:fail(...)call whose message mentionsrgorfj— there should be none.This is a verification pass, not expected to require code changes if the prior steps were implemented correctly — but call out explicitly in the PR description if anything was found and removed.
Acceptance Criteria
reminder({ rgOk: true, fjState: "ok" })(or called with no arguments) prints the full skill/extension counts with no "skipped:" note.reminder({ rgOk: false, fjState: "ok" })prints one fewer extension than the full count, the same skill count, and a "skipped: rg" note.reminder({ rgOk: true, fjState: "absent" })prints one fewer extension, one fewer skill, and a note mentioning both "pr-comments" and "forgejo-cli".reminder({ rgOk: false, fjState: "absent" })prints two fewer extensions, one fewer skill, and a note mentioning "rg", "pr-comments", and "forgejo-cli".reminder({ rgOk: true, fjState: "unauthenticated" })prints the same output as the fully-available case (no skip note, full counts) — unauthenticated must not affect the reminder.fail(...)call remains referencingrgorfjinscripts/local-install.mjs.main()'s call site (reminder(toolState)) passes the realtoolStateobject, not a stubbed/default value, on every invocation path.Test Plan
reminder()scenarios in the acceptance criteria, capturingconsole.logoutput and asserting on count and substring presence.grep -n "fail(" scripts/local-install.mjs(or equivalent) manually reviewed to confirm norg/fj-referencing hard-fail call remains — note the result in the PR description.npm test— all green, including the updated"direct invocation exits 0 and prints the Step-4 reminder on the happy path"end-to-end test (its exact reminder-text assertion will need updating to match the new dynamic format — same meaning, i.e. full counts, but the literal string differs from the old hardcoded text).pi-loop opened and merged a pull request for this issue: #180