ultimate-pi 0.2.4 → 0.2.6

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.
Files changed (37) hide show
  1. package/.pi/PACKAGING.md +35 -0
  2. package/.pi/extensions/lib/harness-paths.ts +8 -0
  3. package/.pi/extensions/sentrux-rules-sync.ts +2 -8
  4. package/.pi/harness/docs/adrs/0006-sentrux-dual-layer.md +1 -1
  5. package/.pi/harness/docs/adrs/0009-sentrux-rules-lifecycle.md +2 -2
  6. package/.pi/harness/sentrux/architecture.manifest.json +3 -3
  7. package/.pi/prompts/harness-setup.md +61 -24
  8. package/.pi/scripts/README.md +17 -0
  9. package/{scripts → .pi/scripts}/harness-verify.mjs +3 -3
  10. package/{scripts → .pi/scripts}/sentrux-rules-sync.mjs +2 -2
  11. package/.pi/{settings.json → settings.example.json} +1 -1
  12. package/.sentrux/.harness-rules-meta.json +2 -2
  13. package/.sentrux/rules.toml +3 -3
  14. package/CHANGELOG.md +17 -0
  15. package/package.json +47 -8
  16. package/.ckignore +0 -41
  17. package/.codex/hooks.json +0 -15
  18. package/.env.example +0 -21
  19. package/.gitattributes +0 -1
  20. package/.github/banner-v2.png +0 -0
  21. package/.github/workflows/lint.yml +0 -33
  22. package/.github/workflows/publish-github-packages.yml +0 -35
  23. package/.github/workflows/publish-npm.yml +0 -32
  24. package/.pi/harness/browser.json +0 -1
  25. package/.pi/harness/router/README.md +0 -35
  26. package/.pi/harness/router/apply-router-proposal.mjs +0 -153
  27. package/.pi/harness/router/propose-router-tuning.mjs +0 -149
  28. package/.pi/npm/.gitignore +0 -2
  29. package/CONTRIBUTING.md +0 -166
  30. package/lefthook.yml +0 -9
  31. package/scripts/__pycache__/merge_graphify_corpora.cpython-314.pyc +0 -0
  32. package/scripts/index_youtube_urls.py +0 -376
  33. package/scripts/merge_graphify_corpora.py +0 -398
  34. package/scripts/regen_graphify_html.py +0 -46
  35. package/test/harness-verify.test.mjs +0 -33
  36. /package/{scripts → .pi/scripts}/harness-cli-verify.sh +0 -0
  37. /package/{scripts → .pi/scripts}/harness-graphify-bootstrap.sh +0 -0
@@ -0,0 +1,35 @@
1
+ # Pi package packaging (ultimate-pi)
2
+
3
+ Aligned with [pi packages](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/docs/packages.md).
4
+
5
+ ## Pi manifest (`package.json` → `pi`)
6
+
7
+ | Key | Paths | Notes |
8
+ |-----|-------|--------|
9
+ | `extensions` | `.pi/extensions` | TypeScript extensions (loaded by pi) |
10
+ | `skills` | `.agents/skills`, `.pi/skills` | Agent Skills + pi-local skills |
11
+ | `prompts` | `.pi/prompts` | Slash-command prompt templates |
12
+
13
+ Pi does **not** define `scripts`, `agents`, or `providers` in the manifest.
14
+
15
+ - **Harness scripts** → `.pi/scripts/` (npm `harness:*` scripts; see `.pi/scripts/README.md`)
16
+ - **Subagent agents** → `.pi/agents/**/*.md` (loaded by `@tintinweb/pi-subagents` from the **project** `.pi/agents/`; `/harness-setup` seeds them from the installed package)
17
+ - **Providers** → install via `bundledDependencies` + user settings, not a separate manifest directory
18
+
19
+ ## npm `files` allowlist
20
+
21
+ We use an explicit allowlist (not the whole `.pi/` tree) so dev-only artifacts never ship:
22
+
23
+ - No `.pi/harness/runs/`, local `model-router.json`, or `firecrawl/.env`
24
+ - Ship `.pi/settings.example.json`, not `.pi/settings.json` (dev checkout uses `".."` local package)
25
+
26
+ ## Settings
27
+
28
+ | File | Shipped | Purpose |
29
+ |------|---------|---------|
30
+ | `.pi/settings.json` | No | Repo dev only (`"packages": ["..", …]`) |
31
+ | `.pi/settings.example.json` | Yes | Merge into project `.pi/settings.json` during setup |
32
+
33
+ ## Dependencies
34
+
35
+ Runtime pi extensions are in `dependencies` + `bundledDependencies`. `@mariozechner/pi-coding-agent` is a `peerDependency` (provided by the pi CLI).
@@ -45,3 +45,11 @@ export function resolveHarnessAsset(
45
45
  ): string {
46
46
  return join(getHarnessPackageRoot(moduleUrl), ...segments);
47
47
  }
48
+
49
+ /** Harness CLI scripts shipped under `.pi/scripts/` in the npm package. */
50
+ export function resolveHarnessScript(
51
+ moduleUrl: string,
52
+ scriptName: string,
53
+ ): string {
54
+ return resolveHarnessAsset(moduleUrl, ".pi", "scripts", scriptName);
55
+ }
@@ -4,21 +4,15 @@
4
4
 
5
5
  import { spawn } from "node:child_process";
6
6
  import { existsSync } from "node:fs";
7
- import { join } from "node:path";
8
7
  import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
9
- import { resolveHarnessAsset } from "./lib/harness-paths.js";
8
+ import { resolveHarnessScript } from "./lib/harness-paths.js";
10
9
 
11
10
  function resolveSyncScript(): string {
12
- const packaged = resolveHarnessAsset(
11
+ return resolveHarnessScript(
13
12
  // @ts-expect-error pi extensions run as ESM
14
13
  import.meta.url,
15
- "scripts",
16
14
  "sentrux-rules-sync.mjs",
17
15
  );
18
- if (existsSync(packaged)) {
19
- return packaged;
20
- }
21
- return join(process.cwd(), "scripts", "sentrux-rules-sync.mjs");
22
16
  }
23
17
 
24
18
  function runSync(args: string[]): Promise<{ code: number; output: string }> {
@@ -28,4 +28,4 @@ Evaluator trust requires both programmatic gates (policy, budget, integrity) and
28
28
  ## References
29
29
 
30
30
  - `.pi/harness/specs/observation.schema.json`
31
- - `scripts/harness-verify.mjs`
31
+ - `.pi/scripts/harness-verify.mjs`
@@ -11,7 +11,7 @@ Sentrux enforces architecture via [`.sentrux/rules.toml`](https://sentrux.dev/do
11
11
 
12
12
  1. **Canonical source:** [`.pi/harness/sentrux/architecture.manifest.json`](../../sentrux/architecture.manifest.json) — layers, boundaries, global constraints.
13
13
  2. **Generated artifact:** `.sentrux/rules.toml` — committed to git; managed block between `harness:managed:start/end` markers.
14
- 3. **Sync command:** `npm run harness:sentrux-sync` (`scripts/sentrux-rules-sync.mjs`).
14
+ 3. **Sync command:** `npm run harness:sentrux-sync` (`.pi/scripts/sentrux-rules-sync.mjs`).
15
15
  4. **Pi command:** `/harness-sentrux-sync` via `sentrux-rules-sync.ts` extension.
16
16
  5. **When to sync:**
17
17
  - `/harness-setup` Step 2.8 (after sentrux install)
@@ -34,5 +34,5 @@ Sentrux enforces architecture via [`.sentrux/rules.toml`](https://sentrux.dev/do
34
34
  ## References
35
35
 
36
36
  - ADR 0006 (Sentrux dual layer)
37
- - `scripts/sentrux-rules-sync.mjs`
37
+ - `.pi/scripts/sentrux-rules-sync.mjs`
38
38
  - `.pi/extensions/sentrux-rules-sync.ts`
@@ -34,9 +34,9 @@
34
34
  },
35
35
  {
36
36
  "name": "tooling",
37
- "paths": ["scripts/*", "test/*"],
37
+ "paths": [".pi/scripts/*", "test/*"],
38
38
  "order": 4,
39
- "description": "Deterministic scripts and tests"
39
+ "description": "Harness CLI scripts and tests"
40
40
  }
41
41
  ],
42
42
  "boundaries": [
@@ -61,7 +61,7 @@
61
61
  "reason": "Contracts are data-only JSON schemas; extensions implement behavior"
62
62
  },
63
63
  {
64
- "from": "scripts/*",
64
+ "from": ".pi/scripts/*",
65
65
  "to": ".agents/skills/*",
66
66
  "reason": "CLI scripts stay independent of skill markdown"
67
67
  }
@@ -30,7 +30,16 @@ which git && git --version
30
30
 
31
31
  Block if node < 18, npm < 9, or git missing. Report versions and continue.
32
32
 
33
- Read `.pi/auto-commit.json` for co-author + branch config. Read `.pi/settings.json` for extension packages list.
33
+ Read `.pi/auto-commit.json` for co-author + branch config.
34
+
35
+ Resolve the installed **ultimate-pi** package root (works in this repo and after `pi install npm:ultimate-pi`):
36
+
37
+ ```bash
38
+ UP_PKG="$(node -p "require('path').dirname(require.resolve('ultimate-pi/package.json'))")"
39
+ echo "ultimate-pi package: $UP_PKG"
40
+ ```
41
+
42
+ For extension package names, read **`$UP_PKG/.pi/settings.example.json`** (shipped template). Merge its `packages` array into the **project** `.pi/settings.json` if missing — do not copy the repo-dev `.pi/settings.json` from the package (it may contain `".."` and is not published).
34
43
 
35
44
  ## Step 0.5 — Graphify (skip if `--skip-graphify`)
36
45
 
@@ -49,15 +58,14 @@ Run from the **project root** (the external repo root, not ultimate-pi unless th
49
58
  mkdir -p ./raw .pi/harness/specs .pi/harness/runs .pi/harness/incidents .pi/harness/debates
50
59
 
51
60
  # Bundled with ultimate-pi harness; copy path if bootstrap runs from a linked harness checkout
52
- bash scripts/harness-graphify-bootstrap.sh
61
+ bash "$(node -p "require('path').join(require('path').dirname(require.resolve('ultimate-pi/package.json')),'.pi/scripts/harness-graphify-bootstrap.sh')")"
53
62
  # In ultimate-pi checkout: npm run harness:graphify-bootstrap
54
- # Or, if scripts/ is not present in the target repo, copy/run ultimate-pi/scripts/harness-graphify-bootstrap.sh
55
63
 
56
64
  # Pass --force when $ARGUMENTS contains --force to rebuild an existing graph:
57
- # bash scripts/harness-graphify-bootstrap.sh --force
65
+ # npm run harness:graphify-bootstrap -- --force
58
66
  ```
59
67
 
60
- If `scripts/harness-graphify-bootstrap.sh` is missing in the target repo, run it from the ultimate-pi harness package path, or execute equivalent steps manually:
68
+ If the bootstrap script is missing, run it from the installed ultimate-pi package (`.pi/scripts/` inside the npm package), or execute equivalent steps manually:
61
69
 
62
70
  1. Install `graphifyy` (`uv tool install` preferred; else `pip`/`pip3 install --user`)
63
71
  2. `graphify install --platform pi` (and `graphify cursor install` if `.cursor/` exists)
@@ -212,9 +220,9 @@ If user chose **cloud**, skip all 1.5.x steps. Just note:
212
220
  Run the bundled verifier from the **project root**. It installs missing npm globals, fixes common **Linux system dependencies** (Chrome libs for `agent-browser`), runs smoke tests, and exits non-zero if a required tool fails.
213
221
 
214
222
  ```bash
215
- bash scripts/harness-cli-verify.sh
223
+ npm run harness:cli-verify
216
224
  # ultimate-pi checkout: npm run harness:cli-verify
217
- # Reinstall everything: bash scripts/harness-cli-verify.sh --force
225
+ # Reinstall everything: npm run harness:cli-verify -- --force
218
226
  ```
219
227
 
220
228
  **Required (script must exit 0):** firecrawl-cli, ctx7, biome, ast-grep (`sg`), sentrux (when harness manifest present).
@@ -229,14 +237,14 @@ sudo apt-get install -y libnss3 libnspr4 libgbm1 libatk1.0-0 libatk-bridge2.0-0
229
237
  libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \
230
238
  libasound2 libpango-1.0-0 libcairo2 libx11-6 libxcb1 libxext6 fonts-liberation
231
239
  agent-browser install --with-deps
232
- bash scripts/harness-cli-verify.sh
240
+ npm run harness:cli-verify
233
241
  ```
234
242
 
235
243
  **Do not continue** past Step 2 if `harness-cli-verify.sh` exits non-zero.
236
244
 
237
245
  ### Manual reference (if script missing in target repo)
238
246
 
239
- Copy `scripts/harness-cli-verify.sh` from ultimate-pi, or install tools individually:
247
+ Use `npm run harness:cli-verify` from the installed ultimate-pi package, or install tools individually:
240
248
 
241
249
  ### 2.1 — firecrawl-cli (Web Search + Scrape + Crawl + Interact + Download + Parse)
242
250
 
@@ -415,7 +423,7 @@ Generate architectural rules from the harness manifest (creates/updates `.sentru
415
423
  # From ultimate-pi checkout:
416
424
  npm run harness:sentrux-sync
417
425
  # From an external project (after pi install npm:ultimate-pi):
418
- node "$(node -p "require('path').join(require('path').dirname(require.resolve('ultimate-pi/package.json')),'scripts/sentrux-rules-sync.mjs')")" --force
426
+ npm run harness:sentrux-sync
419
427
  # Or in pi: /harness-sentrux-sync
420
428
  ```
421
429
 
@@ -433,13 +441,20 @@ sentrux gate --save . 2>/dev/null || echo "Baseline will be saved on first gate
433
441
 
434
442
  ## Step 3 — Pi Extension Packages
435
443
 
436
- Install pi extension packages from `.pi/settings.json`:
444
+ Bundled extensions load from the installed `ultimate-pi` package. Optionally install the companion lockfile used in development:
437
445
 
438
446
  ```bash
439
- cd .pi/npm
440
- npm install
447
+ UP_PKG="$(node -p "require('path').dirname(require.resolve('ultimate-pi/package.json'))")"
448
+ if [ -f "$UP_PKG/.pi/npm/package.json" ]; then
449
+ (cd "$UP_PKG/.pi/npm" && npm install)
450
+ echo "✓ ultimate-pi .pi/npm dependencies"
451
+ else
452
+ echo "✓ skip .pi/npm (not in package)"
453
+ fi
441
454
  ```
442
455
 
456
+ Merge extension entries from `$UP_PKG/.pi/settings.example.json` into this project's `.pi/settings.json` `packages` array (add any missing `npm:…` entries; keep existing user packages).
457
+
443
458
  Verify each package:
444
459
 
445
460
  | Package | Purpose | Phase |
@@ -461,9 +476,10 @@ The script below:
461
476
 
462
477
  ```bash
463
478
  # Verify package installed first
464
- ls .pi/npm/node_modules/@yeliu84/pi-model-router/package.json 2>/dev/null \
479
+ ls "$UP_PKG/node_modules/@yeliu84/pi-model-router/package.json" 2>/dev/null \
480
+ || ls "$UP_PKG/.pi/npm/node_modules/@yeliu84/pi-model-router/package.json" 2>/dev/null \
465
481
  && echo "✓ model-router package" \
466
- || echo "✗ model-router package — run: cd .pi/npm && npm install"
482
+ || echo "✗ model-router package — reinstall ultimate-pi or run npm install in $UP_PKG/.pi/npm"
467
483
 
468
484
  # Generate config from detected providers (only if missing)
469
485
  if [ -f .pi/model-router.json ]; then
@@ -579,7 +595,25 @@ Do NOT block. If generation fails, warn in report and continue.
579
595
 
580
596
  > `/router profile auto`
581
597
 
582
- The pi TUI will intercept this and activate the `auto` profile. Then continue to Step 4.
598
+ The pi TUI will intercept this and activate the `auto` profile. Then continue to Step 3.6.
599
+
600
+ ## Step 3.6 — Seed `.pi/agents` (pi-subagents)
601
+
602
+ `@tintinweb/pi-subagents` reads agent definitions from **this project's** `.pi/agents/`, not from the installed npm tree. Copy packaged agents when missing (preserves user edits):
603
+
604
+ ```bash
605
+ UP_PKG="$(node -p "require('path').dirname(require.resolve('ultimate-pi/package.json'))")"
606
+ mkdir -p .pi/agents/harness .pi/agents/pi-pi
607
+ for dir in harness pi-pi; do
608
+ [ -d "$UP_PKG/.pi/agents/$dir" ] || continue
609
+ for f in "$UP_PKG/.pi/agents/$dir"/*.md; do
610
+ [ -f "$f" ] || continue
611
+ base="$(basename "$f")"
612
+ [ -f ".pi/agents/$dir/$base" ] || cp "$f" ".pi/agents/$dir/$base"
613
+ done
614
+ done
615
+ echo "✓ .pi/agents (harness + pi-pi) seeded from package"
616
+ ```
583
617
 
584
618
  ## Step 4 — Configuration Files
585
619
 
@@ -644,7 +678,7 @@ Created: $(date +%Y-%m-%d)
644
678
  - .pi/harness/specs/ → Harness contracts and schema docs
645
679
  - .pi/harness/incidents/ → Incident and override records
646
680
  - `.agents/skills/` (npm package) → Harness skills (no copy into `.pi/skills/` needed)
647
- - .pi/agents/ → Specialized agents
681
+ - `.pi/agents/` → Specialized agents (seed from package — see Step 3.6)
648
682
 
649
683
  ## Graphify-First Workflow
650
684
 
@@ -668,14 +702,15 @@ Created: $(date +%Y-%m-%d)
668
702
  Re-run CLI verification (must pass unless `--skip-tools`):
669
703
 
670
704
  ```bash
671
- bash scripts/harness-cli-verify.sh
705
+ npm run harness:cli-verify
672
706
  ```
673
707
 
674
708
  Then run the remaining checks:
675
709
 
676
710
  ```bash
677
711
  # pi extensions
678
- cd .pi/npm && npm ls 2>/dev/null && echo "✓ pi extensions" || echo "✗ pi extensions"
712
+ UP_PKG="$(node -p "require('path').dirname(require.resolve('ultimate-pi/package.json'))")"
713
+ npm ls --prefix "$UP_PKG" 2>/dev/null | head -5 && echo "✓ ultimate-pi bundled extensions" || echo "✗ check ultimate-pi install"
679
714
 
680
715
  # graphify knowledge graph (pip/pip3, uv, apt, or PATH)
681
716
  PIP_CMD=""
@@ -707,7 +742,9 @@ print(f'✓ knowledge graph built ({n} nodes)' if n else '✗ graph.json has 0 n
707
742
  graphify hook status 2>/dev/null && echo "✓ graphify git hooks installed" || echo "✗ graphify git hooks not installed"
708
743
 
709
744
  # model router
710
- ls .pi/npm/node_modules/@yeliu84/pi-model-router/package.json 2>/dev/null && echo "✓ model-router package" || echo "✗ model-router package"
745
+ ls "$UP_PKG/node_modules/@yeliu84/pi-model-router/package.json" 2>/dev/null \
746
+ || ls "$UP_PKG/.pi/npm/node_modules/@yeliu84/pi-model-router/package.json" 2>/dev/null \
747
+ && echo "✓ model-router package" || echo "✗ model-router package"
711
748
  ls .pi/model-router.json 2>/dev/null && echo "✓ model-router config" || echo "✗ model-router config"
712
749
 
713
750
  # raw folder for graphify sources
@@ -764,7 +801,7 @@ Output summary table:
764
801
 
765
802
  Next steps:
766
803
  1. If tools missing: re-run with `--force` or install individually
767
- 2. If graph not built: run `bash scripts/harness-graphify-bootstrap.sh` (or `graphify update .` from project root)
804
+ 2. If graph not built: run `npm run harness:graphify-bootstrap` (or `graphify update .` from project root)
768
805
  3. If hooks not installed: run `graphify hook install`
769
806
  4. If gh not authenticated: `gh auth login`
770
807
  5. If self-hosted Firecrawl unhealthy: `docker compose -f firecrawl/docker-compose.yaml logs`
@@ -774,9 +811,9 @@ Next steps:
774
811
  ## Guard Rails
775
812
 
776
813
  - **Internet required**: Several tools need npm registry access. Block if offline.
777
- - **CLI verify script**: Step 2 and Step 5 use `scripts/harness-cli-verify.sh` — installs npm globals, Linux Chrome system libs for `agent-browser`, and smoke-tests each tool. Block on non-zero exit.
814
+ - **CLI verify script**: Step 2 and Step 5 use `npm run harness:cli-verify` (`.pi/scripts/harness-cli-verify.sh`) — installs npm globals, Linux Chrome system libs for `agent-browser`, and smoke-tests each tool. Block on non-zero exit.
778
815
  - **Graphify requires Python 3.10+**: Check `python3 --version`. Block if too old.
779
- - **Graphify bootstrap is mandatory** (unless `--skip-graphify`): Run `scripts/harness-graphify-bootstrap.sh`. Never use `graphify . --wiki`. Initial setup must run `graphify update .` and verify `graphify-out/graph.json` has nodes.
816
+ - **Graphify bootstrap is mandatory** (unless `--skip-graphify`): Run `npm run harness:graphify-bootstrap`. Never use `graphify . --wiki`. Initial setup must run `graphify update .` and verify `graphify-out/graph.json` has nodes.
780
817
  - **Python packages (Graphify)**: Before install, detect via PATH, `pip`/`pip3 show graphifyy`, `uv`, or apt. Prefer `uv tool install graphifyy`.
781
818
  - **Node.js >= 18 required**: Some pi packages use modern Node APIs.
782
819
  - **Docker required for self-hosted**: Step 1.5 needs Docker Engine + Compose. Block if install fails.
@@ -799,7 +836,7 @@ Next steps:
799
836
  | Graphify install fails | Show installer output. Retry `uv tool install graphifyy` or `pip3 install --user graphifyy`. Ensure `~/.local/bin` is on PATH. |
800
837
  | `graphify update .` fails | Block setup. Corpus may have no code files, or graphify not on PATH. Show stderr. |
801
838
  | Invalid `graphify .` usage | Replace with `graphify update .` — the `.` subcommand does not exist. |
802
- | graphify-out empty / 0 nodes | Re-run `bash scripts/harness-graphify-bootstrap.sh --force` from project root. |
839
+ | graphify-out empty / 0 nodes | Re-run `npm run harness:graphify-bootstrap -- --force` from project root. |
803
840
  | graphify hook install fails | Hooks need `.git/` directory. Verify inside git repo. Manual: `git config core.hooksPath .pi/git-hooks` |
804
841
  | firecrawl auth failed | Show manual login instructions. Continue with other tools. |
805
842
  | gh not installed | Show GitHub CLI install link. Skip label creation. |
@@ -0,0 +1,17 @@
1
+ # Harness CLI scripts
2
+
3
+ These scripts ship inside the `ultimate-pi` npm package under `.pi/scripts/`.
4
+
5
+ Pi's package manifest (`package.json` → `pi`) only loads **extensions**, **skills**, **prompts**, and **themes** — there is no `scripts` field. Harness scripts are invoked via:
6
+
7
+ - `npm run harness:*` (see root `package.json`)
8
+ - Extensions resolving paths with `resolveHarnessScript()` in `.pi/extensions/lib/harness-paths.ts`
9
+
10
+ | Script | npm script |
11
+ |--------|------------|
12
+ | `harness-graphify-bootstrap.sh` | `harness:graphify-bootstrap` |
13
+ | `harness-cli-verify.sh` | `harness:cli-verify` |
14
+ | `harness-verify.mjs` | `harness:verify` |
15
+ | `sentrux-rules-sync.mjs` | `harness:sentrux-sync` |
16
+
17
+ Repo-root `scripts/` (e.g. `regen_graphify_html.py`) is dev-only and excluded from the npm tarball via `.npmignore`.
@@ -9,7 +9,7 @@ import { join, dirname } from "node:path";
9
9
  import { fileURLToPath } from "node:url";
10
10
  import { spawn } from "node:child_process";
11
11
 
12
- const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..");
12
+ const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..", "..");
13
13
  const SPECS = join(ROOT, ".pi", "harness", "specs");
14
14
  const SMOKE = join(ROOT, ".pi", "harness", "evals", "smoke");
15
15
  const ADRS = join(ROOT, ".pi", "harness", "docs", "adrs");
@@ -117,7 +117,7 @@ async function checkSentruxRules() {
117
117
  }
118
118
  ok("sentrux architecture.manifest.json");
119
119
 
120
- const syncScript = join(ROOT, "scripts", "sentrux-rules-sync.mjs");
120
+ const syncScript = join(ROOT, ".pi", "scripts", "sentrux-rules-sync.mjs");
121
121
  const { code: checkCode, out: checkOut } = await runNodeScript(syncScript, [
122
122
  "--check",
123
123
  ]);
@@ -148,7 +148,7 @@ async function checkSentruxGate() {
148
148
  ok("Sentrux stub present");
149
149
 
150
150
  const { code, out } = await runNodeScript(
151
- join(ROOT, "scripts", "sentrux-rules-sync.mjs"),
151
+ join(ROOT, ".pi", "scripts", "sentrux-rules-sync.mjs"),
152
152
  ["--force", "--strict"],
153
153
  );
154
154
  if (code === 127 || (out && out.includes("not installed"))) {
@@ -3,7 +3,7 @@
3
3
  * Sync .sentrux/rules.toml from .pi/harness/sentrux/architecture.manifest.json.
4
4
  * Preserves user content outside the harness managed block.
5
5
  *
6
- * Usage: node scripts/sentrux-rules-sync.mjs [--check] [--force]
6
+ * Usage: node .pi/scripts/sentrux-rules-sync.mjs [--check] [--force]
7
7
  */
8
8
 
9
9
  import { readFile, writeFile, mkdir, access } from "node:fs/promises";
@@ -13,7 +13,7 @@ import { fileURLToPath } from "node:url";
13
13
  import { createHash } from "node:crypto";
14
14
  import { spawn } from "node:child_process";
15
15
 
16
- const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..");
16
+ const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..", "..");
17
17
  const MANIFEST = join(
18
18
  ROOT,
19
19
  ".pi",
@@ -4,7 +4,7 @@
4
4
  "maxRetries": 3
5
5
  },
6
6
  "packages": [
7
- "..",
7
+ "npm:ultimate-pi",
8
8
  "npm:@posthog/pi",
9
9
  "npm:context-mode",
10
10
  "npm:@tintinweb/pi-subagents",
@@ -1,5 +1,5 @@
1
1
  {
2
- "manifest_hash": "f386fef6c6281e47",
3
- "synced_at": "2026-05-15T11:30:59.026Z",
2
+ "manifest_hash": "9a3ee466588190f3",
3
+ "synced_at": "2026-05-15T14:49:38.156Z",
4
4
  "manifest_path": ".pi/harness/sentrux/architecture.manifest.json"
5
5
  }
@@ -41,9 +41,9 @@ order = 3
41
41
 
42
42
  [[layers]]
43
43
  name = "tooling"
44
- paths = ["scripts/*", "test/*"]
44
+ paths = [".pi/scripts/*", "test/*"]
45
45
  order = 4
46
- # Deterministic scripts and tests
46
+ # Harness CLI scripts and tests
47
47
 
48
48
  [[boundaries]]
49
49
  from = ".agents/skills/*"
@@ -66,7 +66,7 @@ to = ".pi/extensions/*"
66
66
  reason = "Contracts are data-only JSON schemas; extensions implement behavior"
67
67
 
68
68
  [[boundaries]]
69
- from = "scripts/*"
69
+ from = ".pi/scripts/*"
70
70
  to = ".agents/skills/*"
71
71
  reason = "CLI scripts stay independent of skill markdown"
72
72
 
package/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## [v0.2.6] — 2026-05-15
6
+
7
+ ### 🔧 Chores
8
+
9
+ - Align npm publish with pi package docs: explicit `files` allowlist (no dev runs, secrets, or local router config)
10
+ - Fix `pi` manifest: drop missing `.pi/providers`, add `.pi/skills`
11
+ - Ship `.pi/settings.example.json` instead of dev `.pi/settings.json` (removes `".."` local package from installs)
12
+ - Document layout in `.pi/PACKAGING.md`; harness-setup seeds `.pi/agents` and resolves package root for npm installs
13
+
14
+ ## [v0.2.5] — 2026-05-15
15
+
16
+ ### 🔧 Chores
17
+
18
+ - Move harness CLI scripts to `.pi/scripts/` (aligned with pi package layout; no `pi.scripts` manifest field)
19
+ - Point `npm run harness:*` and sentrux manifest at `.pi/scripts/`
20
+ - Exclude repo-root `scripts/` from npm publish (dev-only graphify helpers stay in checkout)
21
+
5
22
  ## [v0.2.4] — 2026-05-15
6
23
 
7
24
  ### 🐛 Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultimate-pi",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "Ultimate AI coding harness for pi.dev — extensible skills, Obsidian wiki knowledge layer, compressed context, deterministic output",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -24,22 +24,61 @@
24
24
  },
25
25
  "pi": {
26
26
  "extensions": [
27
- "./.pi/extensions",
28
- "./.pi/providers"
27
+ "./.pi/extensions"
29
28
  ],
30
29
  "skills": [
31
- "./.agents/skills"
30
+ "./.agents/skills",
31
+ "./.pi/skills"
32
32
  ],
33
33
  "prompts": [
34
34
  "./.pi/prompts"
35
35
  ]
36
36
  },
37
+ "files": [
38
+ ".agents",
39
+ ".sentrux",
40
+ ".pi/extensions",
41
+ ".pi/prompts",
42
+ "!.pi/prompts/release.md",
43
+ ".pi/skills",
44
+ ".pi/agents",
45
+ ".pi/scripts",
46
+ ".pi/lib",
47
+ ".pi/sounds",
48
+ ".pi/harness/specs",
49
+ ".pi/harness/docs",
50
+ ".pi/harness/sentrux",
51
+ ".pi/harness/evals",
52
+ ".pi/harness/evolution",
53
+ ".pi/harness/corpus",
54
+ ".pi/harness/README.md",
55
+ ".pi/npm/package.json",
56
+ ".pi/npm/.gitignore",
57
+ ".pi/model-router.example.json",
58
+ ".pi/settings.example.json",
59
+ ".pi/auto-commit.json",
60
+ ".pi/mcp.json",
61
+ ".pi/pi-vcc-config.json",
62
+ ".pi/SYSTEM.md",
63
+ ".pi/PACKAGING.md",
64
+ "firecrawl/docker-compose.yaml",
65
+ "firecrawl/.env.template",
66
+ "firecrawl/README.md",
67
+ "firecrawl/searxng",
68
+ "AGENTS.md",
69
+ "biome.json",
70
+ "CHANGELOG.md",
71
+ "README.md"
72
+ ],
73
+ "peerDependencies": {
74
+ "@mariozechner/pi-coding-agent": "*"
75
+ },
37
76
  "scripts": {
38
77
  "check:ts": "tsc --noEmit --target ES2022 --moduleResolution nodenext --module nodenext --skipLibCheck .pi/extensions/dotenv-loader.ts .pi/extensions/lib/posthog-node.d.ts .pi/extensions/lib/harness-posthog.ts .pi/extensions/lib/harness-paths.ts .pi/extensions/model-router-bootstrap.ts .pi/extensions/harness-telemetry.ts .pi/extensions/trace-recorder.ts .pi/extensions/observation-bus.ts .pi/extensions/drift-monitor.ts .pi/extensions/sentrux-rules-sync.ts .pi/extensions/custom-header.ts",
39
- "harness:graphify-bootstrap": "bash scripts/harness-graphify-bootstrap.sh",
40
- "harness:cli-verify": "bash scripts/harness-cli-verify.sh",
41
- "harness:verify": "node scripts/harness-verify.mjs",
42
- "harness:sentrux-sync": "node scripts/sentrux-rules-sync.mjs --force",
78
+ "harness:graphify-bootstrap": "bash .pi/scripts/harness-graphify-bootstrap.sh",
79
+ "harness:cli-verify": "bash .pi/scripts/harness-cli-verify.sh",
80
+ "harness:verify": "node .pi/scripts/harness-verify.mjs",
81
+ "harness:sentrux-sync": "node .pi/scripts/sentrux-rules-sync.mjs --force",
43
82
  "harness:meta-optimizer": "node .pi/harness/evolution/meta-optimizer.mjs",
44
83
  "lint": "biome check",
45
84
  "lint:fix": "biome check --fix",
package/.ckignore DELETED
@@ -1,41 +0,0 @@
1
- # .ckignore
2
-
3
- # Build artifacts (not useful for understanding code)
4
- target/
5
- dist/
6
- build/
7
- *.o
8
- *.so
9
- *.dylib
10
-
11
- # Dependencies (too large, low signal)
12
- node_modules/
13
- vendor/
14
- venv/
15
- .venv/
16
-
17
- # Media files (not code)
18
- *.png
19
- *.jpg
20
- *.gif
21
- *.mp4
22
- *.pdf
23
-
24
- <!-- # Large data files
25
- *.csv
26
- *.json
27
- *.xml
28
- *.log -->
29
-
30
- # Test fixtures (unless you search them)
31
- fixtures/
32
- __snapshots__/
33
- *.snap
34
-
35
- <!-- # Generated code (if not relevant)
36
- *_pb2.py
37
- *.generated.*
38
-
39
- # Documentation (include if you want AI to reference docs)
40
- # docs/
41
- # *.md -->
package/.codex/hooks.json DELETED
@@ -1,15 +0,0 @@
1
- {
2
- "hooks": {
3
- "PreToolUse": [
4
- {
5
- "matcher": "Bash",
6
- "hooks": [
7
- {
8
- "type": "command",
9
- "command": "/home/aryaniyaps/.local/bin/graphify hook-check"
10
- }
11
- ]
12
- }
13
- ]
14
- }
15
- }
package/.env.example DELETED
@@ -1,21 +0,0 @@
1
- POSTHOG_PERSONAL_API_KEY="phx_your_personal_api_key"
2
- POSTHOG_API_KEY="phc_your_project_key"
3
- # narrow the tool surface
4
- POSTHOG_MCP_FEATURES="llm_analytics"
5
- POSTHOG_PROJECT_NAME="ultimate-pi"
6
- POSTHOG_PRIVACY_MODE="false"
7
- # Harness domain events (harness-telemetry.ts); set false to disable harness_* only
8
- HARNESS_TELEMETRY_ENABLED="true"
9
- # Optional: require Sentrux stub for npm run harness:verify
10
- # HARNESS_SENTRUX_REQUIRED="true"
11
- FIRECRAWL_API_KEY="fc_your_firecrawl_api_key"
12
- FIRECRAWL_API_URL="http://localhost:3002"
13
- # FIRECRAWL_NO_TELEMETRY=0
14
- VAULT_WIKI_PATH="vault/wiki"
15
- CURSOR_API_KEY=""
16
- PI_VCC_CONFIG_PATH=".pi/pi-vcc-config.json"
17
- # VCC config: points to project-level pi-vcc config (overrideDefaultCompaction, debug)
18
-
19
- # graphify headless extract
20
- OPENAI_API_KEY="sk-your_openai_api_key"
21
- OPENAI_API_BASE="https://opencode.ai/zen/go/v1"
package/.gitattributes DELETED
@@ -1 +0,0 @@
1
- data/books/**/*.pdf filter=lfs diff=lfs merge=lfs -text
Binary file
@@ -1,33 +0,0 @@
1
- name: Lint and Format
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
- - master
8
- pull_request:
9
- branches:
10
- - main
11
- - master
12
-
13
- jobs:
14
- lint:
15
- runs-on: ubuntu-latest
16
- steps:
17
- - name: Checkout repository
18
- uses: actions/checkout@v4
19
-
20
- - name: Setup Node.js
21
- uses: actions/setup-node@v4
22
- with:
23
- node-version: 22
24
- cache: "npm"
25
-
26
- - name: Install dependencies
27
- run: npm ci
28
-
29
- - name: Run Biome check (Lint & Format)
30
- run: npm run lint
31
-
32
- - name: Run TypeScript check
33
- run: npm run check:ts