@karmaniverous/jeeves-watcher-openclaw 0.12.0 → 0.12.1

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.
@@ -177,11 +177,17 @@ No stranded local branches. Push immediately after commit. A commit that isn't p
177
177
 
178
178
  ### Check PR State Before Pushing
179
179
 
180
- **Before EVERY `git push`**, verify the PR is not already merged. Pushing to a merged branch creates orphaned work that is invisible in the main branch and wastes effort.
180
+ **Before EVERY `git push`**, run `gh pr list --head <branch> --repo <repo> --json number,state` to check whether a PR exists on that branch and whether it's merged.
181
181
 
182
- Sequence: `gh pr view --json state` → confirm state is `OPEN` → push. If no PR exists yet, pushing is safe. If the PR is `MERGED` or `CLOSED`, **STOP** and report to the user.
182
+ - **No PR exists:** Safe to push.
183
+ - **PR is `OPEN`:** Safe to push.
184
+ - **PR is `MERGED` or `CLOSED`:** **STOP** and report to the user. Do not push to a merged PR branch.
183
185
 
184
- This is not optional. It applies to every push, every branch, every time.
186
+ This is not optional. It applies to every push, every branch, every time. No judgment call about whether the branch "is a PR branch" — the check is mechanical.
187
+
188
+ ### New PR Over Merged Branch
189
+
190
+ When a PR has been merged and additional work is needed on the same branch, create a new PR on the **same branch** targeting the same base. Do not create new branches, cherry-pick, or start over. The commits are already there — `gh pr create --head <existing-branch>` is the entire operation.
185
191
 
186
192
  ## Managed Content Self-Maintenance
187
193
 
@@ -21,6 +21,7 @@
21
21
  I am a **senior software engineer** first. The persona is style; the engineering discipline is substance.
22
22
 
23
23
  What this means in practice:
24
+ - **Do not execute untested code.** Every mutation script defaults to dry-run mode. The dry-run output is the test — it shows what would happen. Live execution requires an explicit flag. If dry-run is hard to implement, that's a design flaw.
24
25
  - **No cowboy coding.** I don't iterate in production. I don't ship untested changes. I don't treat live systems as scratch pads.
25
26
  - **I follow proper workflows.** Branch, test, review, merge. CI/CD exists for a reason. If there's a pipeline, I use it.
26
27
  - **I resist n00b temptations.** "Let me just quickly…" in prod is how outages happen. I know better.
package/dist/cli.js CHANGED
@@ -9885,14 +9885,14 @@ ZodNullable.create;
9885
9885
  * Core library version, inlined at build time.
9886
9886
  *
9887
9887
  * @remarks
9888
- * The `0.2.0` placeholder is replaced by
9888
+ * The `0.3.0` placeholder is replaced by
9889
9889
  * `@rollup/plugin-replace` during the build with the actual version
9890
9890
  * from `package.json`. This ensures the correct version survives
9891
9891
  * when consumers bundle core into their own dist (where runtime
9892
9892
  * `import.meta.url`-based resolution would find the wrong package.json).
9893
9893
  */
9894
9894
  /** The core library version from package.json (inlined at build time). */
9895
- const CORE_VERSION = '0.2.0';
9895
+ const CORE_VERSION = '0.3.0';
9896
9896
 
9897
9897
  /**
9898
9898
  * Shared file I/O helpers for managed section operations.
package/dist/index.js CHANGED
@@ -9997,14 +9997,14 @@ const COMPONENT_VERSIONS_FILE = 'component-versions.json';
9997
9997
  * Core library version, inlined at build time.
9998
9998
  *
9999
9999
  * @remarks
10000
- * The `0.2.0` placeholder is replaced by
10000
+ * The `0.3.0` placeholder is replaced by
10001
10001
  * `@rollup/plugin-replace` during the build with the actual version
10002
10002
  * from `package.json`. This ensures the correct version survives
10003
10003
  * when consumers bundle core into their own dist (where runtime
10004
10004
  * `import.meta.url`-based resolution would find the wrong package.json).
10005
10005
  */
10006
10006
  /** The core library version from package.json (inlined at build time). */
10007
- const CORE_VERSION = '0.2.0';
10007
+ const CORE_VERSION = '0.3.0';
10008
10008
 
10009
10009
  /**
10010
10010
  * Shared file I/O helpers for managed section operations.
@@ -10152,6 +10152,12 @@ const AGENTS_MARKERS = {
10152
10152
  /** H1 title prepended in the managed block. */
10153
10153
  title: 'Jeeves Platform Agents',
10154
10154
  };
10155
+ /** All known marker sets — single source of truth for cross-contamination detection. */
10156
+ const ALL_MARKERS = [
10157
+ TOOLS_MARKERS,
10158
+ SOUL_MARKERS,
10159
+ AGENTS_MARKERS,
10160
+ ];
10155
10161
  /**
10156
10162
  * Regex pattern to extract version stamp from a BEGIN marker comment.
10157
10163
  *
@@ -10448,6 +10454,48 @@ function parseManaged(fileContent, markers = TOOLS_MARKERS) {
10448
10454
  };
10449
10455
  }
10450
10456
 
10457
+ /**
10458
+ * Strip foreign managed blocks from content.
10459
+ *
10460
+ * @remarks
10461
+ * Prevents cross-contamination by removing managed blocks that belong
10462
+ * to other marker sets. For example, when writing TOOLS.md with TOOLS
10463
+ * markers, any SOUL or AGENTS managed blocks found in the user content
10464
+ * zone are stripped — they don't belong there.
10465
+ *
10466
+ * @packageDocumentation
10467
+ */
10468
+ /**
10469
+ * Build a regex that matches an entire managed block (BEGIN marker through END marker).
10470
+ *
10471
+ * @param markers - The marker set to match.
10472
+ * @returns A regex that matches the full block including markers.
10473
+ */
10474
+ function buildBlockPattern(markers) {
10475
+ const escapedBegin = markers.begin.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
10476
+ const escapedEnd = markers.end.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
10477
+ return new RegExp(`\\s*<!--\\s*${escapedBegin}(?:\\s*\\|[^>]*)?\\s*(?:—[^>]*)?\\s*-->[\\s\\S]*?<!--\\s*${escapedEnd}\\s*-->\\s*`, 'g');
10478
+ }
10479
+ /**
10480
+ * Strip managed blocks belonging to foreign marker sets from content.
10481
+ *
10482
+ * @param content - The content to clean (typically user content zone).
10483
+ * @param currentMarkers - The marker set that owns this file (will NOT be stripped).
10484
+ * @returns Content with foreign managed blocks removed.
10485
+ */
10486
+ function stripForeignMarkers(content, currentMarkers) {
10487
+ let result = content;
10488
+ for (const markers of ALL_MARKERS) {
10489
+ // Skip the current file's own markers
10490
+ if (markers.begin === currentMarkers.begin)
10491
+ continue;
10492
+ const pattern = buildBlockPattern(markers);
10493
+ result = result.replace(pattern, '\n');
10494
+ }
10495
+ // Clean up multiple blank lines left by removals
10496
+ return result.replace(/\n{3,}/g, '\n\n').trim();
10497
+ }
10498
+
10451
10499
  /**
10452
10500
  * Version-stamp parsing and convergence logic.
10453
10501
  *
@@ -10564,8 +10612,8 @@ async function updateManagedSection(filePath, content, options = {}) {
10564
10612
  ? `# ${markers.title}\n\n${sectionText}`
10565
10613
  : sectionText;
10566
10614
  }
10567
- // Cleanup detection
10568
- const userContent = parsed.userContent;
10615
+ // Strip foreign managed blocks from user content (cross-contamination fix)
10616
+ const userContent = stripForeignMarkers(parsed.userContent, markers);
10569
10617
  const cleanupNeeded = needsCleanup(newManagedBody, userContent);
10570
10618
  // Build the full managed block
10571
10619
  const beginLine = formatBeginMarker(markers.begin, coreVersion);
@@ -10779,11 +10827,17 @@ No stranded local branches. Push immediately after commit. A commit that isn't p
10779
10827
 
10780
10828
  ### Check PR State Before Pushing
10781
10829
 
10782
- **Before EVERY \`git push\`**, verify the PR is not already merged. Pushing to a merged branch creates orphaned work that is invisible in the main branch and wastes effort.
10830
+ **Before EVERY \`git push\`**, run \`gh pr list --head <branch> --repo <repo> --json number,state\` to check whether a PR exists on that branch and whether it's merged.
10831
+
10832
+ - **No PR exists:** Safe to push.
10833
+ - **PR is \`OPEN\`:** Safe to push.
10834
+ - **PR is \`MERGED\` or \`CLOSED\`:** **STOP** and report to the user. Do not push to a merged PR branch.
10835
+
10836
+ This is not optional. It applies to every push, every branch, every time. No judgment call about whether the branch "is a PR branch" — the check is mechanical.
10783
10837
 
10784
- Sequence: \`gh pr view --json state\` → confirm state is \`OPEN\` → push. If no PR exists yet, pushing is safe. If the PR is \`MERGED\` or \`CLOSED\`, **STOP** and report to the user.
10838
+ ### New PR Over Merged Branch
10785
10839
 
10786
- This is not optional. It applies to every push, every branch, every time.
10840
+ When a PR has been merged and additional work is needed on the same branch, create a new PR on the **same branch** targeting the same base. Do not create new branches, cherry-pick, or start over. The commits are already there — \`gh pr create --head <existing-branch>\` is the entire operation.
10787
10841
 
10788
10842
  ## Managed Content Self-Maintenance
10789
10843
 
@@ -10819,6 +10873,7 @@ var soulSectionContent = `## Core Truths
10819
10873
  I am a **senior software engineer** first. The persona is style; the engineering discipline is substance.
10820
10874
 
10821
10875
  What this means in practice:
10876
+ - **Do not execute untested code.** Every mutation script defaults to dry-run mode. The dry-run output is the test — it shows what would happen. Live execution requires an explicit flag. If dry-run is hard to implement, that's a design flaw.
10822
10877
  - **No cowboy coding.** I don't iterate in production. I don't ship untested changes. I don't treat live systems as scratch pads.
10823
10878
  - **I follow proper workflows.** Branch, test, review, merge. CI/CD exists for a reason. If there's a pipeline, I use it.
10824
10879
  - **I resist n00b temptations.** "Let me just quickly…" in prod is how outages happen. I know better.
@@ -2,7 +2,7 @@
2
2
  "id": "jeeves-watcher-openclaw",
3
3
  "name": "Jeeves Watcher",
4
4
  "description": "Semantic search, metadata enrichment, and instance administration for a jeeves-watcher deployment.",
5
- "version": "0.12.0",
5
+ "version": "0.12.1",
6
6
  "skills": [
7
7
  "dist/skills/jeeves-watcher"
8
8
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@karmaniverous/jeeves-watcher-openclaw",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "author": "Jason Williscroft",
5
5
  "description": "OpenClaw plugin for jeeves-watcher — semantic search and metadata enrichment tools",
6
6
  "license": "BSD-3-Clause",