portable-agent-layer 0.53.0 → 0.54.0

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.
@@ -21,6 +21,7 @@ Assign ONE tier at the start of OBSERVE. Default is Standard — only escalate i
21
21
  | Plan Mode (EnterPlanMode) | Skip | Use for user alignment |
22
22
  | LEARN phase | Reflection log + threads | + Wisdom frame |
23
23
  | Constraint extraction | Inline in reverse engineering | Numbered [EX-N] list |
24
+ | Criteria tracking | Inline checklist only | + TaskCreate one task per criterion at end of OBSERVE |
24
25
 
25
26
  ## The Five Phases
26
27
 
@@ -208,6 +209,8 @@ For EACH criterion:
208
209
 
209
210
  **Demonstrate, don't assert.** When verifying a new check / rule / behavior on a system that already passes, "existing inputs still pass" is not evidence the new logic works — the existing inputs would pass even if your code did nothing. Construct a deliberately-broken minimal example (a fake bad slide, a known-failing input, a unit test that should now fail without your change) and run it through to prove the new behavior actually fires. Show the failure happening in the verification output, not just the success case.
210
211
 
212
+ **Evidence gate:** A criterion with no evidence line is an automatic FAIL — list it explicitly, fix it, then re-verify. Do not advance to LEARN with any criterion unevidenced. "Looks correct" or "should work" does not count as evidence.
213
+
211
214
  If any criteria failed, fix and re-verify before completing.
212
215
 
213
216
  ### ━━━ 📚 LEARN ━━━ 5/5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "portable-agent-layer",
3
- "version": "0.53.0",
3
+ "version": "0.54.0",
4
4
  "description": "PAL — Portable Agent Layer: persistent personal context for AI coding assistants",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Update checker — detects if a newer version of PAL is available.
3
3
  *
4
- * Package mode: fetch npm registry for latest version vs installed
5
- * Repo mode: opt in with PAL_UPDATE_MODE=repo to compare HEAD vs origin/main
4
+ * Repo mode: auto-detected when a .git directory exists at palPkg() root.
5
+ * Package mode: fallback when no .git is present (global bun install).
6
6
  *
7
7
  * Caches result in state/update-available.json. Checked at most once per hour.
8
8
  */
@@ -47,7 +47,7 @@ function writeCache(cache: UpdateCache): void {
47
47
  }
48
48
 
49
49
  function isRepoMode(): boolean {
50
- return process.env.PAL_UPDATE_MODE === "repo" && existsSync(resolve(palPkg(), ".git"));
50
+ return existsSync(resolve(palPkg(), ".git"));
51
51
  }
52
52
 
53
53
  function getInstalledVersion(): string {
@@ -346,13 +346,25 @@ export function mergeCursorHooks(
346
346
 
347
347
  if (template.hooks) {
348
348
  result.hooks ??= {};
349
+
350
+ // Collect canonical forms of all template hook commands
351
+ const palCanonical = new Set<string>();
352
+ for (const entries of Object.values(template.hooks)) {
353
+ for (const entry of entries) palCanonical.add(canonicalPalCmd(entry.command));
354
+ }
355
+
356
+ // Strip existing PAL hooks that match canonically (removes old-path duplicates)
357
+ for (const [event, entries] of Object.entries(result.hooks)) {
358
+ result.hooks[event] = entries.filter(
359
+ (e) => !palCanonical.has(canonicalPalCmd(e.command))
360
+ );
361
+ if (result.hooks[event].length === 0) delete result.hooks[event];
362
+ }
363
+
364
+ // Insert template entries (old-path versions were just stripped)
349
365
  for (const [event, entries] of Object.entries(template.hooks)) {
350
366
  const current = result.hooks[event] ?? [];
351
- for (const entry of entries) {
352
- if (!current.some((e) => e.command === entry.command)) {
353
- current.push(entry);
354
- }
355
- }
367
+ for (const entry of entries) current.push(entry);
356
368
  result.hooks[event] = current;
357
369
  }
358
370
  }