issue-90: Implement pi registration with URL dedupe and reload reminder in scripts/local-install.mjs #98
No reviewers
Labels
No labels
bug
chore
documentation
enhancement
feature
ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
david/pi-extensions-and-skills!98
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/issue-90/implement-pi-registration-with-url-dedupe-and-relo"
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?
90: Implement pi registration with URL dedupe and reload reminder in scripts/local-install.mjs
Implements 90.
Generated in 33m 11s.
Review findings
The Stage 1 change is already committed (
652e887); my remediation will land as working-tree changes. Let me read the test file.Now I have the full picture. Let me check the project's gate commands before making changes.
Gate confirmed:
npm test→node --test scripts/local-install.test.mjs. No build/lint scripts. Now I'll apply fixes in severity order — first the two Medium findings inscripts/local-install.mjs, then the Low docblock nit.Medium 1 (BOM): Strip a leading UTF-8 BOM before
JSON.parseso Node can read settings files that pi reads fine:Now the test file — add the silent-failure shim variants and the new tests:
Now run the gates —
npm testplus syntax checks on both modified files:I double-escaped the backticks in the new RegExp lines — inside a template literal that terminates the string early. Let me inspect and fix:
Now re-run the gates:
All 43 tests pass (40 pre-existing + 3 new), syntax checks clean. Final verification of the working-tree diff:
All gates green. Remediation complete — here is the annotated findings document.
Review Findings — 90: Implement pi registration with URL dedupe and reload reminder in scripts/local-install.mjs
Summary
Fixed both medium robustness gaps and the low docblock nit: (1)
dedupeAndRegisternow strips a leading UTF-8 BOM beforeJSON.parse, so a BOM-prefixed settings file that pi can read is no longer silently skipped by dedupe (new test covers it); (2) bothpi remove/pi installfailure messages now usefailureDetail(...)instead ofcombinedOutput(...), with newpiRemoveSilentFail/piInstallSilentFailshim variants and two tests asserting theexit status 1fallback; (3) the header docblock now notes the warn-only exceptions. Gates: test —npm test(node --test scripts/local-install.test.mjs) passed 43/43 (40 pre-existing + 3 new); build — no build script exists,node --checkon both modified files passed; lint — none in repo. The two remaining low findings concern the already-committed commit message and branch name; remediating them requires ref mutations (git commit --amend,git branch -m) which this stage is prohibited from performing, so they are carried forward unresolved.Critical
(empty)
High
(empty)
Medium
JSON.parserejects a settings file that pi itself can still read (verified: a UTF-8 BOM prefix throwsUnexpected tokenin Node'sJSON.parse, while many tools strip it). In that casepi install <path>then succeeds and both the old URL entry and the new local-path entry stay registered — exactly the duplicate identity this feature exists to prevent. The previous behavior (abort with "Fix it and re-run") at least guaranteed dedupe was never silently skipped. Suggested fix: strip a leading BOM before parsing, e.g.JSON.parse(readFileSync(file, "utf-8").replace(/^\uFEFF/, "")), and/or after a successfulpi installre-read the settings files and warn if an entry matching this repo's URL still remains.pi remove/pi installfailure messages embedcombinedOutput(removed)/combinedOutput(installed)(line 425), which is empty when pi exits non-zero without writing anything, producingAborted: \pi install …` failed:\n\nFix the pi error above…with no error "above".gitPull/npmInstallalready usefailureDetail(...)for exactly this reason and have a silent-failure test ("main reports the exit status when git pull fails without any output"), but the newpiRemoveFails/piInstallFailsshims (scripts/local-install.test.mjs:58-59) only model failing-with-stderr. Suggested fix: switch bothfail()calls tofailureDetail(removed)/failureDetail(installed), add silent variants (piRemoveSilentFail/piInstallSilentFail) to the shim, and a test asserting theexit status 1` fallback appears in the abort message.Low
652e887— Commit message90: Implement pi registration…deviates from AGENTS.md's issue-driven formatissue-<N>: <summary>(e.g.issue-42: add user auth). It does match the repo's existing bare-<N>:history, so this may be deliberate local practice — but as written it contradicts the documented standard. Suggested fix: amend toissue-90: implement pi registration with URL dedupe and reload reminder in scripts/local-install.mjs, or update AGENTS.md to codify the bare-number form.…and-reload-reminder-in-scripts-local-install-mjs, ~106 chars) fits well within git's ref-length limit. Suggested fix: rename the branch tofeature/issue-90/implement-pi-registration-with-url-dedupe-and-reload-reminder-in-scripts-local-install-mjs.Documentation
Updated files: