@pareto4/pp-core 1.5.1 → 1.5.2

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pp-core",
3
3
  "displayName": "PP Core",
4
- "version": "1.5.1",
4
+ "version": "1.5.2",
5
5
  "description": "PP Core is a meta-prompting, context engineering, and spec-driven development system for AI coding agents.",
6
6
  "author": {
7
7
  "name": "pareto4",
package/bin/install.js CHANGED
@@ -7714,6 +7714,15 @@ function cleanupOrphanedHooks(settings) {
7714
7714
  'gsd-intel-prune.js', // Removed in v1.9.2
7715
7715
  ];
7716
7716
 
7717
+ // pareto4/pp-core#1: prune the entire predecessor OpenGSD hook namespace.
7718
+ // pp-core ships hooks/pp-*.{js,sh} and deletes the old hooks/gsd-*.{js,sh}
7719
+ // files on install — but the matching settings.json entries were left behind,
7720
+ // dangling (target file removed) and duplicating the freshly-added pp-* hooks.
7721
+ // Any command pointing into hooks/gsd-*.{js,sh,cmd} is therefore stale: pp-core
7722
+ // never registers gsd-* hooks. Match generically rather than enumerating each
7723
+ // basename so future predecessor hooks are covered automatically.
7724
+ const legacyGsdManagedHookRe = /hooks[\\/]gsd-[a-z0-9-]+\.(?:js|sh|cmd)(?=$|["'`\s])/i;
7725
+
7717
7726
  let cleanedHooks = false;
7718
7727
 
7719
7728
  // Check all hook event types (Stop, SessionStart, etc.)
@@ -7724,9 +7733,13 @@ function cleanupOrphanedHooks(settings) {
7724
7733
  // Filter out entries that contain orphaned hooks
7725
7734
  const filtered = hookEntries.filter(entry => {
7726
7735
  if (entry.hooks && Array.isArray(entry.hooks)) {
7727
- // Check if any hook in this entry matches orphaned patterns
7736
+ // Check if any hook in this entry matches orphaned patterns or the
7737
+ // predecessor gsd-* managed-hook namespace.
7728
7738
  const hasOrphaned = entry.hooks.some(h =>
7729
- h.command && orphanedHookPatterns.some(pattern => h.command.includes(pattern))
7739
+ h.command && (
7740
+ orphanedHookPatterns.some(pattern => h.command.includes(pattern)) ||
7741
+ legacyGsdManagedHookRe.test(h.command)
7742
+ )
7730
7743
  );
7731
7744
  if (hasOrphaned) {
7732
7745
  cleanedHooks = true;
@@ -7736,6 +7749,11 @@ function cleanupOrphanedHooks(settings) {
7736
7749
  return true; // Keep this entry
7737
7750
  });
7738
7751
  settings.hooks[eventType] = filtered;
7752
+ // Drop the event key entirely once all its matcher groups are gone, so
7753
+ // no empty hook arrays linger in settings.json.
7754
+ if (settings.hooks[eventType].length === 0) {
7755
+ delete settings.hooks[eventType];
7756
+ }
7739
7757
  }
7740
7758
  }
7741
7759
  }
@@ -7744,16 +7762,21 @@ function cleanupOrphanedHooks(settings) {
7744
7762
  console.log(` ${green}✓${reset} Removed orphaned hook registrations`);
7745
7763
  }
7746
7764
 
7747
- // Fix #330: Update statusLine if it points to old GSD statusline.js path
7748
- // Only match the specific old GSD path pattern (hooks/statusline.js),
7749
- // not third-party statusline scripts that happen to contain 'statusline.js'
7765
+ // Fix #330 + pareto4/pp-core#1: Update statusLine if it points to a stale
7766
+ // managed statusline path — both the pre-rename `hooks/statusline.js` and the
7767
+ // OpenGSD-era `hooks/gsd-statusline.js` (deleted on the pp-core upgrade, which
7768
+ // otherwise leaves the statusline pointing at a missing file). Match only
7769
+ // these specific managed basenames, not third-party scripts that merely
7770
+ // contain 'statusline.js'.
7750
7771
  if (settings.statusLine && settings.statusLine.command &&
7751
- /hooks[\/\\]statusline\.js/.test(settings.statusLine.command)) {
7772
+ /hooks[\/\\](?:gsd-)?statusline\.js/.test(settings.statusLine.command)) {
7773
+ const wasGsd = /hooks[\/\\]gsd-statusline\.js/.test(settings.statusLine.command);
7752
7774
  settings.statusLine.command = settings.statusLine.command.replace(
7753
- /hooks([\/\\])statusline\.js/,
7775
+ /hooks([\/\\])(?:gsd-)?statusline\.js/,
7754
7776
  'hooks$1pp-statusline.js'
7755
7777
  );
7756
- console.log(` ${green}✓${reset} Updated statusline path (hooks/statusline.js → hooks/pp-statusline.js)`);
7778
+ const from = wasGsd ? 'hooks/gsd-statusline.js' : 'hooks/statusline.js';
7779
+ console.log(` ${green}✓${reset} Updated statusline path (${from} → hooks/pp-statusline.js)`);
7757
7780
  }
7758
7781
 
7759
7782
  return settings;
@@ -12167,6 +12190,7 @@ module.exports = {
12167
12190
  stripGsdFromCodexConfig,
12168
12191
  migrateCodexHooksMapFormat,
12169
12192
  stripStaleGsdHookBlocks,
12193
+ cleanupOrphanedHooks,
12170
12194
  hasUserNamespacedAotHooks,
12171
12195
  parseTomlToObject,
12172
12196
  validateCodexConfigSchema,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pp-core",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "PP Core — a meta-prompting, context engineering, and spec-driven development system for AI coding agents. Loads pp-core's operating context into every Gemini CLI session.",
5
5
  "contextFileName": "GEMINI.md"
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pareto4/pp-core",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "Pareto pp-core — The Pareto Project's AI-assisted engineering framework: meta-prompting, context engineering, and spec-driven development for AI coding agents.",
5
5
  "bin": {
6
6
  "pp-core": "bin/install.js",