Skip to content

fix(cli): bigpowers init provisions scripts/ + specs/ into consumer projects - #117

Merged
danielvm-git merged 3 commits into
mainfrom
fix/pi-scripts-provisioning
Sep 1, 2026
Merged

danielvm-git merged 3 commits into
mainfrom
fix/pi-scripts-provisioning

Conversation

@danielvm-git

Copy link
Copy Markdown
Owner

Summary

Package installs (pi install npm:bigpowers, npm i -g, npx) register skills but never provision a project-local scripts/ tree — pi's package contract has no resource type for project files and no lifecycle script runs — so SKILL.md commands (bash scripts/*.sh) and → verify: gates fail in every consumer project (#116).

bigpowers init (run once per consumer project) links the installed package's scripts/ into the project and scaffolds specs/bugs/ + specs/verifications/, so skill commands and gates resolve exactly where SKILL.md bodies expect them.

Change

  • scripts/lib/install-helpers.js: initProject(repoRoot) (link scripts/ via linkDir, scaffold specs dirs, no-op when cwd is the package itself) and initProjectRemove(repoRoot) (removes only the managed symlink + untouched scaffolds). Both inherit assertReplaceable — a user-owned scripts/ is refused, never clobbered.
  • assertReplaceable: managed-symlink check now requires a path-separator boundary — a string-prefix sibling of the package root (<ROOT>-evil) is no longer treated as managed (follow-up from the PR fix(install): refuse to replace non-managed files or dirs during setup #114 review).
  • bin/init.js + bigpowers init [--remove] dispatch + help text; friendly refusal message instead of a stack trace.
  • README "pi Support": documents the per-project provisioning step (npx bigpowers init).
  • Bug records: BUG-2026-08-31-pi-scripts-provisioning (this fix) and BUG-2026-08-31-npm-token-invalid-release (yesterday's EINVALIDNPMTOKEN release failure — resolved by secret rotation + rerun; v2.87.6 published). Registry + OKF regenerated; state.yaml/agent-lock updated.

Test plan

  • RED→GREEN: scripts/test-install-helpers.js additions failed before the fix (initProject is not a function) and now pass: provisioning, --remove, refusal-with-content-intact, CLI drift guards, prefix-boundary case.
  • e2e in a temp consumer project: gates resolve (test -f scripts/run-skill-verify.sh && test -d specs/bugs), idempotent re-init, clean --remove, user-owned scripts/ refused with mine.sh surviving, no-op inside the package checkout.
  • Gates: bash scripts/test-install-helpers.sh PASS; bash scripts/run-skill-verify.sh → 63 PASS / 0 FAIL; compliance, story-verify, golden suite per CI.

Closes #116.

…ipts provisioning

Two open bug records:
- BUG-2026-08-31-npm-token-invalid-release: Release workflow fails
  EINVALIDNPMTOKEN at verifyConditions (run 33461454695, commit f866adc);
  v2.87.6 unpublished pending NPM_TOKEN rotation. Code unaffected —
  skill-health and compliance green on the same commit.
- BUG-2026-08-31-pi-scripts-provisioning (#116): package installs
  provision skills but never scripts/ — verify gates fail in every
  consumer project. Fix via bigpowers init lands in the following
  commits on this branch.

Registry regenerated (74 bugs) with OKF sidecars.
Regression tests for BUG-2026-08-31-pi-scripts-provisioning (#116):
- initProject links package scripts/ into a consumer project and
  scaffolds specs/bugs + specs/verifications
- initProjectRemove cleans only managed artifacts
- init refuses (never clobbers) a user-owned scripts/ dir
- CLI drift guards: 'init' dispatch in bin/bigpowers.js + bin/init.js
- managed-symlink check needs a path-separator boundary (PR #114
  follow-up): prefix sibling <ROOT>-evil must be refused

All fail against current code (initProject undefined).
…rojects

BUG-2026-08-31-pi-scripts-provisioning (#116). Package installs
(pi install npm:bigpowers, npm i -g, npx) register skills but never
provision a project-local scripts/ tree — pi's package contract has
no resource type for project files and no lifecycle script runs — so
SKILL.md commands (bash scripts/*.sh) and verify gates fail in every
consumer project.

- install-helpers.js: initProject(repoRoot) links the package
  scripts/ into cwd and scaffolds specs/bugs + specs/verifications;
  initProjectRemove(repoRoot) removes only managed artifacts.
  Both reuse linkDir/assertReplaceable — a user-owned scripts/ is
  refused, never clobbered.
- assertReplaceable: managed-symlink check now requires a
  path-separator boundary — a string-prefix sibling of the package
  root (<ROOT>-evil) is no longer treated as managed (PR #114
  follow-up).
- bin/init.js + bigpowers init [--remove] dispatch + help text.
- README pi Support: document the per-project provisioning step.

RED->GREEN: test-install-helpers.js additions from the previous
commit failed (initProject undefined) and now pass; e2e verified in
a temp consumer project (gates resolve, idempotent, --remove cleans,
refusal preserves user content, no-op inside the package).
@danielvm-git
danielvm-git force-pushed the fix/pi-scripts-provisioning branch from 94ef39f to 1c9e344 Compare September 1, 2026 02:52
@danielvm-git
danielvm-git merged commit 37bc0bf into main Sep 1, 2026
5 checks passed
github-actions Bot pushed a commit that referenced this pull request Sep 1, 2026
## [2.87.8](v2.87.7...v2.87.8) (2026-09-01)

### Bug Fixes

* **cli:** bigpowers init provisions scripts/ + specs/ into consumer projects ([#117](#117)) ([37bc0bf](37bc0bf)), closes [#116](#116) [#116](#116) [#114](#114) [#116](#116) [#114](#114)
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.87.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

danielvm-git added a commit that referenced this pull request Sep 1, 2026
…ng (PR #117)

Both records resolved:
- BUG-2026-08-31-npm-token-invalid-release: NPM_TOKEN rotated, run
  rerun green, v2.87.6 published; v2.87.7/v2.87.8 followed normally.
- BUG-2026-08-31-pi-scripts-provisioning (#116): bigpowers init
  landed as 37bc0bf (PR #117), ships in v2.87.8.

Registry regenerated; fix_bug flow cleared in state.yaml.
danielvm-git added a commit that referenced this pull request Nov 6, 2026
The bug batch shipped through PRs #221-#227 and the trace-worktrees fix #203,
but the records stayed open; two omp defects (#119, #189) were fixed in code
without the record updated, and pi-scripts-provisioning was fixed by PR #117.
Record the evidence and regenerate the registry.

Remaining open: cli-nontty-silent-noop (parked #201),
dev-dependency-advisories (accepted: dev-only), story-verify-e58-eval-flake
(epic done, flake not reproduced).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pi install npm:bigpowers never provisions scripts/` into projects — expected, or did I miss a step for pi users?

1 participant