@bigknoxy/hashpilot 4.8.2 → 4.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -88,3 +88,12 @@ Format:
88
88
  - **Decision:** Add `bun.lock` to `package.json`'s `files` array so it ships in the npm tarball. The existing `install.sh` logic already uses `--frozen-lockfile` when `bun.lock` is present.
89
89
  - **Alternatives considered:** (1) Generate a lockfile during install — rejected: defeats the purpose of pinning. (2) Keep `bun.lock` out and accept fresh resolution — rejected: supply-chain pinning gap.
90
90
  - **Consequences:** npm-installed packages now include `bun.lock` and install with `--frozen-lockfile`. The npm package size increases slightly. The `else` branch in `install.sh` (lines 423-432) becomes unreachable for current npm installs but is kept as a safe fallback.
91
+
92
+ ## D010: npm-sourced installs with a shipped bun.lock use --frozen-lockfile --production
93
+
94
+ - **Date:** 2026-09-06
95
+ - **PR:** hotfix (after v4.8.2)
96
+ - **Context:** v4.8.2 shipped broken for the **default npm install path**. D007 (#199) added `bun.lock` to the npm package's `files`; the dependency-mode guard from #194 treated `NPM_INSTALLED=true && bun.lock present` as a fatal ("refusing to guess which dependency mode is correct"). D007 made that guard's fire-branch the *normal* case, so every fresh npm install of v4.8.2 aborted before installing dependencies. The bug passed CI because smoke installs from `@latest` npm — main's run predated the semantic-release publish and tested 4.8.1 (no lockfile); the breakage only surfaced once v4.8.2 reached the registry.
97
+ - **Decision:** The dependency-mode decision now keys off `$NPM_INSTALLED`, not a bare lockfile-presence check. npm source + shipped lock → `bun install --frozen-lockfile --production` (pinned, devDeps skipped). npm source, no lock → `--production` (legacy). git/local + lock → `--frozen-lockfile` (dev wants devDeps). git/local, no lock → hard error (unchanged).
98
+ - **Alternatives considered:** (1) Revert D007 (don't ship bun.lock) — rejected: pinning transitive deps is the correct supply-chain posture; the packaging was not the flaw, the mode-selector was. (2) Remove the #194 guard entirely and let the old `[ -f bun.lock ]` branch run plain `--frozen-lockfile` — rejected: that would pull devDependencies (semantic-release) into npm installs, breaking the smoke's devDep-exclusion assertion and bloating user installs.
99
+ - **Consequences:** npm-installed packages are pinned to the shipped lockfile while still skipping devDeps. **Coverage hole identified:** smoke's npm-path test installs `@latest` (published version), so an unpublished PR branch is never validated against its own packed tarball — add a version-consistency guard so "testing the wrong release" is loud, not silent.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigknoxy/hashpilot",
3
- "version": "4.8.2",
3
+ "version": "4.8.3",
4
4
  "description": "HashPilot — Global Tool-Agnostic Structured Editing Core for Coding Agents",
5
5
  "type": "module",
6
6
  "engines": {
@@ -405,31 +405,45 @@ log "Installing dependencies..."
405
405
  # (e.g. an npm extraction that somehow shipped a lockfile, or a git/local
406
406
  # source that's missing one) fails loudly here instead of silently
407
407
  # guessing.
408
- if [ "$NPM_INSTALLED" = "true" ] && [ -f "$SOURCE_DIR/bun.lock" ]; then
409
- err "npm-sourced install unexpectedly has a bun.lock — refusing to guess which dependency mode is correct"
410
- exit 1
411
- fi
412
408
  if [ "$NPM_INSTALLED" = "false" ] && [ ! -f "$SOURCE_DIR/bun.lock" ]; then
413
409
  err "Source is missing bun.lock and wasn't installed from npm — refusing to guess which dependency mode is correct"
414
410
  err "(local-clone and --source installs are expected to have bun.lock, same as the git repo does)"
415
411
  exit 1
416
412
  fi
417
413
 
418
- if [ -f "$SOURCE_DIR/bun.lock" ]; then
414
+ # Dependency mode decided here, not by a bare [ -f bun.lock ] presence check:
415
+ # - git/local source with bun.lock -> --frozen-lockfile (dev wants devDeps)
416
+ # - npm source with bun.lock (D007) -> --frozen-lockfile --production (pinned,
417
+ # but skip devDeps — the npm package lists them in package.json even though
418
+ # `files` excludes them; a plain --frozen-lockfile would pull semantic-release)
419
+ # - npm source without bun.lock -> --production (legacy, pre-D007)
420
+ if [ "$NPM_INSTALLED" = "true" ]; then
421
+ # npm always skips devDependencies. When the shipped lockfile is present
422
+ # (D007), pin to it too; otherwise resolve production deps fresh.
423
+ if [ -f "$SOURCE_DIR/bun.lock" ]; then
424
+ detail "bun.lock shipped (npm package) — installing pinned production dependencies"
425
+ cd "$TARGET_DIR/structured-editing"
426
+ bun install --frozen-lockfile --production 2>&1 | while IFS= read -r line; do detail "$line"; done
427
+ cd "$OLDPWD"
428
+ else
429
+ # The npm-published package.json still lists devDependencies (npm's
430
+ # `files` field controls which FILES ship, not which package.json fields
431
+ # do) — a plain `bun install` would resolve and install semantic-release,
432
+ # fast-check, and the rest of the dev toolchain for no reason on an end
433
+ # user's machine. --production skips them; the CLI never needs them.
434
+ detail "No bun.lock shipped (npm package install) — resolving production dependencies fresh"
435
+ rm -f "$TARGET_DIR/structured-editing/bun.lock"
436
+ cd "$TARGET_DIR/structured-editing"
437
+ bun install --production 2>&1 | while IFS= read -r line; do detail "$line"; done
438
+ cd "$OLDPWD"
439
+ fi
440
+ elif [ -f "$SOURCE_DIR/bun.lock" ]; then
419
441
  cd "$TARGET_DIR/structured-editing"
420
442
  bun install --frozen-lockfile 2>&1 | while IFS= read -r line; do detail "$line"; done
421
443
  cd "$OLDPWD"
422
444
  else
423
- # The npm-published package.json still lists devDependencies (npm's
424
- # `files` field controls which FILES ship, not which package.json fields
425
- # do) — a plain `bun install` would resolve and install semantic-release,
426
- # fast-check, and the rest of the dev toolchain for no reason on an end
427
- # user's machine. --production skips them; the CLI never needs them.
428
- detail "No bun.lock shipped (npm package install) — resolving production dependencies fresh"
429
- rm -f "$TARGET_DIR/structured-editing/bun.lock"
430
- cd "$TARGET_DIR/structured-editing"
431
- bun install --production 2>&1 | while IFS= read -r line; do detail "$line"; done
432
- cd "$OLDPWD"
445
+ err "Source has no bun.lock and was not installed from npm — nothing to pin against"
446
+ exit 1
433
447
  fi
434
448
  detail "Dependencies installed"
435
449