Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .claude/hooks/damage-control/bash-tool-damage-control.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ def glob_to_regex(glob_pattern: str) -> str:
]

DELETE_PATTERNS = [
(r'\brm\s+.*{path}', "delete"),
# `git rm` is a reversible git-index removal, not a filesystem delete —
# exclude it (mirrors the docker/podman/git exclusion in patterns.yaml).
(r'(?<!git\s)\brm\s+.*{path}', "delete"),
(r'\bunlink\s+.*{path}', "delete"),
(r'\brmdir\s+.*{path}', "delete"),
(r'\bshred\s+.*{path}', "delete"),
Expand Down
7 changes: 7 additions & 0 deletions .claude/hooks/damage-control/known-roads.jsonl
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@
{"agent": "pmoves-b850", "domain": "compose", "file": "/home/pmoves-knuckles/pinokio/api/PMOVES.AI/pmoves/docker/runner/docker-compose.runner.yml", "reason": "issue:2053", "session": "unknown", "tool": "Edit", "ts": "2026-07-11T04:28:37Z"}
{"agent": "unknown", "domain": "compose", "file": "C:/Users/russe/Documents/GitHub/PMOVES.AI/.claude/worktrees/g3-firefly/pmoves/compose/docker-compose.firefly.yml", "reason": "pr:1533", "session": "unknown", "tool": "Edit", "ts": "2026-07-12T11:56:27Z"}
{"agent": "pmoves-b850", "domain": "compose", "file": "/home/pmoves-knuckles/pinokio/api/PMOVES.AI/pmoves/docker-compose.amd-voice.yml", "reason": "handoff:knuckles-amd-voice-rocm-fix-2026-07-16.md", "session": "unknown", "tool": "Edit", "ts": "2026-07-16T21:32:23Z"}
{"agent": "z890", "domain": "schema", "file": "D:/PMOVES.AI/pmoves-room/pmoves/contracts/schemas/room/room.manifest.v1.schema.json", "reason": "handoff:darkxside-room-schema-2026-07-10.md", "session": "unknown", "tool": "Edit", "ts": "2026-07-10T19:23:06Z"}
{"agent": "z890", "domain": "schema", "file": "D:/PMOVES.AI/pmoves-room/pmoves/contracts/schemas/room/room.manifest.v1.schema.json", "reason": "handoff:darkxside-room-schema-2026-07-10.md", "session": "unknown", "tool": "Edit", "ts": "2026-07-10T19:23:35Z"}
{"agent": "z890", "domain": "schema", "file": "D:/PMOVES.AI/pmoves-room/pmoves/contracts/schemas/room/room.manifest.v1.schema.json", "reason": "handoff:darkxside-room-schema-2026-07-10.md", "session": "unknown", "tool": "Edit", "ts": "2026-07-10T19:23:44Z"}
{"agent": "z890", "domain": "schema", "file": "D:/PMOVES.AI/pmoves-pub-gate-bridge/pmoves/contracts/schemas/geometry/publish.gate.v1.schema.json", "reason": "handoff:pub-gate-bridge-contract-2026-07-11.md", "session": "unknown", "tool": "Write", "ts": "2026-07-11T23:57:01Z"}
{"agent": "z890", "domain": "schema", "file": "D:/PMOVES.AI/pmoves-pub-gate-bridge/pmoves/contracts/schemas/geometry/publish.gate.v1.schema.json", "reason": "handoff:pub-gate-bridge-contract-2026-07-11.md", "session": "unknown", "tool": "Write", "ts": "2026-07-11T23:57:15Z"}
{"agent": "z890", "domain": "topic", "file": "D:/PMOVES.AI/pmoves-pub-gate-bridge/pmoves/contracts/topics.json", "reason": "handoff:pub-gate-bridge-contract-2026-07-11.md", "session": "unknown", "tool": "Edit", "ts": "2026-07-12T00:02:51Z"}
{"agent": "z890", "domain": "topic", "file": "D:/PMOVES.AI/pmoves-pub-gate-bridge/pmoves/contracts/topics.json", "reason": "handoff:pub-gate-bridge-contract-2026-07-11.md", "session": "unknown", "tool": "Edit", "ts": "2026-07-12T00:03:01Z"}
22 changes: 22 additions & 0 deletions .claude/hooks/damage-control/known_roads.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,27 @@ def _is_schema_target(normalized_fwd: str) -> bool:
return "contracts" in parts and "schemas" in parts


def _is_topic_target(normalized_fwd: str) -> bool:
"""topic domain: the PMOVES NATS subject registry pmoves/contracts/topics.json.

topics.json is readOnly because a change to the subject contract ripples to
every publisher/subscriber and the shared `events.publish` topic validator.
It is NOT a *.schema.json, so the schema domain does not cover it; this domain
opens ONLY that one file under a `contracts` segment in a PMOVES-owned tree,
and — like schema — still requires a provable reason (pr:/issue:/handoff:).
"""
basename = os.path.basename(normalized_fwd).lower()
if basename != "topics.json":
return False
parts = normalized_fwd.lower().split("/")
if not any(
p == "pmoves" or p.startswith("pmoves-") or p.startswith("pmoves.")
for p in parts
):
return False
return "contracts" in parts
Comment on lines +81 to +99

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Require topics.json to be the direct child of contracts.

return "contracts" in parts also authorizes paths such as pmoves/contracts/untrusted/topics.json and pmoves/untrusted/contracts/topics.json. Since this predicate controls a Known Road bypass, those paths could receive topic-domain authorization incorrectly.

Proposed fix
-    return "contracts" in parts
+    return any(
+        part == "contracts"
+        and index + 1 < len(parts)
+        and parts[index + 1] == "topics.json"
+        for index, part in enumerate(parts)
+    )

Add negative tests for nested and unrelated contracts paths.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/hooks/damage-control/known_roads.py around lines 81 - 99, Update
_is_topic_target so topics.json is authorized only when its immediate parent
directory is contracts, while preserving the existing PMOVES-owned tree
requirement. Replace the broad contracts-segment check and add negative coverage
for nested and otherwise unrelated contracts paths.



def _is_dockerfile_target(normalized_fwd: str) -> bool:
"""dockerfile domain: PMOVES service Dockerfiles (and .dockerignore).

Expand Down Expand Up @@ -112,6 +133,7 @@ def _is_dockerfile_target(normalized_fwd: str) -> bool:
DOMAIN_PATTERNS: Dict[str, Callable[[str], bool]] = {
"compose": _is_compose_target,
"schema": _is_schema_target,
"topic": _is_topic_target,
"dockerfile": _is_dockerfile_target,
}

Expand Down
22 changes: 12 additions & 10 deletions .claude/hooks/damage-control/patterns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,24 @@ bashToolPatterns:
# ---------------------------------------------------------------------------
# DESTRUCTIVE FILE OPERATIONS
# ---------------------------------------------------------------------------
# Negative lookbehinds exclude `docker rm`/`podman rm` — targeted container
# removal is not mass filesystem destruction. The dangerous forms
# Negative lookbehinds exclude `docker rm`/`podman rm`/`git rm` — targeted
# container removal and reversible git-index removal are not mass filesystem
# destruction. `git rm` stages a tracked-file removal that git can recover;
# it is categorically different from `rm -rf`. The dangerous container forms
# (`docker rm $(docker ps -aq)`, `docker ps -q | xargs docker rm`, and
# their podman equivalents) are caught by dedicated hard-block rules
# further down the file ("Container sweep hard-blocks" section).
- pattern: '(?<!docker\s)(?<!podman\s)\brm\s+(-[^\s]*)*-[rRf]'
reason: rm with recursive or force flags (filesystem rm, not docker/podman)
- pattern: '(?<!docker\s)(?<!podman\s)(?<!git\s)\brm\s+(-[^\s]*)*-[rRf]'
reason: rm with recursive or force flags (filesystem rm, not docker/podman/git)

- pattern: '(?<!docker\s)(?<!podman\s)\brm\s+-[rRf]'
reason: rm with recursive or force flags (filesystem rm, not docker/podman)
- pattern: '(?<!docker\s)(?<!podman\s)(?<!git\s)\brm\s+-[rRf]'
reason: rm with recursive or force flags (filesystem rm, not docker/podman/git)

- pattern: '(?<!docker\s)(?<!podman\s)\brm\s+--recursive'
reason: rm with --recursive flag (filesystem rm, not docker/podman)
- pattern: '(?<!docker\s)(?<!podman\s)(?<!git\s)\brm\s+--recursive'
reason: rm with --recursive flag (filesystem rm, not docker/podman/git)

- pattern: '(?<!docker\s)(?<!podman\s)\brm\s+--force'
reason: rm with --force flag (filesystem rm, not docker/podman)
- pattern: '(?<!docker\s)(?<!podman\s)(?<!git\s)\brm\s+--force'
reason: rm with --force flag (filesystem rm, not docker/podman/git)
Comment on lines +27 to +44

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

The git rm exception is too broad in both enforcement layers.

Both layers inspect raw shell text, so wrappers can bypass deletion guards while valid Git option forms behave inconsistently. git rm also removes working-tree files and should not be treated as inherently non-destructive.

  • .claude/hooks/damage-control/patterns.yaml#L27-L44: replace the negative-lookbehind exception with command-aware matching and preserve protections for actual filesystem deletion.
  • .claude/hooks/damage-control/bash-tool-damage-control.py#L80-L82: apply the same parsed-command policy to READ_ONLY_BLOCKED and NO_DELETE_BLOCKED.
📍 Affects 2 files
  • .claude/hooks/damage-control/patterns.yaml#L27-L44 (this comment)
  • .claude/hooks/damage-control/bash-tool-damage-control.py#L80-L82
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/hooks/damage-control/patterns.yaml around lines 27 - 44, The `git
rm` exemption is overly broad because both enforcement layers match raw shell
text and allow destructive deletions through wrappers or inconsistent option
forms. In `.claude/hooks/damage-control/patterns.yaml` lines 27-44, replace the
negative-lookbehind patterns with command-aware matching that preserves
protection for filesystem `rm` while applying an explicit policy to `git rm`; in
`.claude/hooks/damage-control/bash-tool-damage-control.py` lines 80-82, apply
the same parsed-command policy to `READ_ONLY_BLOCKED` and `NO_DELETE_BLOCKED`.


- pattern: '\bsudo\s+rm\b'
reason: sudo rm
Expand Down
279 changes: 279 additions & 0 deletions docs/superpowers/plans/2026-07-20-combined-pinokio-customization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
# Combined PMOVES Pinokio Customization — Implementation Plan

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** Make PMOVES-pinokio the single combined home for all PMOVES Pinokio customizations via submodule aggregation (Model A), while each service-owned launcher also lives in its own fork.

**Architecture:** PMOVES-pinokio (fork of the Pinokio app) carries the 10 launcher-only apps in-tree and references `pmoves-crush`, `pmoves-claude-code`, and the `plugin/code` collection as submodules. The meta-repo's `pbnj/` becomes one submodule → PMOVES-pinokio. Claude Code integration lands via the extension surface (a closed CLI, no binary fork).

**Tech Stack:** git submodules, GitHub (`gh`), Pinokio launcher JS (`pinokio.js`/`install.js`/`start.js`), Pinokio's built-in auto-cli `installable` generator.

## Global Constraints

- Each repo change is its own **atomic PR**; fork repos use branch `PMOVES.AI-Edition-Hardened`.
- **Do not depend on Pinokio cloning `--recurse-submodules`.** Every submoduled launcher's `install.js` runs `git submodule update --init --recursive` explicitly.
- **Phase-1 submodule boundary:** only `pmoves-crush` and `pmoves-claude-code` are submoduled; `pmoves-agent-zero` and `pmoves-remote` stay in-tree (their service repos haven't claimed their launchers yet).
- **Disjoint sets:** the 10 in-tree launchers do not include `pmoves-crush`; no collision with Crush's distributed launcher.
- **Never commit secrets.** Launcher env comes from Pinokio env files / runtime, not committed defaults.
- The claude plugin must launch claude-code **pointed at PMOVES-claude-code**, never bare `npx @anthropic-ai/claude-code`.
- The full Claude Code integration *content* (hooks/skills/CHIT/MCP substance) is **out of scope here** — task #13's own spec. This plan builds the structure + a minimal bootstrap.

---

## File Structure

| Repo | Created / Modified | Responsibility |
|------|--------------------|----------------|
| `POWERFULMOVES/code` (new fork of `pinokiocomputer/code`) | Modify `code/claude/pinokio.js` | Code-plugin collection; `claude` repointed at PMOVES-claude-code |
| `POWERFULMOVES/PMOVES-claude-code` | Create `pinokio/api/pmoves-claude-code/{pinokio.js,install.js,start.js}`; `claude-config/` bootstrap | Own launcher + launcher-consumable PMOVES config scaffold |
| `POWERFULMOVES/PMOVES-pinokio` | Add `api/pmoves-*` (10, from verified merge); add submodules `api/pmoves-crush`, `api/pmoves-claude-code`, `plugin/code`; add `install.js` submodule-init | The combined home |
| `POWERFULMOVES/PMOVES.AI` (meta) | `git rm -r pbnj/`; add `pbnj` submodule; fix path refs | References the combined fork |

---

### Task 1: Fork pinokiocomputer/code and repoint the claude plugin

**Files:**
- Fork: `pinokiocomputer/code` → `POWERFULMOVES/code`
- Modify: `claude/pinokio.js` (the claude code-plugin)

**Interfaces:**
- Produces: a `POWERFULMOVES/code` repo on branch `PMOVES.AI-Edition-Hardened` whose `claude` plugin launches claude-code with PMOVES-claude-code config; consumed as the `plugin/code` submodule in Task 3.

- [ ] **Step 1: Fork and branch**

```bash
gh repo fork pinokiocomputer/code --org POWERFULMOVES --fork-name code --clone=false
gh api repos/POWERFULMOVES/code/git/refs --method POST \
-f ref=refs/heads/PMOVES.AI-Edition-Hardened \
-f sha="$(gh api repos/POWERFULMOVES/code/git/ref/heads/main --jq .object.sha)"
```
Expected: fork exists; new branch created.

- [ ] **Step 2: Clone the fork branch into a worktree-adjacent dir**

```bash
git clone -b PMOVES.AI-Edition-Hardened https://github.com/POWERFULMOVES/code.git ../pmoves-code-fork
```

- [ ] **Step 3: Repoint the claude plugin** (`../pmoves-code-fork/claude/pinokio.js`)

Change the launch `message` from bare `npx -y @anthropic-ai/claude-code@latest …` to a variant that (a) ensures PMOVES-claude-code is present and (b) launches claude-code with its config. Concretely, set `CLAUDE_CONFIG_DIR` (or `--settings`) to the PMOVES-claude-code checkout path and keep the `npx` invocation:

```js
// claude/pinokio.js — launch step env additions (both win32 and non-win32 branches)
env: {
CLAUDE_CODE_GIT_BASH_PATH: "{{kernel.path('bin/miniconda/Library/bin/bash.exe')}}",
CLAUDE_CONFIG_DIR: "{{kernel.path('api/pmoves-claude-code/claude-config')}}"
},
message: "npx -y @anthropic-ai/claude-code@latest {{args.prompt ? JSON.stringify(args.prompt) : ''}}",
```
(Keep the vanilla `npx` binary — the CLI is closed; PMOVES customization is delivered by `CLAUDE_CONFIG_DIR` pointing at the PMOVES-claude-code config scaffold.)

- [ ] **Step 4: Verify the edit is well-formed**

Run: `node -e "require('../pmoves-code-fork/claude/pinokio.js')"`
Expected: no syntax error (module loads).

- [ ] **Step 5: Commit + push + PR**

```bash
git -C ../pmoves-code-fork add claude/pinokio.js
git -C ../pmoves-code-fork commit -m "feat(claude): launch claude-code with PMOVES-claude-code config dir"
git -C ../pmoves-code-fork push origin PMOVES.AI-Edition-Hardened
```
Comment on lines +78 to +84

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Route repository changes through atomic PRs.

These steps push directly to hardened branches, contradicting the plan’s atomic-PR requirement. Push a topic branch, open the PR, and include smoke-test commands/results and reviewer notes before merge.

Also applies to: 144-149, 196-201

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/superpowers/plans/2026-07-20-combined-pinokio-customization.md` around
lines 78 - 84, Update each “Commit + push + PR” step to use an atomic topic
branch rather than pushing directly to PMOVES.AI-Edition-Hardened: create and
push a uniquely named topic branch, open a PR targeting the hardened branch, and
document smoke-test commands/results plus reviewer notes before merge. Apply
this consistently to all three referenced plan sections.

Source: Coding guidelines


---

### Task 2: PMOVES-claude-code launcher + config scaffold

**Files** (all at PMOVES-claude-code **repo root**, so the submodule at `api/pmoves-claude-code` places `pinokio.js` where Pinokio expects it):
- Create: `pinokio.json`, `install.js`, `start.js` (repo root)
- Create: `claude-config/settings.json` (minimal PMOVES bootstrap — MCP + hooks placeholder)

**Interfaces:**
- Consumes: nothing (leaf).
- Produces: `api/pmoves-claude-code` launcher (submoduled in Task 3) and `claude-config/` (referenced by Task 1's `CLAUDE_CONFIG_DIR`).

- [ ] **Step 1: Scaffold the launcher via the auto-cli installable pattern** (repo root)

Create `pinokio.json`:
```json
{ "title": "PMOVES Claude Code", "description": "Claude Code with full PMOVES context", "icon": "icon.png" }
```

- [ ] **Step 2: install.js** — ensures the repo + its config are present (idempotent)

```js
module.exports = {
run: [{
method: "shell.run",
params: { message: "git submodule update --init --recursive" }
}]
}
```

- [ ] **Step 3: start.js** — launch claude-code with PMOVES config

```js
module.exports = {
daemon: true,
run: [{
method: "shell.run",
params: {
env: { CLAUDE_CONFIG_DIR: "{{cwd}}/claude-config" },
message: "npx -y @anthropic-ai/claude-code@latest",
input: true
}
}]
}
```

- [ ] **Step 4: Minimal PMOVES bootstrap config** — `claude-config/settings.json`

```json
{ "$comment": "Minimal PMOVES bootstrap. Full hooks/skills/MCP substance is task #13.",
"env": { "PMOVES_NODE_ID": "z890" } }
```
Comment on lines +132 to +137

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Do not hardcode the z890 node identity in shared config.

A shared PMOVES-claude-code checkout will be used by multiple nodes, so this makes every installation report itself as z890. Read the node ID from runtime environment/secret management or leave it unset in the committed bootstrap.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/superpowers/plans/2026-07-20-combined-pinokio-customization.md` around
lines 132 - 137, Remove the hardcoded PMOVES_NODE_ID value from the bootstrap
settings in the “Minimal PMOVES bootstrap config” step. Leave the setting unset
so each installation can obtain its node identity from runtime environment or
secret management.

Source: Coding guidelines


- [ ] **Step 5: Verify JS loads + JSON valid**

Run: `node -e "require('./start.js'); require('./install.js')" && python -c "import json; json.load(open('claude-config/settings.json'))"`
Expected: no error.

- [ ] **Step 6: Commit + push**

```bash
git add pinokio.json install.js start.js icon.png claude-config
git commit -m "feat(launcher): pmoves-claude-code launcher + minimal PMOVES config scaffold"
git push origin PMOVES.AI-Edition-Hardened
```

---

### Task 3: Assemble the PMOVES-pinokio combined fork

**Files:**
- Base: worktree `D:/PMOVES.AI/pmoves-pbnj-submodule`, branch `pinokio-hardened-merge` (10 launchers already merged onto fork hardened).
- Add submodules: `api/pmoves-crush`, `api/pmoves-claude-code`, `plugin/code`.
- Create: `api/pmoves-crush/install.js` + `api/pmoves-claude-code/install.js` submodule-init shims if not carried.

**Interfaces:**
- Consumes: Task 1 (`POWERFULMOVES/code`), Task 2 (`PMOVES-claude-code`), PMOVES-crush (existing).
- Produces: PMOVES-pinokio hardened branch = the combined home; consumed by Task 4.

- [ ] **Step 1: Add submodules + the crush thin-entry** (in the `pinokio-hardened-merge` branch)

`pmoves-claude-code` and `plugin/code` are shaped with their launcher/plugins at repo root, so they submodule directly at their api/plugin path. `pmoves-crush`'s launcher is nested in its repo (`pbnj/pinokio/api/pmoves-crush/`), so it is pinned under `sources/` and surfaced via a thin in-tree api entry that delegates (respects Crush's structure, keeps version-pinning).

```bash
cd D:/PMOVES.AI/pmoves-pbnj-submodule && git checkout pinokio-hardened-merge
git submodule add -b PMOVES.AI-Edition-Hardened https://github.com/POWERFULMOVES/PMOVES-claude-code.git api/pmoves-claude-code
git submodule add -b PMOVES.AI-Edition-Hardened https://github.com/POWERFULMOVES/code.git plugin/code
git submodule add -b PMOVES.AI-Edition-Hardened https://github.com/POWERFULMOVES/PMOVES-crush.git sources/pmoves-crush
```

Create the thin delegating entry `api/pmoves-crush/pinokio.js` (in-tree) that loads the nested crush launcher from the submodule:
```js
// api/pmoves-crush/pinokio.js — delegate to the crush launcher pinned in sources/
module.exports = require("../../sources/pmoves-crush/pbnj/pinokio/api/pmoves-crush/pinokio.js")
```
And `api/pmoves-crush/install.js` runs `git submodule update --init --recursive` first so `sources/pmoves-crush` is present before the delegate resolves.

Expected: three `.gitmodules` entries (`api/pmoves-claude-code`, `plugin/code`, `sources/pmoves-crush`) + the in-tree `api/pmoves-crush/` thin entry.

- [ ] **Step 2: Add a top-level install shim** so `git submodule update --init --recursive` runs on install (`install.js` at repo root, or per-launcher)

```js
module.exports = { run: [{ method: "shell.run", params: { message: "git submodule update --init --recursive" } }] }
```

- [ ] **Step 3: Verify submodule wiring**

Run: `git submodule status`
Expected: three entries (`api/pmoves-crush`, `api/pmoves-claude-code`, `plugin/code`), each on its hardened branch.

- [ ] **Step 4: Push the combined fork** (this is the first outward-facing irreversible step — checkpoint with operator)

```bash
git push pinokio-fork pinokio-hardened-merge:PMOVES.AI-Edition-Hardened
```
Expected: fork hardened branch now carries app + 10 in-tree launchers + 3 submodules. If protected, push a PR branch instead.

---

### Task 4: Convert meta-repo pbnj/ to a submodule + fix path refs

**Files:**
- Remove: `pbnj/` (80 loose files)
- Modify: `.gitmodules` (add `pbnj`)
- Modify: `deploy/runbooks/pinokio-pbnj-install.md`, `.hermes/plans/2026-07-10_pmoves-p8-launcher-mesh-plan.md` (`pbnj/pinokio/api/*` → `pbnj/api/*`)

**Interfaces:**
- Consumes: Task 3 (PMOVES-pinokio hardened branch).
- Produces: meta-repo referencing the combined fork.

- [ ] **Step 1: Remove loose pbnj + add submodule** (on a fresh branch off `origin/main`)

```bash
git worktree add -b chore/pbnj-meta-submodule ../pmoves-pbnj-meta origin/main
cd ../pmoves-pbnj-meta
git rm -r pbnj
git submodule add -b PMOVES.AI-Edition-Hardened https://github.com/POWERFULMOVES/PMOVES-pinokio.git pbnj
```

- [ ] **Step 2: Fix path references** (`pbnj/pinokio/api/` → `pbnj/api/`)

Edit `deploy/runbooks/pinokio-pbnj-install.md` and `.hermes/plans/2026-07-10_pmoves-p8-launcher-mesh-plan.md`: replace every `pbnj/pinokio/api/` with `pbnj/api/`.

- [ ] **Step 3: Verify relative paths still resolve**

Check each launcher `start.js`/`install.js` under `pbnj/api/*` for `../../pmoves` refs; confirm they resolve against the Pinokio install layout (`D:\pinokio`), not the meta mirror. Note any that break; fix or document.

- [ ] **Step 4: Verify + commit**

Run: `git submodule status --recursive | grep pbnj`
Expected: `pbnj` resolves with nested submodules.
Comment on lines +233 to +236

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Validate nested submodules instead of filtering them out.

git submodule status --recursive | grep pbnj only proves the top-level pbnj entry appears; it does not verify nested submodule status. Check all recursive entries and fail on uninitialized or conflicted prefixes (-, +, or U).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/superpowers/plans/2026-07-20-combined-pinokio-customization.md` around
lines 233 - 236, Update Step 4’s recursive submodule verification to inspect
every entry rather than filtering with grep pbnj. Make the check fail when any
recursive status line begins with -, +, or U, while accepting initialized,
conflict-free nested submodules.


```bash
git add .gitmodules pbnj deploy/runbooks/pinokio-pbnj-install.md .hermes/plans/2026-07-10_pmoves-p8-launcher-mesh-plan.md
git commit -m "chore(pbnj): convert to submodule of PMOVES-pinokio + fix path refs"
```

---

### Task 5: Point the D:\pinokio install at the combined fork + end-to-end validation

**Files:** none in-repo (install-side).

**Interfaces:**
- Consumes: Tasks 1–4.

- [ ] **Step 1: Back up + repoint the install**

Confirm the current `D:\pinokio` app origin; set it to `POWERFULMOVES/PMOVES-pinokio` (branch `PMOVES.AI-Edition-Hardened`), or reinstall Pinokio from the fork. Preserve the operator's existing `env.tier-*` and secrets.

- [ ] **Step 2: Install each launcher from the combined fork**

For each `api/pmoves-*`: run its install (triggers `git submodule update --init --recursive`), confirm no error.

- [ ] **Step 3: Validate the claude plugin routes to PMOVES**

Launch the `claude` code-plugin; confirm `CLAUDE_CONFIG_DIR` points at `api/pmoves-claude-code/claude-config` (PMOVES bootstrap loaded), not vanilla.

- [ ] **Step 4: Validate distributed path intact**

Confirm `pmoves-crush` still installs/runs from its own PMOVES-crush repo unchanged.

- [ ] **Step 5: Full recursive status**

Run: `git -C D:/PMOVES.AI/PMOVES.AI submodule status --recursive`
Expected: `pbnj` and all nested submodules resolve clean.

---

## Notes

- Tasks 1, 2, 4 are safe/reversible until push. **Task 3 Step 4 (push to the fork) is the first irreversible outward-facing step — checkpoint with the operator**, consistent with how this design was gated throughout.
- The verified base artifact for Task 3 is `pinokio-hardened-merge` (10 launchers, 1303 commits history preserved) in worktree `D:/PMOVES.AI/pmoves-pbnj-submodule`.
- Deferred: PMOVES-claude-code deep-integration content (task #13 spec); auto-cli generator can regenerate any launcher whose `start.js` needs to change.
Loading
Loading