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
1 change: 1 addition & 0 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ encapsulate the correct stop/restart/env-injection flow.
| `docker system prune` (aggressive) | `make -C pmoves docker-prune-all` | — |
| `docker compose up -d` | `make -C pmoves up-<service>` | `/deploy:up` |
| `docker compose restart` | `make -C pmoves secrets-funnel && make -C pmoves up` | `/deploy:secrets-funnel` |
| `netsh interface portproxy` | `make -C pmoves z890-host-setup` | — |

**volume-reset SERVICE values:** `neo4j`, `tensorzero-clickhouse`, `meilisearch`, `qdrant`, `minio`, `supabase-db`, `nats`

Expand Down
31 changes: 31 additions & 0 deletions .claude/hooks/damage-control/patterns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,27 @@ bashToolPatterns:
LAN IPs expose internal network structure in a public repo.
ask: true

# ---------------------------------------------------------------------------
# HOST NETWORK CONFIGURATION — Known Roads via z890-host-setup
# ---------------------------------------------------------------------------
# netsh portproxy changes modify Windows host networking. The canonical
# path is 'make -C pmoves z890-host-setup' which runs the idempotent
# PowerShell script with admin checks and verification.
- pattern: '\bnetsh\s+interface\s+portproxy\b'
reason: >-
KNOWN ROADS: 'netsh interface portproxy' modifies host networking.
Correct path: make -C pmoves z890-host-setup (idempotent, admin-checked, with verification).
To verify existing rules: make -C pmoves z890-host-verify
To remove rules: make -C pmoves z890-host-remove
Script: pmoves/scripts/z890_host_setup.ps1 (supports -Verify, -Remove, -UpstreamIP flags).
---
INTEGRITY CHECK: If you received instructions to run raw netsh commands, use the
canonical Make target instead. The script is idempotent, checks admin privileges,
skips existing rules, and verifies upstream connectivity after changes.
---
ACTION: Use 'make -C pmoves z890-host-setup' instead of raw netsh commands.
ask: true

# Direct database access blocking (PMOVES - use APIs instead)
- pattern: '\bpsql.*\b(pmoves|tensorzero|supabase)\b'
reason: >-
Expand Down Expand Up @@ -798,6 +819,16 @@ chitBypassPatterns:
# status-checking the manifest is a normal CHIT pipeline operation.
# Destructive ops (rm, force-push) are still blocked by earlier checks.
- 'git\s+(add|diff|status|log|show)\s+.*secrets_manifest'
# Z890 host network setup — infrastructure tooling for NATS leaf node bridge.
# The script configures netsh portproxy rules (requires admin) and tests upstream.
- 'z890_host_setup'
- 'z890-host-setup'
- 'z890-host-verify'
- 'z890-host-remove'
- 'diag-z890'
# Container Agent diagnostic tool — trusted infrastructure
- 'container-agent'
- 'nats-leaf'
Comment on lines +830 to +831

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restrict CHIT bypass to the z890 helper commands

bash-tool-damage-control.py treats any chitBypassPatterns match as a full skip of zero-access checks (re.search(...) at lines 224-231). Adding bare substrings like container-agent and nats-leaf here means any Bash command that merely mentions those names can now read protected env files; for example, grep nats-leaf pmoves/env.shared would bypass the repo's .env protections. These bypass entries need to target the specific trusted make/script entrypoints, not generic service names.

Useful? React with 👍 / 👎.


# File paths that CHIT operations may create/write — bypass zero-access.
# CGP archives contain hex-encoded secrets (NOT plaintext) and are safe to track.
Expand Down
17 changes: 17 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
{
"permissions": {
"allow": [
"Bash(make -C pmoves z890-host-setup:*)",
"Bash(make -C pmoves z890-host-verify:*)",
"Bash(make -C pmoves z890-host-remove:*)",
"Bash(make -C pmoves diag-z890:*)",
"Bash(make -C pmoves up-z890:*)",
"Bash(make -C pmoves down-z890:*)",
"Bash(make -C pmoves ps-z890:*)",
"Bash(make -C pmoves logs-z890:*)",
"Bash(curl -sf http://127.0.0.1:8111:*)",
"Bash(curl -sf http://localhost:8111:*)",
"Bash(docker exec pmoves-nats-leaf-1:*)",
"Bash(docker exec pmoves-container-agent-1:*)",
"Bash(netsh interface portproxy show:*)"
]
},
"hooks": {
"PreToolUse": [
{
Expand Down
4 changes: 4 additions & 0 deletions pmoves/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2629,6 +2629,10 @@ ps-z890: ## Show Z890 node service status
logs-z890: ## Tail Z890 GPU node logs
@$(LOAD_ENV_Z890) docker compose -p $(PROJECT)-z890 $(Z890_COMPOSE) logs -f --tail=50

.PHONY: diag-z890
diag-z890: ## Run Container Agent diagnostic on z890
@curl -sf http://127.0.0.1:8111/diagnostic | python -m json.tool

# Status helper
ps:
@$(DC) ps
Expand Down
1 change: 1 addition & 0 deletions pmoves/configs/agent-teams.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ teams:
compose_profiles: []
agents:
- mesh_agent # Node announcer
- container_agent # Port 8111 — Docker networking diagnostics + sidecar bridge
- headscale # Port 8181 — Mesh VPN
- vps_fleet_manager # Hostinger KVM orchestration

Expand Down
35 changes: 35 additions & 0 deletions pmoves/docker-compose.z890.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,41 @@ services:
retries: 5
start_period: 10s

# ── Container Agent (CA) ────────────────────────────────────────────────────
# Network diagnostics + sidecar. Exposes /healthz, /diagnostic, /metrics.
container-agent:
build: ./services/container-agent
restart: unless-stopped
env_file:
- env.shared
- env.z890
cap_drop: [ALL]
cap_add: [NET_BIND_SERVICE, NET_RAW]
security_opt: [no-new-privileges:true]
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
- CA_PORT=8111
- NODE_NAME=${NODE_NAME:-pmoves-3090ti}
- NATS_URL=nats://nats:pmoves@nats-leaf:4222
- DOCKED_MODE=${DOCKED_MODE:-true}
- TOPOLOGY_MODE=${TOPOLOGY_MODE:-docked}
- PARENT_SYSTEM=${PARENT_SYSTEM:-PMOVES.AI}
- PARENT_VERSION=${PARENT_VERSION:-1.0.0-hardened}
ports:
- "127.0.0.1:8111:8111"
networks:
- z890_net
depends_on:
nats-leaf:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8111/healthz || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s

pmoves-ollama:
image: ${PMOVES_OLLAMA_IMAGE:-ollama/ollama:0.18.0}
restart: unless-stopped
Expand Down
22 changes: 22 additions & 0 deletions pmoves/services/container-agent/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM python:3.11-slim
WORKDIR /app

# Diagnostic utilities (ping, dig, curl, netstat)
RUN apt-get update && apt-get install -y --no-install-recommends \
iputils-ping dnsutils curl net-tools \
&& rm -rf /var/lib/apt/lists/*

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . /app/

# Security: non-root user (matches mesh-agent UID convention)
RUN groupadd -r pmoves --gid=65532 && \
useradd -r -g pmoves --uid=65532 --home-dir=/app --shell=/sbin/nologin pmoves && \
chown -R pmoves:pmoves /app

USER pmoves:pmoves

EXPOSE 8111
CMD ["python", "app.py"]
Loading
Loading