bounded-loops 0.2.0 → 0.3.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.
package/README.md CHANGED
@@ -8,8 +8,9 @@ The engine itself is a **Python 3.11+** package. This wrapper lets you run it wi
8
8
  one command:
9
9
 
10
10
  ```bash
11
- npx bounded-loops list
12
- npx bounded-loops run loops/bug-fix-red-green --yes
11
+ npx bounded-loops new --list
12
+ npx bounded-loops new pytest-basic my-loop
13
+ npx bounded-loops run my-loop --yes
13
14
  ```
14
15
 
15
16
  On first run it detects Python 3.11+, installs the `bounded-loops` Python package
@@ -20,10 +21,14 @@ Prefer the native install if you already have Python:
20
21
 
21
22
  ```bash
22
23
  pip install bounded-loops
23
- bl list
24
+ bl new --list
25
+ bl new pytest-basic my-loop
26
+ bl run my-loop --yes
24
27
  ```
25
28
 
26
- Full documentation, the 63 runnable loops, the nine bounds, and the architecture
29
+ Full documentation, the 68 loop folders (64 keyless), the nine bounds, and the architecture
27
30
  docs live in the [main repository](https://github.com/qualixar/bounded-loops).
31
+ Clone the repository when you want `bl list` to browse the full shipped loop
32
+ catalog.
28
33
 
29
34
  Apache-2.0.
@@ -10,6 +10,7 @@
10
10
  // Node — Python 3.11+ must be available on your PATH.
11
11
 
12
12
  const { spawnSync } = require('child_process');
13
+ const { version: npmVersion } = require('../package.json');
13
14
 
14
15
  const args = process.argv.slice(2);
15
16
 
@@ -40,21 +41,30 @@ if (!python) {
40
41
  process.exit(1);
41
42
  }
42
43
 
43
- // Already installed? Run it.
44
- const installed = spawnSync(python, ['-c', 'import bounded_loops'], { stdio: 'ignore' });
45
- if (installed.status === 0) {
44
+ // Run only when the Python engine exactly matches this npm release. Merely
45
+ // importing bounded_loops is insufficient: an older global install would make
46
+ // `npx bounded-loops@0.3.0` silently execute 0.2.x.
47
+ const installed = spawnSync(
48
+ python,
49
+ [
50
+ '-c',
51
+ 'from importlib.metadata import version; print(version("bounded-loops"))',
52
+ ],
53
+ { encoding: 'utf8' }
54
+ );
55
+ if (installed.status === 0 && installed.stdout.trim() === npmVersion) {
46
56
  runCli(python);
47
57
  }
48
58
 
49
- // First run: bootstrap the Python engine via pip, then run.
50
- console.error('bounded-loops: installing the Python engine (first run)…');
59
+ // First run or version mismatch: install the exact matching Python engine.
60
+ console.error(`bounded-loops: installing Python engine ${npmVersion}…`);
51
61
  const install = spawnSync(
52
62
  python,
53
- ['-m', 'pip', 'install', '--quiet', 'bounded-loops'],
63
+ ['-m', 'pip', 'install', '--quiet', `bounded-loops==${npmVersion}`],
54
64
  { stdio: 'inherit' }
55
65
  );
56
66
  if (install.status !== 0) {
57
- console.error('Auto-install failed. Install it manually: pip install bounded-loops');
67
+ console.error(`Auto-install failed. Install it manually: pip install bounded-loops==${npmVersion}`);
58
68
  process.exit(1);
59
69
  }
60
70
  runCli(python);
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "bounded-loops",
3
- "version": "0.2.0",
4
- "description": "npx launcher for bounded-loops runnable, bounded AI-agent loops. The engine is a Python 3.11+ package; this wrapper detects Python, installs it on first run, and runs it.",
3
+ "version": "0.3.0",
4
+ "description": "npx launcher for bounded-loops: 68 loop folders, 64 keyless, with independent gates and nine enforced bounds. Requires Python 3.11+.",
5
5
  "bin": {
6
6
  "bounded-loops": "bin/bounded-loops.js"
7
7
  },
8
+ "scripts": {
9
+ "test": "node --test test/*.test.js"
10
+ },
8
11
  "files": [
9
12
  "bin/",
10
13
  "README.md"