codebyplan 1.13.56 → 1.13.57

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codebyplan",
3
- "version": "1.13.56",
3
+ "version": "1.13.57",
4
4
  "description": "CLI for CodeByPlan — AI-powered development planning and tracking",
5
5
  "type": "module",
6
6
  "bin": {
@@ -420,9 +420,6 @@ function main() {
420
420
  if (shouldShow("PACKAGE_FRESHNESS", cfg.package_freshness)) {
421
421
  let guarded = false;
422
422
  let installed = "";
423
- let newer = false;
424
- let latest = "";
425
- let inSync = true;
426
423
 
427
424
  const cachePath = path.join(
428
425
  root,
@@ -444,9 +441,6 @@ function main() {
444
441
  } else {
445
442
  installed =
446
443
  typeof cache.installed === "string" ? cache.installed : "";
447
- newer = cache.newer === true;
448
- latest = typeof cache.latest === "string" ? cache.latest : "";
449
- inSync = cache.in_sync !== false;
450
444
  }
451
445
  }
452
446
  } catch {
@@ -466,21 +460,14 @@ function main() {
466
460
  guarded = true;
467
461
  } else {
468
462
  try {
469
- const mRaw = fs.readFileSync(manifestPath, "utf8");
470
- const mParsed = JSON.parse(mRaw);
471
- const mVer =
472
- typeof mParsed?.version === "string" ? mParsed.version : "";
463
+ // Reading + parsing the manifest validates it — unreadable/invalid
464
+ // JSON falls into the catch below and hides the segment. (The
465
+ // manifest-vs-installed ⟳ nag was removed in CHK-195.)
466
+ JSON.parse(fs.readFileSync(manifestPath, "utf8"));
473
467
  const pRaw = fs.readFileSync(pkgPath, "utf8");
474
468
  const pParsed = JSON.parse(pRaw);
475
- const iVer =
469
+ installed =
476
470
  typeof pParsed?.version === "string" ? pParsed.version : "";
477
- installed = iVer;
478
- if (mVer && iVer && mVer !== iVer) {
479
- // manifest ≠ installed → .claude is out of sync. The ⟳ nag was removed
480
- // (CHK-195); only the bare version renders. inSync is retained for the
481
- // guard shape but no longer drives any output.
482
- inSync = false;
483
- }
484
471
  } catch {
485
472
  // Can't read files → hide segment.
486
473
  guarded = true;
@@ -492,6 +479,26 @@ function main() {
492
479
  const L8 = `${C.DIM}cbp${C.RST} ${installed}`;
493
480
  out.push(L8);
494
481
  }
482
+
483
+ // Settings-contract violations (read from cache regardless of guard state).
484
+ if (fs.existsSync(cachePath)) {
485
+ try {
486
+ const cacheRaw2 = fs.readFileSync(cachePath, "utf8");
487
+ const cache2 = JSON.parse(cacheRaw2);
488
+ if (cache2 && typeof cache2 === "object") {
489
+ const settingsMissing = cache2.settings_missing === true;
490
+ const settingsIgnored = cache2.settings_ignored === true;
491
+ if (settingsMissing) {
492
+ out.push(`${C.RED}⚠ settings.json missing!${C.RST}`);
493
+ }
494
+ if (settingsIgnored) {
495
+ out.push(`${C.YELLOW}⚠ settings.json gitignored!${C.RST}`);
496
+ }
497
+ }
498
+ } catch {
499
+ // Unreadable / invalid → no indicators
500
+ }
501
+ }
495
502
  }
496
503
 
497
504
  process.stdout.write(out.length ? out.join("\n") + "\n" : "");
@@ -401,6 +401,19 @@ def main():
401
401
  l8 = "%scbp%s %s" % (DIM, RST, _installed)
402
402
  out.append(l8)
403
403
 
404
+ # Settings-contract violations (read from cache regardless of guard state).
405
+ if os.path.isfile(cache_path):
406
+ try:
407
+ with open(cache_path, "r", encoding="utf-8") as fh:
408
+ cache2 = json.load(fh)
409
+ if isinstance(cache2, dict):
410
+ if cache2.get("settings_missing") is True:
411
+ out.append("%s⚠ settings.json missing!%s" % (RED, RST))
412
+ if cache2.get("settings_ignored") is True:
413
+ out.append("%s⚠ settings.json gitignored!%s" % (YELLOW, RST))
414
+ except Exception:
415
+ pass # Unreadable / invalid → no indicators
416
+
404
417
  sys.stdout.write(("\n".join(out) + "\n") if out else "")
405
418
 
406
419
 
@@ -494,4 +494,16 @@ if should_show PACKAGE_FRESHNESS "$CFG_PACKAGE_FRESHNESS"; then
494
494
  L8="${DIM}cbp${RST} ${_CBP_INSTALLED}"
495
495
  printf "%b\n" "$L8"
496
496
  fi
497
+
498
+ # Settings-contract violations (read from cache regardless of guard state).
499
+ if [ -f "$CBP_STATUS_CACHE" ] && command -v jq >/dev/null 2>&1; then
500
+ _CBP_SETTINGS_MISSING="$(jq -r '.settings_missing == true' "$CBP_STATUS_CACHE" 2>/dev/null)"
501
+ _CBP_SETTINGS_IGNORED="$(jq -r '.settings_ignored == true' "$CBP_STATUS_CACHE" 2>/dev/null)"
502
+ if [ "$_CBP_SETTINGS_MISSING" = "true" ]; then
503
+ printf "%b\n" "${RED}⚠ settings.json missing!${RST}"
504
+ fi
505
+ if [ "$_CBP_SETTINGS_IGNORED" = "true" ]; then
506
+ printf "%b\n" "${YELLOW}⚠ settings.json gitignored!${RST}"
507
+ fi
508
+ fi
497
509
  fi